View Full Version : revolution expresion?

 pelos12 December 2005, 08:03 PMi have to question, i was trying to find a expresion that let me set up the speed of an angle, example 3000 revolution per sec or hours in the pich and the name of the expresion for a weel to turn with the floor, i know that in LW are some plugins special for this, so you dont need to be calulating the radio of the weel etc.... (one is from worley i think and the other was free on flay.com)
Suricate
12 December 2005, 09:00 AM
Creating an expression for a revoluting object is very straightforward.

If you want to have an object constantly spin with 3000 revolutions per second, use the expression
(3000*DTOR*NOW)/FPS
and assign it to e.g. the pitch channel.
An explanation:
- 3000 is the number of revolutions per second
- multiply this value with the DTOR constant to get the angle in radians
- NOW is a built-in expression that returns the number of the current frame
- FPS is abuilt-in expression that return the current frames per second.

If you want to make the object rotate depending on the path that it has traveled, use the 'PathSoFar' expression, e.g.
PathSoFar(YourObject,NOW) / DiameterOfYourObject
and assign it to a channel.

If you want to create more complex things, e.g. a tank tread, check pout the 'ODist' at Zoogoono.com .

pelos
12 December 2005, 07:09 PM
thanks, Suricate

how can i change te revolution, to seconds? insted fps use sec? (i cant check right now, i dont have messiah in this computer)

whats DTOR? exactly? and why do i use radians? can it use angles up to 360?

thanks again =)

Suricate
12 December 2005, 12:20 PM
Hi Demain,

a few more notes on the expression:
- all trigonometric math functions use radians, that's a mathematical standard
- 180 degrees corresponds to PI = 3.1415926535898..., 360 degrees corresponds to 2 * PI = 6.2831853071796... and so on
- DTOR = 0.0174532925199 ... is just a linear factor to convert between radians and degree, e.g. 360 * DTOR = 360 * 0.0174532925199 = 6.2831853071796 = 2 * PI; similarly you can treat degrees larger than 360 or smaller than 0.
- for the other conversion, use the RTOD constant, which is 57.2957795130823 ... , e.g. 3.1415926535898 * RTOD = 3.1415926535898 * 57.2957795130823 = 180
- NOW is the number of the current frame as a floating point number, while FPS is the number of frames per seconds, also as a floating point number (e.g. 24.0 or 25.0 or 30.0)
- so if you want to create a constant revolution per second, you have to divide the current frame number by the current fps, which gives the expression NOW / FPS.

BTW, now I am noting that in my first example I gave the wrong expression. To get 3000 revolutions per second, the expression should be:
(3000*360*DTOR*NOW) / FPS

CGTalk Moderation
12 December 2005, 12:20 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.

1