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?
|
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. |
Thanks ill try that now.:D
|
How bout make it spin like that and slow and then come to a complete stop at its original location?
|
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.
|
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