Importing your own terrain mesh
importing your own Terrain Mesh
important : do not forget that several important objects are using the Ground Mesh, th rouge Shrinkwrap modifiers.
So, the Ground object name is important. To avoid troubles when importing the setup, give todo your own Terrain an other name, and import the Ground Mesh.
Then, select your Terrain and the Ground Mesh, and with the Ground Mesh selected, type Control + l and choose Mesh data.
The Ground Mesh Will kep its name, but Will get all its properties from your own Terrain Mesh. So, the new Ground Mesh Will be idéntical todo your own Terrain.
After that, you can deleete your own original Terrain Mesh. To be safe, always kep a copy of it in a file.
.
8 Archivos adjunto(s)
Importing the setup into a personal project
importing the setup into a personal Project
. The easiest and safest bien of using this setup is by importing your scene content into this file.
However, in Many cases, you Will probably prefer todo do the opposite. So here is the process:
1 -append the groups named car-setup and rear.
2 -select an object included in the car-setup group.
3 -select all the objects in the same group.
4 -scale all the selected objects up or do, todo match the width of your own car body model. I mean the distance between the right and left whels.
5 -when it is done, you have todo adjust the length of the rig, todo match the distance betwenthe front and rear whels a -select all the objects included in the rear group, these objects are the meshes named sensors-rear, and rear.
Archivo adjunto 116859
B -move the selected objects in the local y direction. Note the value of the displacement. The empties parented todo the meshes Will move as well.
Archivo adjunto 116860
C -select the armature. In Edit Mode, select all the Bones belonging todo the rear part of the armature, including the rear tips of the Alex-center-up and suspensión Bones.
Archivo adjunto 116861
De -move the Bones in the local y direction, todo match the distance between the front and rear whels. The displacement value is the same as the value noted in b.
Archivo adjunto 116862
When you exit the Edit Mode, the rear whels have followed the Bones, and are at the god place along the y axis, but they are not at the god altitude in z direction. Now we Will fix this:
E -in pose mode, select the bone named Alex-rear-dn.
Archivo adjunto 116863
F -in the constraints pannel, look at the limit distance constraint : click on the r button todo reset the distance limit. Now, the Alex-rear-dn bone is at the god location, and the rear whels should be at the god altitude.
Archivo adjunto 116864
G -still in pose mode, look at the armature in side view : you may notice that the bone named Alex-center-up is no more horizontal.
Archivo adjunto 116865
Select it and rotate it on its x local axis todo make it pointing at the Alex-rear-up bone. This time it should be horizontal, and the suspensión bone as well.
Archivo adjunto 116866
note : if the rear whels are not exactly at the same altitude as the front whels, it can be corrected by selecting the empties empty-r. L, and empty-r. R, and moving them slightly in the z direction.
8 -parent your car body model todo the bone named suspensión. This bone has a custom shape. It is the blue board with an arrow shape.
.
Changing the initial direction of the curve
changing the initial direction of the curve
In this blend file, the initial direction of the curve use as guide for the trajectory is the y axis. You might want todo change that:
1 -select the curve and type shift+s. Chose cursor -> selection.
2 -select all the objects belonging todo the car-setup group.
3 -rotate the whole group around the curve center point, using the 3d cursor as rotation point.
4 -select one of the square meshes folowing the curve, and change the speed on trajectoryipo curve from dlocy todo dlocx.
5 -if you notice that the curve no longer passes by the center of the rig:
A -select the square Mesh named rear (the one supporting the empty-rear).
B -type shift+s and choose cursor -> selection c -select the curve and bring the curve origin on the 3d cursor : shift+s and selection -> cursor.
6 -if you have rescaled the scene, or at least the setup in the scene, you Will have todo edit theipo curve todo adjust the speed todo the new world.
.
Adding obstacles on the trajectory
adding obstacles on the trajectory
. There are at least 3 methods todo add obstacles on the Terrain:
1 -Making an obstacle in the same Mesh as the Terrain Mesh. These obstacles can be extruded from the Ground, or can be separated from it. In the second case, the Shrinkwrap modifiers Will have some dificulties todo detect the exact level of the obstacle because several layers of Mesh Faces Will give an average altitude detection. So, if it is posible, it is better todo deleete the vértices of the Ground below the obstacle.
2 -the Shrinkwrap modifiers can use two objects as referencias, so a second object can be used todo create obstacles.
3 -it is a los posible todo use an ordinary object as apparent obstacle. In this case, you Will have todo create an invisible obstacle (material with alpha) in an object detected by the Shrinkwrap modifier. This solution helps the whels todo Climb smoothly over the obstacle. It is very useful when the obstacle has Sharp Edges.
.
6 Archivos adjunto(s)
Principle and use of the tracks creator
principle and use of the tracks creator
. The tracks creator is a característica allowing todo create tires prints (tracks) After the whels of your animated vehicle.
The setup can be used todo create animated textures of the tires tracks. Usually, these texturesare made of sequences of images.
Everything neded todo create the tires tracks is on layers 11 and 12.
Layer 11 : grey background screen, particles emitters, and orthogonal Camera.
Layer 12 : particles objects : small Mesh used as tire print sample.
note : you Will notice that there is an offset between the print sample and the particles emitters. This sems todo be a bug, and i have sen a report on the BugTracker page about that. So, if it is fixed in Blender 2.5 or in any future release, a small correction could be necessary in this setup.
The (*.jpg) format is well suited for this use. The texture that you Will render for your animated tires tracks Will have todo be detailed enough, but the compression factor is not an issue, because the tracks dont ned todo be very accurate, and you may Even ned todo blur them. The image of the texture Will be rendered with a high resolution. 2048x1536 is enough in most cases if the length/width ratio of your Terrain Mesh is 4/3.
As the image Will have todo be UV mapped on the Terrain Mesh, and a los used by a displacement modifier if you want the tracks todo be in real relief, the x and y dimensions of the rendered texture Will have todo perfectly match the size of the Terrain.
So, we Will use a Camera set todo orthogonal, todo capture the images of the animated tracks. This Camera Will be put right over the center of the Terrain Mesh (se layer 11), and Will be adjusted todo get the entire surface of the Terrain Mesh exactly inside the Bound of the Camera field.
When you Will have rendered the sequence of images in the wanted resolution, you Will have todo load the first image of the rendered sequence in the UV/Image Editor. Then, you Will select all Faces of the Terrain Mesh and type u with the cursor in the 3d window.
By selecting Project from view (Bound), you Will apply UV coordinates todo the Terrain Mesh. After that you Will have todo add the animated texture todo the Terrain material, and set the texture coordinates todo UV. Then, you Will be able todo use the animated texture with various parameters of your choice, in the map todo panel, as usually.
The animated texture Will a los be usable for a real displacement, by adding a displace modifier todo the Terrain Mesh. You Will use UV coordinates in the modifier as well.
Using a displace modifier allows very realistic tracks, but requires a highly subdivided Terrain Mesh. So it is very consuming in Ram memory, and the animation can be slowed down. Well se below that a turnaround can be used todo avoid crashes due todo high memory neds.
warning : if you have added some Grass on your Terrain by using Hair particles, you Will certainly want todo control the lenth of the Grass in the tires tracks todo simulate the Grass crushed by the car whels. At this point, you Will probably encounter some troubles, because of a bug in the particles system, not allowing todo refresh the texture at frame change. Dont worry : this setup includes a very small but eficient Python script written by atom, solving this problem while waiting for a real bug fix in a future Blender release. I have named his script grassparticlesdebug, py in this setup. To use it, the object on which the animated texture is applied must be selected. Obviously, this object Will be the Terrain Mesh (Ground). This script enter and exit Edit Mode for the selected object, forcing the particle system todo refresh and so todo use the new image in the sequence.
Atoms script todo fix the particles refresh bug:
Archivo adjunto 116868
Under the Terrain Mesh, we Will put a large plane with a material set todo a medium grey color (r=127, g=128, b=127). Rgb values of 128 can a los be used. This grey color is neutral when used with a Nor map parameter in the map todo panel. This allows todo add bumps and holes with the texture, by using darker or lighten value in the greyscale, between black and white. This large grey plane Will be used as a background grey screen.
The animated texture of the tires tracks Will be made by rendering tracks leaved by four particles emitters parented todo the rear Alex of the armature (the Alex-rear-up bone), and the two Bones named ster-front. R and ster-front. L.
These particles emitters are the simplest meshes ever built : they are made of one single vertex. Enable the axis and name in the 3d wiew, otherwise you Will have dificulties todo se and todo select them. As the emitters have no Faces, you Will set the emit from parameter todo vértices (vertex).
Archivo adjunto 116869
The particles emitters Will be put at the Ground level, and at the x and y location of the whels. Remarque that the front emitters are parented todo the Bones supporting the whels. Experiments have shown that in some animations better results have ben achieved with the tracks emitters only following the movement of the axles, and not rotating with the stering. So, it is up to you. If you are not satisfied by one method, fel free todo experiment the other bien.
The particles type of the particles systems Will be set todo objects. The particles Will be small meshes with materiales in greyscale color. These small meshes Will be used as samples, and Will represent a small part of the tires surface.
The provided print sample is made todo match the relief of the provided whel model. You Will be able todo edit the Little Mesh or todo create other prints sample todo match your own tires design.
The number of particles for each emitter Will be set todo the same number as the frames number in the animation. This way, at each frame, a single print sample Will be dropped by each particle emitter, just below the tires.
As we dont want the tracks todo vanish during the scene shot, the life of the particles must be set todo at least the duration of the animation. The baking range of the particles system must a los match the duration of the animation.
All the emitters Will share the same particles system, but if you create various print samples, you Will have todo select the sample object for each Emiter, because objets used as particles are linked todo the emitter itself, not the particle system.
Archivo adjunto 116870
To create the tracks, just select one of the four particles emitter and click on the bake button in the bake panel of the particle system. Make sure that the baking range matches the animation range.
Archivo adjunto 116871
During the process of creating the animated texture, the Terrain Mesh is not necessary. When baking the particles, the Terrain can Even be deleted. Deleting the Terrain Mesh doesnt affect the animation, because for the Shrinkwrap modifier, the Terrain is still kept in memory.
The positive thing is that deleting the Terrain Will free some memory somewhere (except for the Shrinkwrap modifier), and Will allow the baking process of particle todo avoid crashing. It is very usefull when the Terrain is large and highly subdivided, as it is generally the case when using a displace modifier.
warning : do not save the file with the Terrain deleted.
It is not necessary todo save the blend file After baking the particles, because the particles are saved in cache, anyway. Close the blend file and open it again, todo recover the Terrain Mesh.
Archivo adjunto 116872
When the particles are baked, you can render the animated texture. At this point, you must hide the Terrain Mesh. It mustnt be rendered, and Will be on a layer that Will not be selected when rendering. The goal is todo render with the orthogonal Camera only the prints samples over the neutral grey background.
On the image, you can se some gaps between the prints samples. It is mainly because of the perspective. As the texture is rendered in top view and with a Camera set todo orthogonal, these gaps are filled in the animated texture. However, some Little gaps can occur sometimes. If this happens and the gaps can be reduced by enlarging a bit the print sample Mesh in Edit Mode.
No lamps are necessary todo render the animated texture, because the materiales of the grey background screen and the materiales of the prints samples Will be set todo Shadeless.
If you want todo get smoother tires tracks, you can enable the do composite button, and adjust the values of the blur filter, in the compositing panel (screen 7), before rendering the sequence of images.
important : when you Will apply your animated texture todo a displacement modifier, you Will be able todo se the Terrain Mesh deformed in the 3d window. As the altitude sensors are following the Ground level, the real deformation of the Terrain Mesh is detected by the Shrinkwrap modifiers. This has an influence on the z location of the whels, and is mostly visible on the front whels. You can add a frame delay of + 1 or -1 frame on the image sequence of the tracks texture. Doing that, you move the first print sample After, before or right under the center point of the front whels. The visible effect is the adjustment of the z position of the front whels in the depth of the tracks.
You Will notice that the real relief of the displaced Ground Mesh introduces some vibrations in the whels. These vibrations can be adjusted by tweak the contrast of the animated texture, and can add realism todo the animation.
As i told you at the beginning of this manual, 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. It sometimes work in simple files but doesnt sem todo work with the file of this setup. So, por favor, use Blender 2.48a.
Example of what can be done with both displacement modifier aplied todo the Ground Mesh and Grass made of Hair particles :
Last words:
https://www.foro3d.com/attachment.ph...1&d=1257242770
I hope that this manual is understandable and that you Will find this setup useful. Fel free todo send me questions or comentarios at 3d@3d-synthesis.com. English is not my native language, so if you find typo, grammatical or spelling errors, por favor tell me as well.
If you use this setup, the provided models or the script in your animations, por favor dont forget us in the credits.wed be very happy todo se what you did with this system, so dont be shy and por favor send us alink todo your works.
Best regards, Philippe.
.