Making a 3D game with Ogre - Populating the level

Dec 22nd, 2009 by mcasperson

In this tutorial we add some additional models to the level with the XML loader.

DOWNLOAD THE DEMO AND SOURCE CODE FOR WINDOWS

DOWNLOAD THE DEMO AND SOURCE CODE FOR LINUX

RETURN TO THE TUTORIAL INDEX

In order to make the level more interesting we need to add some models onto the terrain. This is where loading a scene from an XML file becomes really useful. Without any changes to the code we can populate the level with buildings, trees and any other models we want.

First we need to get some models. If you are reading this tutorial, then you are probably a programmer, which almost certainly means that you have no artistic skill at all. Fortunately it is possible to find free, good quality 3D models that you can use for your own game. You do have to wade through mountains of untextured, hi polygon models distributed in formats that require high end 3D editing packages like Max or Maya, so here are a few sites and tools that I found useful.

Low Poly Cooperative – These guys have packs with dozens of low poly models.

3DRT – This site has a lot of commercial 3D models, but there are also a few free low poly models.

Dark GDK – This is a game development package that was brought out by Microsoft and The Game Creators. The SDK is windows only, but the 3D models can be used anywhere.

T2 – This is an awesome tool for creating terrain textures.

Free 3D Trees – A collection of 3d tree models created using TreeGenerator.

In order to import these models into Ogre, you will need to convert them to Ogres mesh format. I found Milkshape, with the Ogre plugin, was the easiest and cheapest way to convert models.

In order to keep the size of your textures down, it is best to save them in the DDS format. The latest version of Paint.Net has support for the DDS format.

Once you have your models prepared they can be added to the level through the XML file. All of the code required to load and display these models is already included in the DotSceneLoader class.

If you look at the XML file supplied with the demo you will see how the models have been added to the level inside the nodes element. As you can see from the screenshot below, these models add quite a bit to the level.

mcasperson

Written by mcasperson

Rate this Article:

Rating: 5.0/5 (2 votes cast)

Add new comment

* You must be logged in order to leave comments, please Sign in or join us.

Comments

3d models, over a year ago
Report comment

free download all 3d models, 3d Video Tutorials, 3D Materials, 3D Textures, Vray Materials, 3D Girls,New 3d Video and latest 3d jobs http://www.all3dmodel.com

Related Content