Wheel on Spline Tut1

How to make a wheel rotate on a spline in 7 steps. (please read the 2nd Tut it is way easier)

wheel-on-spline

This is the formula: 2Pi * (Length of spline / distance on spline) / circumference of wheel(2Pi*r) = rotation(in radians)

Follow up:

Lets get started with a Spline (path) and a Cylinder (wheel)
Put the Cylinder in a Null
Align the Null on the Spline with the align-to-spline tag.

wheel-on-spline-tut

Now add an Xpresso tag somewhere and open the editor.
Drag the Cylinder, the Null, the Spline and the Align-tag in the editor.

1. Determine the length of the spline
Add a spline tag to the xpresso editor, connect its object port to the object port of the spline (object). Open the length port of the spline node and it gives you the lenght.

wheel-on-spline-tut-1
result nodes are blue

2. Determine the circumference of the wheel, Remember 2? r (2Pi r)
Open the radius port of the cylinder and multiply it by 2Pi (preset of the constant node)

wheel-on-spline-tut

3. Determine the total number of rotation the wheel does on the whole spline.
Divide the length of the spline by the circumference of the wheel (step 1 / step 2)

wheel-on-spline-tut

4. Determine where the wheel is on the spline.
Open the position port of the align to spline node. It will result in a 0.nn-->1 number

wheel-on-spline-tut

5. Determine the number of rotations compared to current position.
Multiply the total numbers of rotations (step 3) by the position on the spline (step 4)

wheel-on-spline-tut

6. Convert the result to radians
Until now we had the number of rotations on the spline. Now we multiply by 2Pi as to get radians. Do not convert to degrees as this is not an internal unit of xpresso.

wheel-on-spline-tut

7. Connect the result to the Cylinder Rotation-P
Voila you are rolling !!

2 comments

Comment from: Tiziano [Visitor] : 2006-01-05 @ 17:18
Brilliant!
Merci
Comment from: Vincent [Visitor] · http://www.wipix.fr/ : 2006-01-06 @ 00:23
yeah !
Excellent mini-tut !
Merci de partager ton savoir-faire ...

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
PoorExcellent
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)