Exponential Move Formula
Posted: Wed Jan 25, 2006 11:38 am
I have been working on the fairing calcuations over the last few days.
One fairing option not available on Moho is Exponential. This is needed if you are doing an "infinite zoom/track" - the one which goes from a shot of the entire world, then tracks into a continent, then city, house. person, etc down to molecular level. Usually, this is many shots grouped together: Its tricky to set up and without this formula, you're never going to do it ... when working on 4 Dino's in New York (aka We're Back) for Universal, I had to calculated a move from 22F (22" inches wide" to an equivalent 0.25F zoom - it took 3 separate backgrounds and a week of Lynx Robotics software to calculate the Zoom, NS, and EW axis positions, including preparationof the field guides. To make it really fun, the move linked into an animated take-over and morph
.
Ah, the good old days of film ... I miss them. (Really, I do).
Back to the numbers. The great thing about this formula is that contains just 6 lines of code, with only one line of number-crunching. It's simple, elegant but a vital bit of maths. Don't even think of asking how I arrived at the answer or figured it out - just accept it works.
okay, here is the code (in Python)
If you are a photographer, the values, 4 and 16 will mean something to you, and the value at frame 4 is interesting as the mid-point is not 10 as you expect.
If someone wants to convert to lua script, then fine. I think this is of more interest to LM, which is why its .py.
I have a working python-code slow-in/constant/slow out formula - this one is linear fairings (soft stop): I am working on the radian fairings now - should have that finished by the week end. The documentation is taking a little time, as is the quirky nature of python code - I'm used to Pascal ... I cannot get the multi-dimentional array creation to work at present, and its driving me nuts (error is unknown function: array). I have now installed MubPY and hope that fixes the problem.
Any other idea why a = ([1, 2, 3], [4.0, 5.0, 6.5]) throws an error? I usually drop all the cruched numbers into a table, then just refer back to them for printing, driving motors etc. Saves on dual pass calculations.
Rhoel
One fairing option not available on Moho is Exponential. This is needed if you are doing an "infinite zoom/track" - the one which goes from a shot of the entire world, then tracks into a continent, then city, house. person, etc down to molecular level. Usually, this is many shots grouped together: Its tricky to set up and without this formula, you're never going to do it ... when working on 4 Dino's in New York (aka We're Back) for Universal, I had to calculated a move from 22F (22" inches wide" to an equivalent 0.25F zoom - it took 3 separate backgrounds and a week of Lynx Robotics software to calculate the Zoom, NS, and EW axis positions, including preparationof the field guides. To make it really fun, the move linked into an animated take-over and morph

Ah, the good old days of film ... I miss them. (Really, I do).
Back to the numbers. The great thing about this formula is that contains just 6 lines of code, with only one line of number-crunching. It's simple, elegant but a vital bit of maths. Don't even think of asking how I arrived at the answer or figured it out - just accept it works.
okay, here is the code (in Python)
Code: Select all
# -----------------------------------------
# Exponetial calculation vr: 1.00
# (c) 2006 TJ Francis
# ---------------
# Open Licence
# just credit me if you use it commercially
#------------------------------------------
position_a = 4.0 # --- start position of move
position_b = 16.0 # --- End Positof of move
Frames = 8 # --- How many frames, difficult, huh?
import math # --- include the math module
#--- Calc --------------------
unit_a = math.log(position_a) # --- Convert to Log values
unit_b = math.log(position_b)
inc = (unit_b - unit_a)/Frames # --- find the "linear" step value
n = 0 # --- Intialize the variables
value = 0.0
for n in range(Frames+1):
value = math.exp((unit_a + (inc*n))) # --- generate the positions
# ----------------------------
print n ," ", '% 6.1f' % (value) # --- Echo the results
If someone wants to convert to lua script, then fine. I think this is of more interest to LM, which is why its .py.
I have a working python-code slow-in/constant/slow out formula - this one is linear fairings (soft stop): I am working on the radian fairings now - should have that finished by the week end. The documentation is taking a little time, as is the quirky nature of python code - I'm used to Pascal ... I cannot get the multi-dimentional array creation to work at present, and its driving me nuts (error is unknown function: array). I have now installed MubPY and hope that fixes the problem.
Any other idea why a = ([1, 2, 3], [4.0, 5.0, 6.5]) throws an error? I usually drop all the cruched numbers into a table, then just refer back to them for printing, driving motors etc. Saves on dual pass calculations.
Rhoel