Go to: Synopsis. Return value. MEL examples.
Creates an expression that simulates rolling an object on the ground.
The rotation of the specified object is set based on the change in
position from the last time the expression was evaluated. The start
rotation values(for frame 1) are initially cached in dynamic
attributes added to the object: startRotX,Y and Z. Look under the extra
attributes block in the attribute editor to change these values.
Note that one should keyframe the X and Z position of the object to
animate, but not key the rotate values because the expression sets
these using rotate commands. When the animation is satisfactory one
should then bake the result, as scrubbing the time slider or rendering
will otherwise have inconsistent results.
Note that when the current frame is greater than 1 you can
interactively move the object in x and z while seeing the effect
of the rolling rotation.
If you are using radians for your rotate values, you will need to
remove "rad_to_deg" from the created expression.
makeRoll objectName groundHeight boxSimulation diameter
// Create a 1 unit sphere rolling on the groundplane
makeRoll nurbsSphere1 0.0 false 1.0;
// Create a rectangular prism rolling on the groundplane
scale -r 1 2 3;
makeRoll nurbsSphere1 0.0 true 1.0;
// Create a card rolling on the groundplane
scale -r 1 0.7 1;
makeRoll plane1 0.0 true 1.0;
// Create a torus rolling on the groundplane
torus -ax 0 1 0 -hr 0.5;
makeRoll nurbsTorus1 0.0 true 0.5;