|
by Ron K. Lussier
Mini-Tutorial #1 Expressions 101 - Rolling a Ball
Set up: Create a Sphere and a Dummy helper object. Align them and link the Sphere to the Dummy. Assign a Checker map to the Sphere, maybe 2x3, for visual reference. The right number: In this case, pi. It is the ratio of a circles
circumference to it's diameter. (pi = 3.14159~) It can be called in Max expressions
by name. radius * 2 * pi = 1 full rotation (360 degrees) degToRad ( posit.x * 360 / (radius*2*pi) ) Expression explained: The inverse: Also, the reverse of that, for getting rotation from
movement ...but it fails at 90 degrees from Euler flipping. (I used this in the
"balbounc.max" file that is in the Scenes\Samples\Animation directory on the
Max2.5 CD.) MaxScript version?: Pros and Cons: MaxScript can do this extremely well because
it can calculate direction as well as distance, thus allowing the math to work on a wheel
rolling any direction. The disadvantage is that it only works when the animation is run
forward through every frame. (Moving the Time Slider, or playing the animation with
RealTime set can make the wheel(s) rotate incorrectly, but it will reset at frame zero
correctly.) ---------- All content ©1999
Burning Pixel Productions
|
|
| Home
| Info |
3ds Max |
Music |
Photography |
Vector Graphics |
Dancing Baby |
|