How to make a small car for the Game Engine
In this tutorial, we will build a simple small car to be used with the Game Engine (GE) that is included with Blender. We will use and complement the article written by Sandra Gilbert in Issue 8 of the Blender Magazine Low Poly Car And Small Driving Gamelet. We will use this picture, included with the tutorial. Right click on it and save it on your hard disk.
Preparing Blender
Start Blender. Next, we need to prepare Blender for the task at hand. We'll need two views when making our car: we will have a Top view by pressing 7 on the numeric keypad on the right of your keyboard. This view will be used to ensure that everything is on one single plane. The next view will be the Front view, or 1 on the numeric keypad, for the drawing of the car shape.
Hover the pointer on the horizontal line between the View and Panels menus.
The pointer will transform into a vertical twin arrow. Right-click and a menu will appear.
Left-click on the Split Area selection and hover the mouse on the 3D window.
A new vertical line will appear. While the vertical line is in the 3D view, click the LMB (Left Mouse Button). Now we have two views of the same object. While the pointer is over the left side, press 7 on the Numeric Keypad or Num 7 for the Top View. Go over the right side and press Num 1 for the Front View. This will be our main window; the one in which we will make the shape of the car. Move the pointer over the vertical line separating the two views. We now have a horizontal line with a double arrow. Press your LMB (Left Mouse Button) and while holding the mouse button down, move around and see that you can modify the size of the window. Make the left side about a quarter the size of the main Front View.
Now we will delete the cube. Since we are already in Object Mode, and the cube is selected, indicated by the pink line, we delete the object by pressing the X key, answer Yes to the question OK? Erase selected Object(s). Our workspace is now empty.
Inserting a Background Image
Now we will start our project by inserting an image as a background so we can create a rough sketch. In the Front view, click the View menu at the bottom of the screen, then choose the Background Image... item.
A small transparent window will appear in the Front view. Click on Use Background Image then Load. A directory will replace the Top view on the left. Select the picture Car.jpg from the location in your hard drive and click the Select Image button.
We now have the background image showing in the Front View!
Making the Wireframe
A few words of advice before we start working on our car.
- First, the image that we see in our front view only exists for reference purposes; if you move the view only slightly while pressing the Middle Mouse Button (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 operation 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 extension .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 on 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 series 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 de-select All the elements that make up 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 ways of making a selection. Press B, for Border, the cursor will change into a dotted cross-hair that moves with the mouse movement.
From the top left corner, press and hold your LMB (Left Mouse Button), 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. To move a selection, we press the G key, for Go.
We can constrain the movement of our selection to follow a specific axis. Since we want to go to the middle of the door, we press G for Go and then Z, for the 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 movement along the X axis. So we press G then X for our axis movement. 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 comes the tricky part which will require a little patience. We will edit the square by using a few keystrokes to build 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. Extrusion is used fairly 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 follows the movement 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 de-select 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 (Num 7) 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 to look more like a car.
We de-select everything using A. Move the cursor to the right, near the middle point, and select the vertex by pressing the RMB, the Right Mouse Button.
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 place 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 de-select the vertex with A.
The 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 the instructions you should have something that resembles this:
If you press the Num 7 key, you should see one line.
For the next step, we go from 2D to 3D!
Our car in 3D shape
Now is 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 to the 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 movement.
We repeat the operation one more BU.
- After pressing E and selecting Region from the menu, press the Y key so that the only movement you will be able to do will be along the Y axis in the Top View.
- For more precision, press the Ctrl key so that you will move along the grid. One square equals 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 invokes 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 the mouse cursor is 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 to 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 looks odd: it is inside out.
To correct this problem, go back to Edit Mode and do the following:
- Select the section that looks odd with the Box Select tool, B.
- We now look into the bottom panel and find the Mesh Tools section.
- Click on Flip Normals to reverse the faces.
- De-select the vertices by typing A, and again select all the vertices with A
- Find the Rem Doubles (Remove doubles), to delete the extra vertices that were created when we mirrored 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 the excess 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.
- 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, using G, to the center of the wheel, and with S scale it to the size of the tire in the background image.
Switch to the bottom view Ctrl-Num 7 and move the tube from the middle to the side of the car.
We border B select the bottom vertices and Grab them on the Y axis and narrow the tire.
De-select all using A. Now we select the front vertices of our tire. Use the B box selection or press the B key twice 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 copy 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
No we'll add the wheels to our car. Select the whole wheel. Go to the bottom view with Ctrl 7 and change the pivot point from Median Point to 3D Cursor.
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:
Duplicate the wheel using 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 vehicle.
We repeat these operations to obtain a four wheel car. We have the lower left tire selected. So we duplicate it using Shift-D, Esc, mirror on the X Global axis. For our last one, we do the same: Shift-D, Esc and Y Global
Congratulations!
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 of our car using A.
Locate the Texture face panel.
Click on the white square besides the Set VertCol (Set Vertex Color) button and choose your color. Move the mouse and the color panel will disappear; the color you just chose will fill up the square. Just click on the Set VertCol to apply the color to the entire car. For the first color, we'll choose a bright red but any color will do.
After this first color, we can select individual faces and apply specific color. For example; black for the tires and light grey for the windshield.
Our car should look like this:
We won'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 slows down the render of our game.































































