hey! nice one!
This is pure virtual knowledge shopping
t, b, c, d are the same like in the easing function I posted – which is actually from Robert Penner.
a and p … hm … p seems to be something like the “turning point” of the function – where the function switches between in and out …
I’ll do some research on this.
Georg
This is the official flash API documentation:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/transitions/easing/Elastic.html
so a: is the (a)mplitude of the sine wave and p the §eriod of the sinewave …
If you have access to a flash 8 installation you can search for the elastic.as file.
As usual this code is copyrighted and I am not sure if one can use it.
But the only difference between the Macromedia Code and the Quasimodo sample seems to be the way they calculate the default period, if it is undefined.
I would interpret this function as exponential interpolation (pow) that is modulated by a sine wave to get the elastic look.
Georg
thanks for the translation. I tried to convert this flash script to a maxscript…without success
I got a error message.
But i think this is not the right way, because it would always do this elastic motion. but actually it should only do it if the rotation goes to 0. and the shorter the time from the strongest bendangle to 0, the stronger the Elastic should be.
but what is if the rotation is fast…then slow…and than stops. then it should calculate this elastic from the slow rotation to 0.
I actually don’t understand the system of this formula, but in flash it is allways from A to B, and on B do a Elastic.easeOut.
but for this here i should be able to move the mouse the whole time and have the object following, and if i stop the mouse, then the Elastic.easeOut should come from the velocity.
Do you know perhaps how a script or formula for this would look like?
In this case you would need an ease from 0 to max speed and one from max speed to 0, if the rotation stops.
This could be done using the inertia approach I mentioned earlier:
if speed is 0 or speed is decreasing then
store the speed.
now
start easing and decrease the stored speed
until there is nor stored speed anymore
something like this.
I rebuild your setup to see what’s going on:
http://proforma.preset.de/spool/rdg-bendbyspeed_palm.mp4
Instead of looking for a more or less complex function I’d rather wire/script some of Flex modifiers parameter to change with the speed/rotation/direction of the turning plane.
That way the rotation_speed controlls still the overall bending – but the secondary motion is controlled by the flex. this is much more controllable and ‘felxible’.
Georg
watchingYourMp4AndBeingJealous!!!:bowdown:
thats what i was looking for
so you just inverted the script float of the bend modifyer to the flex strength??so the slower the plane rotates, the more the flex works???
damn good!!
well, to be honest in this setup the flex is just with its default values and no scripting/wiring.
The ‘magic’ is easy explained:
As the bend is proportional to the velocity of the plane:
More velocity more bend.
The Flex is proportional to the vertex movement in the object – ? is it ?
Anyway. If the plane slows down slowly the bend is slowly decreased: resulting in slow motion of the vertices -> low flex.
If the plane stops suddenly the bend is removed fast resulting in fast motion in the vertices -> strong flex.
The wiringg/scripting would be only necessary to have really different flex behaviours at different speeds and/or accelerations.
Georg
lol…embarassing!
then you have a good setup
I tried to apply the same script float as for the bend, just the min and max values set to .3 and .6…and it looks ok.
just for giving this thread a sense
I have to learn more about this easing formulas. It’s ugly how less i understand about it.
and thank you for the taching
It looks like I used nice values.
I just wanted to compile some kind of tutorial for a more generic setup.
As this setup produced ‘interesting’ results.
After some reasearch and thinking I found my errors.
The easing functiong takes the following parameters:
t: time – in our case the ‘speed’
should range from 0 to max speed
t[speed] = (timesample[t] – timesample[t-1]) + minSpeed
b: startValue – in our case the minimal Value -90°
c: change – in our case 180° as we want to interpolate between -90 and 90 degrees
d: duration – in our case “delta maxSpeed”
I am not sure this is the right term … it is the full range of speed:
the ‘distance’ between the lowest negative speed (if any) and the highest positive speed.
here is dumb script that looks for the essential variables minSpeed and “delta_maxspeed”:
(
turn_max = 0
turn_min = 0
for t = 1 to animationRange.end do (
at time t (
turn = $.rotation.controller.y_rotation
)
at time (t - 1) (
turn_pre = $.rotation.controller.y_rotation
)
if abs(turn_pre - turn) > turn_max then(
turn_max = turn_pre - turn
)
if turn_pre - turn < turn_min then(
turn_min = abs turn_pre - turn
)
)
format"delta_maxspeed: % : minSpeed: %
" (turn_max - turn_min) turn_min
Georg
em…does this work for you? I just get errormessages. Rotation is undefined and what else…
is this the way to get rotationValue:
$.rotation.controller.y_rotation
I dont understand this last line of code:
format"delta_maxspeed: % : minSpeed: %
" (turn_max - turn_min) turn_min
why is there a string?