Skip to content
Home » Panda3D Part 10 – Modeling Our First Game Asset in Blender

Panda3D Part 10 – Modeling Our First Game Asset in Blender

Spread the love

In the preceding parts of the Panda3D series we learned the basics of Blender. It’s time to apply our knowledge and create our first actual asset that we’re going to use in the game.

Here’s the video version of this article:

As there are going to be more and more files, it’s advisable to organize them in one way or another. Let’s create a file hierarchy for our project inside the project folder.

We’re going to stick to Panda3D terminology where the term models is used for static objects and actors for characters. In Blender everything you create is a model, so I may be using the term actor and model interchangeably in Blender context from time to time, but it shouldn’t be a problem.

So, let’s create two folders, models and actors inside your project folder.

From now on we will be putting all our models and actors in these two folders.

We’ll be creating a separate folder for each model and actor and then, for simplicity’s sake, we’ll be putting all files associated with that model or actor directly into it, so the blend file, the texture files and also the glTF files that we can use in Panda3D.

And now let’s get to work. It’s modeling time.

Modeling the Building

So, here we go. Follow the steps below:

1. Open Blender. You can see a default cube out of the box. Now go to the File menu, select Save As…, browse for your project folder and save the file right away as building.blend.

Actually, we could use the default cube, but it already has a default material and I want to show you how to add materials in the next lecture, so delete the cube (X -> Delete) and add a new one (Shift + A -> Mesh -> Cube). Rename the cube ‘building’ in the Outliner:

rename

2. Switch to edit mode, face select mode. Deselected all:

deselect

3. Go to wireframe shading (A) so that you can see through the model and select the two opposite faces through which the X axis passes (B):

select

4. Inset the selected faces. The thickness should be set to 0.25.

You can set the thickness by hitting I to inset and then immediately hitting the value, just like we did with transformations or extrusion.

So, here’s what you should now see:

inset

5. Now we want to extrude the two selected faces. However, if we try to do it now, they will both be extruded in one direction. So, first we have to change the pivot point. By default the pivot point is set to Median Point, but this won’t work for us. Let’s change it to Individual Origins, then each face will be extruded independently of the others.

And now you can extrude. With the two faces still selected extrude them 0.25 units so that they protrude from the cube. To do that just hit E .25.

Here’s the result:

pivot point

6. Inset the faces again. This time the thickness should be 0.5:

inset

7. Extrude the two faces again, this time 3 units:

extrude

8. Add a horizontal loop cut that goes around the whole object.

You can do it by hitting Ctrl + R and the hovering your mouse over one of the vertical edges. When you see the yellow edge loop, just hit Enter twice to confirm the addition of the loop cut and its central position. This should look like so:

loop cut

9. Go to vertex select mode (A), front view (Num1), deselect all and border-select the vertices in the lower part of the mesh (B) by hitting B and dragging over them:

select

Your Panda3D Magazine

Make Awesome Games and Other 3D Apps

with Panda3D and Blender using Python.

Cool stuff, easy to follow articles.

Get the magazine here (PDF).

10. Delete the selected vertices.

To delete the vertices hit X and select Vertices. Your mesh should now look like so:

delete

Hit Ctrl + S to save the file.

11. Orbit in the scene so that you can see the bottom part of the model. Then switch to edge select mode (A) and select the edge loop at the bottom (B). To do that hold down Alt and click on one of the bottom edges:

orbit

12. Extrude the selected edges 2 units down along the Z axis. To do it, just hit E Z -2. This is what you should get:

extrude

We don’t need the faces at the bottom because we won’t see this part of the building at all. It will just stand on the ground.

13. Our model is going to become a building. Let’s go to front view. Let’s add some loop cuts to model the windows. First add 10 horizontal loop cuts. You can do it by hitting Ctrl + R and then 10 from your keyboard. Then hit Enter twice to confirm the loop cuts and their position:

loop cuts

Then in a similar way add 5 vertical loop cuts in the central part of the building:

loop cuts

Python Jumpstart Course

Learn the basics of Python, including OOP.

with lots of exercises, easy to follow

The course is available on Udemy.

Next add 10 vertical loop cuts in the left lateral part of the building:

loop cuts

And finally add 10 vertical loop cuts on the other side of the building:

loop cuts

Save the file (Ctrl + S).

14. Now go to solid shading (A), face select mode (B), and select the faces that are going to be the windows. Also, select the six middle faces at the bottom of the central part of the building for the door:

select

15. Extrude the windows and the door inward 0.1 units. To do it just hit E -.1. Now the building should look like this:

extrude

16. Go to object mode and hit N to open the sidebar. Look at the dimensions of the building:

Now, is the building the right size? What size should a building be?

Blender Jumpstart Course

Learn the basics of 3D modeling in Blender.

step-by-step, easy to follow, visually rich

The course is available on Udemy and on Skillshare.

Well, the model seems pretty small. The building is only 3 meters tall. It’s the height of two pretty short people standing on each other’s shoulders. We can assume the height of 2.5 m for each story plus a little extra for the roof. A height of 12 m seems pretty reasonable. So, just scale the whole building by the factor of 4 (S 4). Then you must probably zoom out a bit in order to see the whole building. Now the dimensions should look more reasonable:

scale

17. Now the model is scaled, but there’s another problem. Look at the scale in the sidebar. It’s 4 on each axis. This may cause trouble for example when we export the model to Panda3D. The scale of a finished model should be always 1 on each axis. To fix this, we have to apply the scale.

In order to do that, go to the Object menu and under Apply select Scale:

apply scale

Now the scale is 1 on each axis, just like it should be:

scale

You can now hit N to close the sidebar.

18. There is one more thing to do before we can call it a day. It’s about the origin of the model geometry. If you look at the model, you will see a yellow dot:

origin

Here it is under the 3D cursor, but it doesn’t have to. Anyway, this is the origin of the geometry. If you then append the building model in another file, it will be appended at the location of the 3D cursor in that file, but what does it actually mean? It means the origin point will be at that location. As you can see, the origin is somewhere near the roof, so if we appended the model to a scene with a terrain, most of the building would be below the terrain. Also, if you tried to rotate or scale the model, it would always be relative to the origin point. In our case it will be more convenient to move the origin point to the bottom of the model.

To do so, with the building selected switch to edit mode. Make sure you’re in front view (Num1) and select all. Then move everything up until the origin point (which doesn’t move along) is at the bottom. You can hold down the Ctrl key while moving the model to enable snapping:

move

When done, you can switch back to object mode and the origin point will be at the bottom. Save the file.


Spread the love

Leave a Reply