Adding tilt with offsets in add_animation

flip889

local ror driver
I'm adding working windows to my van here so it has a vertical offset;
the only issue with just an offset would be that it would be visible on the inside, so it'll have to be rotated 10 degrees as it goes down
1760983462187.png
1760980624913.png

here are the placement lines below:

255, 254, 256, 0.535596508244, 0.789351081531, -0.06500, 187.00, 180, -1, leftvanwindow.mesh
add_animation, 0.001, -1.0, 0.00001, source:event,mode:y-offset, autoanimate, event:commands_13, noflip
add_animation, -0.001, -1.0, 0.00001, source:event,mode:y-offset, autoanimate, event:commands_14, noflip
add_animation, 0.001, -0.01, 0.00001, source:event,mode:z-offset, autoanimate, event:commands_13, noflip
add_animation, -0.001, -0.01, 0.00001, source:event,mode:z-offset, autoanimate, event:commands_14, noflip
add_animation, 0.001, -0.5, 0.00001, source:event,mode:x-rotation, autoanimate, event:commands_13, noflip
add_animation, -0.001, -0.5, 0.00001, source:event,mode:x-rotation, autoanimate, event:commands_14, noflip

i don't know if it's possible to make it rotate 10 degrees at the same rate as it goes down, but if it is, what numbers should i touch?

from my knowledge, the coefficient/degree affects rates, and the upper & lower limits affects how long it goes

hopefully those who know more than me could give some hints,

thanks.
1760980342420.png
 
The first 3 numbers are: Ratio, Lower limit and upper limit
So you need to change the ratio to synchronize movements.
For example, here I have 2 synchronized meshes: one that rotates 180 degrees while the other moves by 0.25 meters.

43, 45, 44, 1.144, -.046, 0, 90, 0, 180, skcount.mesh
add_animation .0075, 0, 180, source:event, mode:y-rotation, autoanimate, noflip, event:COMMANDS_14
add_animation -.0075, -.01, 0, source:event, mode:y-rotation, autoanimate, noflip, event:COMMANDS_13
43, 45, 44, 1, 0, 0, 0, 0, 0, skcountver.mesh
add_animation -.00001, -0.25, 0, source:event, mode:x-offset, autoanimate, noflip, event:COMMANDS_14
add_animation .00001, 0, .001, source:event, mode:x-offset, autoanimate, noflip, event:COMMANDS_13
 
so to find right ratios, what would you have to do?

would you have to take your limits and multiply them?

or something like lower times upper limit then divided by how long you want it to go in seconds?

i don't understand the relationships between the limits & ratio so making this is kinda confusing
 
Yes, it’s a bit confusing, the documentation does not explain exactly what the ratio represents.
I tried several times to find the right parameters... But we should be able to calculate it.
If I take my example and calculate displacement/ratio, I have:
180/0.0075=24000
0.25/0.00001=25000
(I think I should find the same result so that the 2 meshes are well synchronized.)
My animation lasts around 12 seconds, so for 1 second:
24000/12=2000

So the formula for the ratio should be:
Ratio= [offset(metre) or rotation (degree)] / [animation time (second) x 2000]

For example, if your window goes down by 0.5m in 3s, it would give:
Offset_ratio=0.5/(3*2000)=0.000083
Rotation_ratio=10/(3*2000)=0.001666

I guess...
 
Back
Top