Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   Infinite Rotation of Propeller (https://simplymaya.com/forum/showthread.php?t=16525)

djknucklez 29-04-2005 10:23 PM

Infinite Rotation of Propeller
 
I'm trying to create an expression for a propeller of an airplane. I want it to have an infinite rotatation but I also want to control the speed of it. I thought of this:

propellerGroup.rotateX = time +360;

it doesnt seem to work. Does anyone have any ideas?

mumbojumbo_13 30-04-2005 11:49 AM

you need to times the rotation by time, to speed it up use a value of around 720 instead of 360 or to lsow it down you need a value of 90
this script should read:
propellerGroup.rotateX = time*360;
hope that helps

Pony 01-05-2005 12:29 AM

well one thing I see. I belive time=fram number in this case basicly and if you have it do a compleate 360 every frame it will not look like its rotating, unless you render with 3d motion blur maybe.

To get it variable you will probably want do eather add a attrabute to like say the roter geo, or just a animation controle object like a red sphere. You would thin controle the animation buy makeing the exprestion read like :

propellerGroup.rotateX = time + Csphere.translateY + 30;

note your names will varry.

Alan 03-05-2005 08:17 AM

you just need to add it onto itself...

rotateX += 30 (or whatever speed you want)


:ninja:
Alan

mumbojumbo_13 03-05-2005 12:09 PM

hey pure how does that line work?
rotateX += 30
does that work as an expression every frame where it takes the rotate X value and adds 30 degress every frame?
--
how does maya keep track of the rotate X variable ?
i know in pascal you'd have to assign the rotate x value to a real value and update every frame- how does maya handle such a thing?

Alan 03-05-2005 12:14 PM

it just adds it to it on that frame and then the next time it does the addition (on the next frame) the value has already been updated so it just adds another 30 on... it's just a counter really nothing hard.

If you wanted it to be a bit more "animatable":

add an attribute called "speed" and then set the rotateX to be

rotateX += speed;

That way you can key the speed attr which will control the speed of the prop.

:ninja;
Alan


All times are GMT. The time now is 02:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018