Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   Scripting Question (https://simplymaya.com/forum/showthread.php?t=7514)

RenardMF 18-08-2003 09:00 PM

Scripting Question
 
Does anyone know of the expression to use to adjust and objects velocity/acceleration. For example i have a ring and i want to make it start spinning really fast and gradualy come to a halt slowing down speed over time. What would be the easist way to script this?

mtmckinley 18-08-2003 09:48 PM

OBJECTNAME.rotateY = 100/(frame/500);

You'd substitute the rotation direction with whichever direction you want.

You'd also want to experiment with the number amounts to get the speed you want.

RenardMF 18-08-2003 09:53 PM

Thanks ill try that now.:D

RenardMF 18-08-2003 10:03 PM

How bout make it spin like that and slow and then come to a complete stop at its original location?

mtmckinley 19-08-2003 02:06 AM

You'd have to figure out the math for that, I'm afraid. I'm not sure what you'd need to do to get it to stop on a dime.

mark_wilkins 21-08-2003 02:34 AM

The easiest way to do this is by keyframing the animation. Set a few keys, mess with the tangents a bit, and you'll get the result you need.

Alternatively, if you're looking for a generalized velocity/acceleration solution, consider using particle or solid body dynamics. You can apply forces or accelerations and rely on the dynamics solver to figure out the resulting motion.

Finally, you can try using a mathematical expression for the rotation. This is my least favorite approach because it requires figuring out how you want the velocity to change and then essentially analytically integrating it, which if you don't recall your calculus very well is going to be a trouble-filled, trial-and-error endeavor.

-- Mark


All times are GMT. The time now is 08:57 PM.

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