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.

/images/Car.jpg.

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.

/images/HoverTheLine.png

Le pointeur va se transformer en une double-flèche verticale. Clique avec le bouton droit pour voir apparaître le menu.

/images/SplitArea.png

Choisi la sélection Split Area et déplace la souris dans la fenêtre 3D.

/images/SplitAreaTop.png

Figure 1 : Vue du dessus et frontale dans Blender
Enlarge
Figure 1 : Vue du dessus et frontale dans Blender

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....

/images/BackgroundImageMenu.png

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.

/images/LoadBackgroundImage.png

Nous avon maintenant l'image en arrière-plan dans notre fenêtre!

/images/BackgroundImageLoaded.png

Making the Wireframe

A few word of advice before we start working on our car.

  1. 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.
  2. 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.
  3. 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

/images/AddMeshPlane.png

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.

/images/EditMode.png

In Object Mode, our selection becomes gray with a pink line: this mode is used to add colors and textures.

/images/ObjectMode.png

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.

/images/MoveCube.png

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.

/images/Deselected.png

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.

/images/BoxSelect.png

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.

/images/TopEdgeSelect.png

We have the top edge selected

/images/TopEdgeSelected.png

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.

/images/MovingWithG.png

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.

/images/XZAxis.png

So now we have a new shape.

/images/HalfSquare.png

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.

/images/XMouvement.png

Place the edge near the wheel.

/images/NewPoint.png

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.

/images/ExtrudeOnlyEdges.png

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.

/images/ExtrudedShape.png

We deselect everything by pressing the A key and select the two edges on the right with Box Select, or B.

/images/RightSelection.png

We extrude our selection, B and place it near the rear wheel well.

/images/RightExtrusion.png

Remember

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.

/images/MiddleRightSelection.png

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.

/images/WireframeMode.png

With our selection done in the previous step, press G and move the vertex near the rear wheel well.

/images/MovingAVertex.png

And we move the next vertex

/images/UpperRightCorner.png

And the next one

/images/UpperLeftCorner.png

We will expand this shape by selecting the top right edge, extrude it

/images/RearWheelWell.png

...and place it

/images/MovedSelection.png

We do the same again: select the edge, extrude it, E, and place it at the end of the rear window.

/images/BottomHalfCompleted.png

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.

/images/TopVertexSideCar.png

We extrude them.

/images/TopSideExtruded.png

And place the vertex along the shape of the car.

/images/MiddleSectionCompleted.png

With the same tools that we used all along, we complete the side of the car.

/images/CompleteSideCar.png

Completing the Wireframe

If you have followed our instruction you should something that resemble this.

/images/CompletedWireframe.png

If you press the Num-7 numeric keypad, you should see one line

/images/WireframeFromTop.png

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:

/images/ReadyToExtrude3D.png

We select the Top View with Num-7

/images/TopViewBeforeExtrusion.png

/images/FirstExtrusion.png

We repeat the operation one more BU

/images/SecondExtrusion.png

While our front vertices are selected, we will smooth out the car side and give it a shape.

/images/SpecialsSmooth.png

We now have something that resemble half a car seen from the top.

/images/SideSmoothed.png

Mirroring

We will mirror the shape that we have to complete the car.

/images/MirrorYGlobal.png

Our car is now complete.

/images/3DCar.png

Clean up

We must make a last clean up of the vertices. If we go to UV Face Select Mode,

/images/UVFaceSelect.png

one half of our car look odd: it is because we see the inside out.

/images/InsideOut.png

To correct this problem, go back to Edit Mode and do the following:

/images/RemoveDoubles.png

/images/CompleteUVCar.png

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.

/images/MPP.png

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.

/images/TubeInWheelWell.png

We go to the bottom view Ctrl-Num7 and move the tube from the middle to side of the car.

/images/BottomCar.png

We border B select the bottom vertices and Grab them on the Y axis and narrow the tire.

/images/InsideTire.png

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.

/images/FrontTire.png

We do the same again and shrink the selection to the smallest point possible, this will be our mag wheel.

/images/Magwheel.png

We select the whole wheel

/images/MagwheelSelected.png

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

/images/3Dcursor.png

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.

/images/OneWheelCar.png

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.

/images/TwoWheelsCar.png

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

/images/FourWheelCar.png

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

/images/SelectUVFace.png

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

/images/Final PaintedCar.png

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.