Keep up-to-date with Free tutorials!!


Sign up to our twice-monthly newsletter today for the latest tutorials, interviews and product information.

Sign me up to receive third-party emails from 3dtotal's partners, too!

- Latest news
- Exclusive Shop Offers
- Preview early content
- Plus much more


Not Ready to take that step? OK, Why not just Subscribe to the RSS Feed

submit tutorial
1 | 2 | 3 | 4 | 5 | 6 | 7
Tank Rig Tutorial

| Your Rating:
rating star fullrating star fullrating star fullrating star fullrating star full
(12 Votes)
| Comments 2
Date Added: 9th December 2009
Software used:

The Spinning Expresion

We'll need a mathematical expression in the wheel's x-rotation controller. In this expression we need to find the x-rotation value regards the distance travelled by the tank. I could give you the expression and you could use it without knowing how it was made, but I wouldn't be a good teacher if I make it so easy!

Seriously speaking, its better that you start understanding how to make expressions for future rigs challenges. So, here we go, a small and very easy mathematical lesson:

How can we find the wheel's x-rotation? Think about the distance that a circumference needs to travel to make a full turn. This distance is equal to its perimeter (2*pi*radius).

To find the numbers of turns along a distance, we could take this distance and divide it by the distance travelled by one turn (as mentioned before, one turn is equal to the perimeter). For example, if we have a distance of three times the wheel's perimeter, dividing the first value over the perimeter will give us a number of 3 turns.

And what do we do next with the turn's number? We could multiply it by its equivalent in degrees, 360º or 2*pi in radians, and we got our expression!

This expression goes as follows:
(Distance / (2*pi*Radius)) * 2*pi

Actually, we may cancel the (2*pi) values by themselves. 2*pi / 2*pi is equal one (1), so we can remove these numbers, they're irrelevant now.

We got: Distance / Radius.

And what about the distance? How can we find it? We could do it using the percent along path of the path constraint, and the path's length. One value by the other will give us what we wanted: Distance= (Percent/100)*SplineLength, we divide Percent by 100 because here we need a percent that goes from 0 to 1. When the percent is 0% the distance is 0, when the percent is 100% the distance is equal the Spline's Length. 50% will give us a half of the spline's length, and so...

Finally the expression goes as follows: (Percent/100)*SplineLength / Radius

Now, we're going to put this expression in the wheel's x-rotation controller, we'll be using the script controller.

Select the wheel, in the Motion Panel open the Assign Controller rollout, select the Rotation: Euler XYZ Controller and click in the assign controller button, select Rotation List. With a list of rotations we may have 2 controller layers, one for the script and the other one for manual adjustments. Open the rotation List, in the Available controller assign an Euler XYZ controller, this controller is for manual adjustment, so we need to set it to active by double clicking it in the Rotation List rollout, or by clicking the "Set Active Button". When a controller is active this one will be the one that we'll be modifying by the rotation gizmo (manual adjustment).

Go back to the first Euler XYZ controller in the Assign Controller Rollout, open it, and in the x-rotation controller assign a float script controller

In the Expression Text Box write: SplineLength=curveLength Path, this line enables us to get the path's length using the curvelength maxscript function (it doesn't work well if the path spline is scaled). In the next line write the expression, (Percent/100)*SplineLength / Radius.

Then, we have to create the variables, and assign them their respective values.

In the Create Variable Group you have to write the names of the variables exactly as they're written in the Expression text box. Start writing the Path, then click on the Create Button, do the same with the Percent and radius.

We do not need to create the SplineLength variable because it going to get its value inside the script.


If we evaluate the expression now, we're going to get nothing, because we need to assign the variables to their respective values.

- Select Path in the Variables List and click in the Assign Node button, select the "Path" spline object in the "Track view Pick" DialogBox.

- Select Percent in the Variables List and click in the Assign Track button, select the control_Main's path constraint percent controller.

- Select radius in the Variables List and click in the Assign Constant button, write 0.473 (you can find it using the tape helper object measuring the wheel's diameter and then dividing by two).

You could assign the wheel's radius parameter to the radius variable if you need to change the wheels radius in the future.

If you evaluate now, we get our auto spinning system! You can check it out by moving the control_main object.


< previous page continued on next page >

1 | 2 | 3 | 4 | 5 | 6 | 7
Related Tutorials

Creating a humanoid mouth

by David op De Beéck
published on 2009-06-22

Keywords: modeling, mouth, humanoid, max,

rating star nonerating star nonerating star nonerating star nonerating star none (0)
Comments 0 Views 19970

UVW Channels and Tiles

by Aaron Dabelow
published on 2012-09-06

Keywords: mapping, uvw, max,

rating star fullrating star fullrating star fullrating star fullrating star half (7)
Comments 0 Views 34817

Total Texture Image Breakdown

by Richard Tilbury
published on 2009-12-09

Keywords: texturing, alley, breakdown, max,

rating star fullrating star fullrating star fullrating star nonerating star none (1)
Comments 0 Views 19352

Making Of 'Audi R8 in Desert'

by Jacobo Rojo
published on 2009-12-09

Keywords: scene, vehicle, car, audi, desert,

rating star fullrating star fullrating star fullrating star fullrating star none (4)
Comments 1 Views 42947
Readers Comments (Newest on Top)
Strob on Tue, 29 November 2016 7:48pm
Hi, nice tut! Can you tell us how would be the best way to scale that entire rig?
John Nulty on Sat, 30 April 2016 3:15pm
Great Tutorial, just some parts i am struggling with. Would you please do a video tutorial for the tank rigg? Thanks
Add Your Comment..