Comment faire un véhicule
Dans ce tutoriel, nous allons réaliser une voiture. Le modèle sera simple pour qu'il puisse être manipulé dans l'environnement de jeu, le Game Engine, ou GE, inclu dans Blender. Nous allons utiliser en complément le tutoriel écrit par Sandra Gilbert dans le Volume 8 du BlenderArt Magazine Automobile Low Poly et petit jeu de conduite.
Nous allons utiliser l'image incluse avec le tutoriel. Cliquez le bouton droit et sauvegarder l'image dans votre disque dur.
Préparer Blender
Démarrez Blender. Ensuite, nous préparons Blender pour les tâches à venir. Nous allons avoir besoin de deux vues pour réaliser notre automobile : une vue du dessus en pressant 7 avec la calculatrice à droite du clavier. Nous distingerons entre la calculatrice et les chiffres situés au-dessus du clavier en écrivant Num-7. Cette vue est utilisée pour s'assurer de l'alignement des droites sur un seul plan. La vue frontale, ou Num-1 sur le clavier de la calculatrice, sera la vue principale utilisée pour l'élaboration de notre forme.
Place le pointeur sur la ligne horizontale entre les menus View et Panels.
Le pointeur va se transformer en une double-flèche verticale. Clique avec le bouton droit pour voir apparaître le menu.
Choisi la sélection Split Area et déplace la souris dans la fenêtre 3D.
Une barre verticale apparaît. Alors que celle-ci est dans la vue 3D, clique le bouton gauche de la souris. Maintenant, nous avons deux vues du même objet. Alors que le pointeur de la souris est dans la vue de gauche, presse Num-7 pour la vue du dessus. Va sur la vue de droite et presse Num-1 pour la vue de face. Celle-ci va être la vue principale dans laquelle nous allons créer notre automobile.
La vue du dessus n'est utilisée que pour vérifier l'alignement des droites et peut occuper un espace minimal dans l'écran. Pour minimiser la largeur de la fenêtre, pointe le curseur au-dessus de la ligne verticale séparant les deux vues. Nous avons maintenant une double-flèche horizontale. Clique le bouton gauche de la souris et déplace le curseur pour modifier la dimension de la vue du dessus ; celle-ci peut occuper le quart de l'espace de l'écran.
Maintenant nous allons effacer le cube par défaut. Puisque nous sommes déjà en mode objet, Object Mode, et le cube est sélectionné, indiqué par les lignes roses, on efface l'objet en pressant la touche X. On répond Yes à la question OK? Erase selected Object(s). Notre espace de travail est maintenant vide.
Insérer une image en arrière-plan
C'est la première étape de notre projet ; nous allons insérer une image en arrière-plan qui va nous servir de guide. Dans la vue de face, Num-1, clique sur le menu View qui se trouve au bas de la fenêtre 3D. Sélectionne Background Image....
Une petite fenêtre transparent va apparaître dans la fenêtre 3D. Sélectionne Use Background Imag puis Load. Un répertoire va remplacer la vue de face. Choisi l'image de base, Car.jpg, que tu as sauvegardée plus tôt dans ton disque dur, et clique sur le bouton Select Image.
Nous avon maintenant l'image en arrière-plan dans notre fenêtre!
Making the Wireframe
A few word of advice before we start working on our car.
- First, the image that we see on our front view only exist for reference purpose; if you move only slightly the view while pressing the Middle Mouse Boutons (MMB), the image will disappear! To quickly recover the view, press 1 on the keypad.
- Secondly, it is very important that all the lines are on the same plane for later extrusion; always check your work with the top view on your left. If there is a problem, you can go back by deleting the last operations with Ctrl-Z.
- Before moving on, now would be the time to name our project. Press Ctrl-W for Ctrl-Write and choose a name. For this first time, it is important that you write the extention .blend to your project, such as Supercar.blend.
The beginning of a car
We begin our car by making a line. In front view, press the Spacebar to see a menu appear. Select Add -> Mesh -> Plane
We are now in Edit Mode instead of the Solid Mode. To see the difference, press Tab in the keyboard to switch between the two modes. A selected object in Edit Mode is always pink with the borders, or Vertices, yellow. This is the mode in which we modify and create shapes that will become objects.
In Object Mode, our selection becomes gray with a pink line: this mode is used to add colors and textures.
Stay in Edit Mode. We will move the square by pressing G. With the mouse, move the square to the lower left corner of the car, just behind the front wheel. We will transform the square so that we have the basic shape of the car.
For the next serie of manipulations, we will be in Edit Mode. The square that we see is composed of four lines, or Edges and four points, called Vertex (Vertices in plural) in the Blender universe.
Now, press A to deselect All the elements that composes the square.
We must now select the top edge of our plane. Selection is something that we do all the time in Blender and we have many ways of doing this operation. For now, we will use one of the most common way of making a selection. Press B, for Border, the cursor will change into a dotted crosshair that move with the mouse mouvement.
From the top left corner, press and hold your LMB, your Left Mouse Bouton and go to the right and down across the plane to select the top edge.
We have the top edge selected
We can move and do many transform operations on the selection. We will decrease the size of the square so that it is about the middle of the door. For moving a selection, we press the G key, for Go.
We can constrain the movement of our selection to follow specific axis. Since we want to go to the middle of the door, we press G for Go and then Z, for Z axis. The axes on the lower left corner of the 3D window will be our guide.
So now we have a new shape.
We will move the top edge near the wheel well. We do the same operation but instead of using the Z axis, we will constrain the mouvemet along the X axis. So we press again G then X for our axis mouvement. You will see a white horizontal line: the edge of our shape will move along this line.
Place the edge near the wheel.
Extrusion
Now's the tricky part that need a little patience. We will edit the square by using a few keystrokes to built a rough shape, called a wireframe, of the car. It is NOT important that you respect the shape exactly as later we will use tools to smooth out the angles. If you make mistakes, simply press Ctrl-Z to go back.
Extrusion, E on our keyboard, is a process in which we transform a selection and create a new shape. With selecting, extrusion is used often and you will remember the keystrokes in no time.
We have the top edge of our initial square selected. Press E and extrude the surface to the top of the door. Blender will ask if you want to extrude Only Edges or Only Vertices. Choose the default Only Edges.
We now move the mouse and you will see that a new shape follow the mouvement of the mouse. Place it near the top of the door. Don't worry too much about the placement as we will make corrections later on.
We deselect everything by pressing the A key and select the two edges on the right with Box Select, or B.
We extrude our selection, B and place it near the rear wheel well.
Remember
- Ctrl-Z to go back if you made an error
- Don't forget to check the top view (Num7) for any stray line!
- Try to have a similar shape. But don't worry too much about making an exact copy.
- Ctrl-Write, for saving your project on a regular basis when everything is ok!
Changing the shape, one vertex at a time
We have a rectangular shape over the picture of a car but we don't have a car. In the following steps, we will edit the shape ato a more car look alike.
We deselect everything, A. We move our cursor to the right, near the middle point, and we select the vertex by pressing the RMB, the Right Mouse Bouton.
We will edit the shape and make a rough copy of the car. Press the Z key to toggle the Wireframe mode. This Wireframe mode will transform our shape into a transparent one and will help us placing the vertices.
With our selection done in the previous step, press G and move the vertex near the rear wheel well.
And we move the next vertex
And the next one
We will expand this shape by selecting the top right edge, extrude it
...and place it
We do the same again: select the edge, extrude it, E, and place it at the end of the rear window.
We deselect the vertex with A.
Next step is to make the top section of the car. To do so, we select the top vertices with the Box select, B.
We extrude them.
And place the vertex along the shape of the car.
With the same tools that we used all along, we complete the side of the car.
Completing the Wireframe
If you have followed our instruction you should something that resemble this.
If you press the Num-7 numeric keypad, you should see one line
Next step, we go from 2D to 3D!
Our car in 3D shape
Now's the time to transform our flat 2D shape into a car. Before we tackle the next series of operations, we do the following:
- We go Front View: Num-1
- We will use the 3D cursor
- We select everything: A
We select the Top View with Num-7
- We extrude the shape downward: E -> Region, then Y, so that we will move along the Y axis.
- We go one grid down, or one Blender Units, BU for this first mouvement.
We repeat the operation one more BU
- After pressing E and selecting Region from the menu, press the Y key so that the only mouvement you will be able to do will be along the Y axis in the Top View.
- For more precision, press Ctrl key so that you will move along the grid. One square equal One Blender Unit (BU).
While our front vertices are selected, we will smooth out the car side and give it a shape.
- Make sure you have the mouse pointer in the 3D space.
- Press W, it invoques the Specials menu for editing meshes.
- Choose Smooth.
- Repeat this operation about three times.
We now have something that resemble half a car seen from the top.
Mirroring
We will mirror the shape that we have to complete the car.
- We are still in Top View, select all the vertices by pressing A twice.
- Verify that we the mouse cursor in 3D (it should be!)
- We make a copy of this selection: Shift-D. Don't touch the mouse!
- Press Esc key so you can now use the mouse
- Press M for Mirror the shape of the car
- Choose Y Global as the Mirror axis.
Our car is now complete.
Clean up
We must make a last clean up of the vertices. If we go to UV Face Select Mode,
one half of our car look odd: it is because we see the inside out.
To correct this problem, go back to Edit Mode and do the following:
- Select the section that look odd with the Box Select tool, B.
- We now look into the bottom panel and found the Mesh Tools section.
- We click on Flip Normals to reverse the faces newly created.
- Deselect the vertices by typing A, and select again all the vertices with A
- Found the Rem Doubles for Remove doubles, extra vertices that were created when we mirrorded our car.
- Just on the left of this button, change the Limit button to 0.100.
- Click Rem Doubles, you'll see something like Removed: xx; we got rid of unneeded vertices.
Your car is finished. Now would be a good time to save your project.(Ctrl-W)
Wheels
We need wheels for our car. We will create one wheel that will be copied three times.
- We go to Edit Mode
- Check to be sure that we are in Median Pivot Point
Go to the Front View, Num-1. Press the Spacebar, Add a Tube of 12 vertices. Move the tube by using G, to the center of the wheel, and S scale it to the size of the tire in the background image.
We go to the bottom view Ctrl-Num7 and move the tube from the middle to side of the car.
We border B select the bottom vertices and Grab them on the Y axis and narrow the tire.
Deselect all A. Now, we select the front vertices of our tire. Use the B box selection or press twice the B key so that you will have a circular target selection. Once selected, press the RMB to get out of the circular target selection. By using the MMB, you can enlarge or shrink the target area.
Once our selection is done, we make a double of these vertices Shift-D then Esc without touching the mouse. We will extrude, E, then shrink Alt-S the circle so as to make our tire.
We do the same again and shrink the selection to the smallest point possible, this will be our mag wheel.
We select the whole wheel
and remove double vertices. Verify that the faces on the surfaces are normal by going into the UV Face Select mode. If you see the inside out, select the faces, go into Edit Mode and do a Flip Normals to put everything back in order.
Putting wheels to our car
We will put wheels to our car. Select the whole wheel. We go bottom view with Ctrl-7 and change the pivot point from Median Point to 3D Cursor
We locate the cursor in the middle of the car so that we will mirror the wheel front the center of the car. Before we start, you should have something that looks like this.
We duplicate the wheel Shift-D, then Esc. Press M for our first mirror operation. Choose Y Global in the Mirror Axis Menu. We now have a two wheel vehicule.
We repeat these operations to obtain a four wheel car. We have the lower left tire selected. So we duplicate it Shift-D, Esc, mirror on the X Global axis. For our last one, we do the same: Shift-D, Esc and Y Global
Congratulation!
You have a complete car plus you learned a lot about Blender.
We paint our car
Now we're going to learn how to paint our car for the game engine. We go to UV Face Select mode and select all the faces, A, of our car.
Locate Texture face panel
Click on the white square besides the Set VertCol (Set Vertex Color) button and choose your color. Move away the mouse and the color panel will disappear; the color you just have chosen will fill up the square. Just click on the Set VertCol to apply the color to the entire car. For the first color, we choose a bright red but any color will do.
After this first color, we can select individual faces and apply specific color. For exemple; black for tires and light grey for the windshield.
Our car should looked like this
We don't worry about the edges because the car will be used in real time in the Bullet Game Engine. In the game environment, we don't need too many details because this slow down the render of our game.































































