Some More Refinements
In this tutorial we will deal with two issues, the first relates to the transition from flat ground to a slope and the second deals with steerable rear axles as found on many modern coaches. Both of these scenarios require some additional bones to the set you already have for other types of vehicle rig. An image to start with:
Here we see the armature for a coach with steerable rear wheels. The additional bones, over a two rear axle lorry, are the two bones that the rear-most wheel bones are parented to and the bone leading from the root bone backwards. The bones are as follows:
- Bone rear-axle-tilt which is parented to root inheriting rotation and scale and has a Damped Track constraint to the new target plane target-coach-axle.
- Bone rrw2-steer which is parented to rear-axle-tilt and inherits rotation and scale and has a driver on its Z axis with the formula -var / 4 with the target rw-f-tgt – Z axis, being the steering bone for the right front wheel.
- Bone rrw2-steer which is parented to rear-axle-tilt and inherits rotation and scale and has a Driver on its Z axis with the formula -var / 4 with the target lw-f-tgt – Z axis, being the steering bone for the left front wheel.
- Bone bus which is parented to root, inheriting scale and rotation and has a driver with the formula var with steering-track – X axis as the target.
So, what happens is this; when the target-coach-axle is out of line with the root bone, caused by the road curving upwards, or downwards, this makes rear-axle-tilt rotate about its horizontal axis and either lifts, or lowers the rear axle as shown below:
The plane target-coach-axle has the same curve modifier as the other planes and has a driver to keep it the required distance away from the fix plane.
The next thing to consider is what happens to the front wheels when the vehicle reaches a similar upward, or downward curve in the road. At the moment, the front wheels will either go into the road, or be raised above the road. To overcome this we move some of the parenting of the front end, so the steer control bones are now parented to the bus bone, which in turn is parented to root, so that when we rotate the bus bone, the front wheels are raised, or lowered thus:
This is achieved by adding a driver to the bus bone with the formula var and bone steering-track – X Local axis as the target. So, remember that steering-track is parented to the target plane to steer the wheels using its Z rotation, now its X rotation is used to tilt the vehicle.
To steer the back wheels we need to know the ratio of the distance from the main rear axle to the front axle and the distance to the rear steering axle from the main rear axle. Dividing the second of those by the first gives us the ratio; 0.25 in my case, so the rear steering wheels need to turn one quarter of the rotation of the front steering wheel on the same side, since they are one quarter of the distance away, hence why the drivers are -var / 4 in the case of these two steering bones. Note the minus sign to turn the wheels in the opposite direction to the front wheels.
Here is another picture of the rig with the bone names shown:
This image shows the truck & trailer going through a curve onto a slope, with the rear-most wheels raised, relative to root, to keep in line with the road and the front wheels also raised, relative to root, as they should be:
You should be able to see that the body bone is no longer at right angles to the root bone. Once on the slope, the root bone is in line with the curve, as is all the targets, so the wheels will once again also be in line and correctly positioned on the road.
The next image show the three trailer axles on the curved portion of the road at the start of the hill. Here I have used the same principles as applied to the coaches rear-most wheels, for both the rear-most and forward-most trailer axles to keep them in line with the road, note they are not in-line with the trailer bone:
One more image of the trailer wheels, their armature and associated planes:
The Vehicle Path Curves:
Getting the vehicle path curve to accurately follow a mesh road can be tricky, I tend to put in as few vertices as possible, then scale them to adjust the curve, occasionally sub-dividing two vertices if necessary. It is trial and error, just keep moving the vehicle and adjusting the curve until it fits. If you use a bevel object for the road profile, with the vehicle path as the curve, you avoid this issue altogether, but there are other drawbacks in that it is difficult to cater for different materials for different sections of the road as seen in the image above.
These settings for the vehicle path curves proved to be the best for keeping the tilt out of the vertices and helped to keep the vehicles under control, these are NOT the default settings for Bezier Curves:
And finally an image of the bus pulling away from the kerb, having just collected some passengers – fools that they are to use my bus, they don’t know what “gear” the driver is on:
You should be able to see the front wheels and the rear steering wheels have turned a little.
This page is finished 😛