3ds Max Animating a Car Path – Part 02 – Spinning the Wheels

With the setup work completed, you are now ready to animate the car. Continue working on your file from the last movie or open the file named: Car-Rig_wheel-spin.max The next step is to constrain the car to the path. That’s the easiest part of the tutorial, one you have done many times already. Select the topmost parent, in this case the Car_Main_hlp object and go to the Animation menu. Choose Constraints>Path Constraint and then point and click the path in the scene. The car gets relocated but is now slightly sunk underground. You’ll fix that in a moment. Zoom back and scrub the animation. The car travels on the path but does not follow the trajectory. Enable the Follow option in the Motion panel. The car follows the trajectory now but it’s pointing the wrong way. You need to flip the axis direction to get it to point the right way. From a distance, the animation looks fine but as was pointed by Charles Burton in the Revit Interop tutorial, the wheels are not spinning. Zoom in for a better view. To adjust the car’s elevation, simply select the path and move it up until the wheels look about right. You can use the Z-Position type-ins to that effect. Scrub the animation. The lettering on the wheels is indeed static. To see it even better, you may want to set the animation playback to Frames and Ticks in the Time Configuration dialog. This subdivides the timeline for better detail. You may even want to revert to Shaded mode instead of Realistic to see the details without shadow effects. Go back to frame 0 and set the viewport for a better view. The time has come to spin the wheels according to distance traveled. For that, you require a bit of math and in particular a bit of trigonometry knowledge. Don’t be afraid, the formula needed is actually pretty simple. In any circular object, the amount of rotation (alpha) is dependent on the radius, and the arc length, both of which are based on data that you have. The arc length, when flattened, is the same value as the distance travelled by the car at any given time. The distance travelled by the car at any given time can be deduced from the total length of the path which is constant, and the Percent value of path travel which is a variable that changes with every frame. The radius is also a constant. In this particular case, the radius of each wheel is 13 units (or in this case 13 inches). This is information you usually have when you model the car but that you can verify with an existing asset. If you need to verify it, you can use the Tape tool. You can also temporarily create a circle or a cylinder and compare it with the wheel. With that information, the value you are looking for, that of the alpha angle expressed in radians, is equal to the Arc Length divided by the Radius. Since the Arc Length is the same as the distance traveled, the formula becomes alpha equals: distance over radius The radius is easy, as it is a constant as mentioned, and in this case equal to a value of 13. The distance (D) however is variable and defined by a percentage of path travel. To calculate it at any given time, you need to know the total length of the path, so you can calculate the travel percent. To get the total length of the path, you select it and go to the Utilities panel, where you can invoke the Measure tool. It returns a value a tad over 197′ Here you need to be careful because you need values based on 3ds Max’s System Units, that can differ from Display Units. Go to Customize>Units Setup. Sure enough, Display Units are set to Feet but a closer look at System Units says Inches. When working with wiring and expressions, make it a habit of temporarily switching your Display Units to Generic. This ensures Display Units show the same values as System Units. You can always change your Display Units back to Feet or whatever your preference is at a later time. Sure enough, when set to Generic Units, the path now shows a total length of 2365.065 units, which is essentially 197’x12 (12″ to a foot). Mark that value as you will need it in a second. The distance traveled by the car is determined by the main helper as it travels on the path. This means you need to establish a relationship between the main helper and the spinning wheel, starting with the front-left wheel. Select the main helper and right-click to get the Quad menu. Choose Wire Parameters>Transform>Position>Path Constraint>Percent. This is the variable that changes with every passing frame. With the rubber band that appears, you now need to select the Front-Left wheel. Here you want to make sure you select the wheel and not another object such as the floor, so adjust your view accordingly. In fact, it’s very easy to miss picking the intended object so my recommendation is to always select it from a list. Press H to select the Front Left wheel from a list. If you’re using 3ds Max 2015 or newer, you can also use the Scene Explorer. Select the Front Left wheel and then choose Transform>Rotation>Zero Euler XYZ>Z Rotation. If you recall, that was the local axis the wheel is supposed to spin around. The wiring dialog appears. First you need to choose a link direction. It can be one-way or two-way. In this case, the rotation of the wheel is based on path travel so you’ll set it one-way, where the main helper controls wheel spin. As mentioned earlier, the distance is based on a travel percent of the total path length. That makes the “D” value in our formula equal to (2365.065*Percent), 2365.065 being the total path length and the Percent value a variable that changes with every frame. Go ahead and enter this value (2365.065*Percent) in the wiring dialog. Since the formula for calculating the spin angle is D/R, add a /13 to the formula in the wiring dialog. Now click the Connect button to evaluate the formula. Scrub the animation slowly to see the results in the viewport. The Front-Left wheel is now spinning appropriately. Select the formula and use Ctrl+C to copy it to memory and dismiss the wiring dialog. Repeat the procedure for the Rear-Left wheel. This time though, instead of rewriting the formula, simply paste it using Ctrl+V and then click the Connect button. Scrub the animation. Both left side wheels are now spinning properly. Try the procedure on the Front-Right wheel but keep the wiring dialog open. Notice as you scrub the animation that the wheel is spinning backwards. Simply add a – (minus) sign to invert the formula for the opposite side of the car and click Update. Finish off the wiring work on the fourth wheel and save you file. If spinning the wheels is all that you’re interested in, then you can stop this tutorial right now. For those who worked on the Revit Interoperability tutorial, this is enough to achieve reasonable results. Keep in mind that for this to work, the wheels need to be independent objects from the rest of the car. That’s not the case for the cars used in the Revit tutorial, so you may need to do some extra work detaching the elements that make the wheels. Once the wheels are detached, you want to center their pivot points so they can spin about a center point. Let’s get back to our old car. If you’re interested in fine-tuning the car rig further, then move on to the next movie. This is where you establish relationships between the front wheel helpers and the steering wheel.

Leave a Reply

Your email address will not be published. Required fields are marked *