Basically, I've done a script, and I'm stuck on a formula for it. After I run the code on a cube, based on two different inputs (detail level and vertex average iterations), the resulting size will be different, and needs to be scaled upwards to fit normally again.
I've just wrote down the amounts it needs to be scaled by, in the hopes of making a formula that will calculate it, and automatically upscale it. So far, I have the first part, but the second part, which throws the other exponential values into it, doesn't seem to work with them all at once (I tried one but I presume each attempt will have the same result).
Here are the results I got, although it's not fully accurate as it was based on my judgement and what I expected. It is these values I need to figure out a formula for, so given detail level 1 and iteration of 7, it would result in slightly over 1.375.
Detail level of 0 0 = 1.2 1 = 1.45 2 = 1.65 3 = 1.8 4 = 1.9 5 = 1.95 Detail level of 1 0 = 1.1 1 = 1.2 2 = 1.285 3 = 1.35 4 = 1.375 Detail level of 2 0 = 1.05 1 = 1.1 2 = 1.125 3 = 1.137 4 = 1.144 Detail level of 3 0 = 1.025 1 = 1.035 2 = 1.054 3 = 1.06 4 = 1.07
So, to get the scale amount for any detail level with 0 vertex iterations, here is the way to do it, the output from this would be 1.2, 1.1, 1.05, etc, which matches the table perfectly.
Number to start with is 1.2 Run this for the number of detail levels selected: New number = (old number - 1) ÷ 2 + 1
Then I wrote something based on the 2nd detail level to calculate the final result. It was obviously following an exponential pattern of (not sure how to put it in maths terms) +0.5 +0.25 +0.125 etc, so I believed it should then apply to the rest of the values. Unfortunately it did not, and gave drastically wrong results when trying with the other detail levels.
If I could have a little help finding something that would fit all the values I wrote above, or a better way of going about it, I'd be very grateful.