[Blender] 4×4 autodrive system 6 1

4×4 autodrive system
blend file for test.

Versión 6.1 -06/09/2009.

Mechanical setup, released under Creative Commons by 2.0 license. France. By Philippe roubal. 3d-synthesiscom.
features :
-All Terrain 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, whel and Terrain : the system is ready todo play.

Animating the car requires only todo edit the curve (trajectory) in top view, and adjust the speed of the vehicle by an unique ipo curve.

Driving character provided, automátically animated. You can easily edit the shape and materiales of the Mesh todo create you own character that Will still be animated if you dont break the vertex groups.

Automatic tracks creation After each whel. Generates animated textures for tracks in all Ground materiales : sand, mud, Soil, Snow, Grass.
warning : due todo several bugs in the particle system in Blender 2.49a and 2.49b, the tracks creator doesnt allow todo render the animated texture based on particles of object type. So, por favor, use Blender 2.48a. If you use Hair particles todo create tracks in Grass, 2.48a has a los 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 todo use a small script written by atom, todo 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 gracias and credits :
The speed rotation of each whel is calculated separately, according todo its displacement in the 3d world. This operación is done by a nice Python script kindly written by jérôme mahíeux (France), known as littleneoon 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 a los want todo thank atom, an other member of the same forum, who wrote a very small but very useful script allowing todo get rid of an annoying bug in the particle system, while waiting todo a real bugfix in a future Blender release.
layers :
-Layer 1 : main rig :armature, sensors, empties.

Warning :
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 todo 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 todo adjust the length of the vehicle according todo the process described below.

Layer 2 : curve, moving reference-meshes, empties.

Layer 3 : basic whels 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-stering-target, empty-head-target.

Layer 5 : template meshes for Bones custom shapes.

Layer 6 : car body model 1.

Layer 7 : car top (rof).

Layer 8 : car whels.

Layer 9 : suspensión 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.
warning : this kit must stay on layer 15 : as some objects are set todo.

Unselectable, moving the kit todo an other layer Will not move the whole kit and Will break it. These unselectable objects are mostly parts of the remote control gear/clutch box.

The object driver-kit-parent has todo be parented todo the suspensión bone. The two empties empty-stering and empty-head have todo be parented todo the driver-kit-parent when you import them into an other blend file. To use them you Will have todo parent them todo empty-stering-target and empty-head-target.

If you want todo import this kit alone in an other file, do not forget todo unparent these empties and parent them todo 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.
note : all objects used in the car rig are set todo not renderable.
caution. Script activation :
Pléase type Alt+p from frame one in the text window, todo activate the whelrotation, py script. This script drivers the rotation speed of the whels. As it is activated at frame 1, you Will have todo launch the animation from frame 1 at least 1 time, otherwize, your whels Will not rotate. Pléase read the script itself for more informacións about whels naming and setup.

Playing the animation :

Alt+a todo launch the animation.
sugestions :
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 hands and fet. 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 todo se the tracks creator in action. The four particles emitters Will drop tires prints After each whel, while the tracks are baked in cache.
principle of the setup :
This is the 6.1 release, using armature and empties.

This rig doesnt contain interdependencies, so it is more responsive than previous versións.

The car body is parented todo the blue custom bone named suspensión.

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 whels Will be visible, as well as the axles and the suspensión 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 th rouge a copy location constraint and tracks the empty rear. Sensors-rear is parented todo sensors-front.

These sensors are afected 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 todo detect the level of the Terrain. An empty is vertex parented todo the central vertex of each square Mesh.

These 4 empties are used todo locate and align the Bones Alex-front-dn and Alex-rear-dn, in the 3d world, using copy location and track todo constraints.

As the geometry of the car chasis cant be kept by using a single rig based upon these two axles, the informacións given by this basic rig are reported onto copies of these axles, placed at the level of the whels centers. Axle-rear-up is locked on the z axis of the vehicle and copies the y rotation of Alex-rear-dn.

Empty-rear-ref-up is parented todo Alex-front-up and gives a precise location todo Alex-rear-up.

The choice of this double stage rig allows todo get rid of geométrical Deformations of the chasis, but the drawbak is a very slight loss of accuracy in the contact between the whels 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 todo do this correction. We Will se that later.

The sensors-front object is driven on the curve by the empty front, th rouge a copy location constraint, and is pointing todo empty-rear, th rouge a track todo constraint.

The empties empty-front, empty-rear, and empty-stering-target, are vertex parented todo small square meshes all driven by the same dloc IPO, and following the curve gracias todo a curve modifier. An other square Mesh is added, named head-target. This Mesh supports an empty named empty-head-target, used todo 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 todo adjust the speed of the car. The front whels are parented todo the Bones named ster-front. R and ster-front. L. These Bones copies the direction of the ster-pointer bone. The ster-pointer object tracks the empty-stering-target. The influence of the track todo constraint, as well as the location of the stering-target square Mesh on the curve, can be adjusted, todo adjust the stering angle of the whels.

The rear whels are parented todo the Bones named Rim-rear. R and Rim-rear. L.

The behaviour of the rear whels on their trajectory can be adjusted by moving the square Mesh supporting the empty-rear along the curve, in the chosen direction, accordingly todo the ipo (dlocx or dlocy). Playing with the distance between the square Mesh rear and the center of the rear Alex, Will give more or less trail effect on the rear whels. No distance means that the rear whels Will pass exactly in the tracks of the front whels, 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 todo correct the loss of altitude accuracy in extreme torsions of the chasis in high slopes. It is not the best method though.
.

Ver más sobre el tema y los comentarios en el foro