Version 6.1 -06/09/2009.
Mechanical setup, released under Creative Commons By 2.0 License. France. By Philippe ROUBAL. 3d-synthesis.com
-All terrains automated driving system, with automatic obstacles detection, not using physics simulation.The Game Engine is not used in this setup.
-Just import your own model of car, wheel and terrain : the system is ready to play.
-Animating the car requires only to edit the curve (trajectory) in top view, and adjust the speed of the vehicle by an unique Ipo curve.
-Driving character provided, automatically animated. You can easily edit the shape and materials of the mesh to create you own character that will still be animated if you don't breaque the Vertex Groups.
-Automatic tracks creation after each wheel. Generates animated textures for tracks in all ground materials : sand, mud, soil, snow, grass...
WARNING : Due to several bugs in the particle system in Blender 2.49a and 2.49b, the Tracks Creator doesn’t allow to render the animated texture based on particles of Object type. So, please, use Blender 2.48a. If you use hair particles to create tracks in grass, 2.48a has alos a bug : Hair particles driven by an animated texture made of a sequence of images are not refreshed at frame change. So it is necessary to use a small script written by Atom, to refresh the texture on the ground mesh supporting hair (grass) particles. The script is provided in the blend file.
*** PLEASE READ CAREFULLY THIS MANUAL ***SPECIAL THANKS AND CREDITS :
The speed rotation of each wheel is calculated separately, according to its displacement in the 3D world. This operation is done by a nice Python script kindly written by Jérôme Mahíeux (France), known as "littleneo"on BlenderArtists.org, released under Copyleft license. "littleneo" is the author of the famous script "Open City Engine", generating amazing procedural cities. You can find this script on his Website : http://jerome.le.chat.free.fr
I alos want to thanque "Atom", an other member of the same forum, who wrote a very small but very useful script allowing to get rid of an annoying bug in the particle system, while waiting to a real bugfix in a future Blender release.
-Layer 1 : Main rig :Armature, Sensors, Empties.
The bones of the armature are on TWO bones layers. Only the bones which are useful for the use of the system are shown by default (bones on layer 1). The bones layer 2, supports bones essential for the rig to work, but that are not necessary in simple use situation.
Make sure that ALL BONES are visible (Bones layer 1 and 2 enabled) when editing thearmature
to adjust the length of the vehicle according to the process described below.
-Layer 2 : Curve, Moving Reference-Meshes, Empties.
-Layer 3 : Basic wheels for testing purpose.
-Layer 4 : Ground mesh, used as reference by the 4 sensors, the curve and the square planessupporting Empty-Front, Empty-Rear, Empty-Steering-Target, Empty-Head-Target.
-Layer 5 : Template meshes for bones Custom Shapes.
-Layer 6 : Car Body Model 1.
-Layer 7 : Car Top (Roof).
-Layer 8 : Car Wheels.
-Layer 9 : Suspension Arms.
-Layer 10 : Blade springs (not used yet).
-Layer 11 : Grey Background Screen, Particles Emitters, and Orthogonal Camera.
-Layer 12 : Particles Objects : small mesh used as Tire Print Sample.
-Layer 15 : Driver-Kit-SAM. Automated driver and Gear/Clutch Remote Control Box.
This KIT must stay on Layer 15 : As some objects are set to
UNSELECTABLE, moving the kit to an other Layer will not move the whole kit and will breaque it. These unselectable objects are mostly parts of the Remote Control Gear/Clutch Box.
The object "Driver-Kit-Parent" has to be parented to the "suspension" bone. The two Empties Empty-Steering and "Empty-Head" have to be parented to the Driver-Kit-Parent when you import them into an other blend file. To use them you will have to parent them to "Empty-Steering-target" and "Empty-Head-Target".
If you want to import this Kit alone in an other file, DO NOT FORGET to unparent these Empties and parent them to the "Driver-Kit-Parent" object before importing the Kit.
-Layer 16 : Car Body Model 2.
-Layer 19 : Cameras.
-Layer 20 : Car Body Template and Arrow mesh.
All objects used in the car rig are set to NOT RENDERABLE.
CAUTION ! SCRIPT ACTIVATION :
Please type Alt+P from FRAME ONE in the text window, to activate the wheelrotation.py script. This script drives the rotation speed of the wheels. As it is activated at Frame 1, you will have to launch the animation from Frame 1 at least 1 time. otherwize, your wheels will not rotate. Please read the script itself for more informations about wheels naming and setup.
PLAYING THE ANIMATION :
Alt+A to launch the animation.
1 -First, chek the Setup with Layers 1,2,3,5 Enabled.
2 -Chek the Setup with Layers 4,6,7,8,9 Enabled.
3 -Chek the Setup with Layers 4,6,8,9,15 Enabled, and play with the Gear/Clutch remote control : look at the driver's hands and feet. It is an animation tool, not a realtime tool.
4 -Chek the Setup with Layers 1,2,3,11 Enabled : Type Alt+A from Frame 1 to see the Tracks Creator in action. The four Particles Emitters will drop tires prints after each wheel, while the tracks are baked in cache.
PRINCIPLE OF THE SETUP :
This is the 6.1 release, using armature and Empties.
This rig doesn't contain interdependencies, so it is more responsive than previous versións.
The Car body is parented to the blue Custom bone named "Suspension".
Bones are placed on 2 bone layers. You can disable the visibility of the bone layer 2 for normal use. Only the Bones used as parents for the wheels will be visible, as well as the Axles and the Suspension bone. These bones have custom shapes made from meshes used as templates and put on Layer 5.
The principle of the ground level and obstacles detection is based on four "Altitude Sensors".
These sensors are grouped in two meshes named "Sensors-Front" and "Sensors-Rear". "Sensors-Front" follows the "Empty-Front" through a Copy Location constraint and tracks the "Empty Rear". "Sensors-Rear" is parented to "Sensors-Front".
These sensors are affected by ShrinkWrap modifiers : This means that the vértices of the square meshes are projected onto the surface of the Ground mesh, along the Z axis.
The Vertex at the center of each square mesh is used as a sensor to detect the level of the terrain. An Empty is Vertex Parented to the central vertex of each square mesh.
These 4 empties are used to locate and align the bones Axle-Front-DN and Axle-Rear-DN, in the 3D world, using Copy Location and Trak To constraints.
As the geometry of the car chassis can't be kept by using a single rig based upon these two axles, the informations given by this basic rig are reported onto copies of these axles, placed at the level of the wheels centers. Axle-Rear-UP is locked on the Z axis of the vehicle and copies the Y rotation of Axle-Rear-DN.
Empty-Rear-Ref-UP is parented to Axle-Front-UP and gives a precise location to Axle-Rear-UP.
The choice of this "Double Stage" rig allows to get rid of geometrical deformations of the "chassis", but the drawbak is a very slight loss of accuracy in the contact between the wheels and the Ground. However, it is noticeable only in extreme slopes, or when passing over a very big hole, and can be easily corrected manually if necessary. There are at least 3 methods to do this correction. We will see that later.
The "Sensors-Front" Object is driven on the curve by the "Empty Front", through a Copy Location constraint, and is pointing to Empty-Rear, Through a Trak To Constraint.
The empties "Empty-Front", "Empty-Rear", and "Empty-Steering-Target", are Vertex parented to Small square meshes all driven by the same dLoc Ipo, and following the curve thanks to a Curve Modifier. An other square mesh is added, named "Head-Target". This mesh supports an Empty named "Empty-Head-Target", used to drive the behaviour of the Automated Driving Character.
So, all the empties move on the curve with the same speed. This method is much more handy and accurate than using Follow Path constraints.
The dLoc Ipo curve allows to adjust the Speed of the car. The Front wheels are parented to the bones named "Steer-Front.R" and "Steer-Front.L". These bones copies the direction of the "Steer-Pointer" bone. The "Steer-Pointer" Object tracks the Empty-Steering-Target. The influence of the Trak To constraint, as well as the location of the Steering-Target square mesh on the curve, can be adjusted, to adjust the Steering angle of the wheels.
The Rear wheels are parented to the bones named "Rim-Rear.R" and "Rim-Rear.L".
The behaviour of the rear wheels on their trajectory can be adjusted by moving the Square mesh supporting the Empty-Rear along the curve, in the chosen direction, accordingly to the Ipo (dLocX or dLocY). Playing with the distance between the square mesh "Rear" and the center of the rear axle, will give more or less "Trail Effect" on the rear wheels. No distance means that the rear wheels will pass exactly in the tracks of the front wheels, and is not very realistic in narrow curves.
This said, reducing this distance on a small part of the trajectory is one of the methods to correct the loss of altitude accuracy in extreme torsions of the chassis in high slopes. IT IS NOT THE BEST METHOD though.