|Design 1, Design 3 (Computer and Video Games)|
|Unit 11 - 27th November 2001|
Importing External 3D-objects
If you want to use complex 3D-geometries in UnrealTournament, it is often no good idea to try to build them in UnrealEd. More appropriate is the construction of the 3D-model using a professional 3D modelling tool and the consecutive export to a file format which can be read by Unreal. This tutorial will show you how to make a simple 3D model of a wolf suitable for an Unreal level.
We will use Lightwave
3D as a modelling tool then export the model to the .dxf file format Exporter
plugin for 3D Studio Max R3
The same process can be carried through with other 3D software packages. At present many modelers from the Unreal community use 3D Studio Max, Lightwave 3D or Milkshape to create 3D-content.
You can download the Export-Plugins for Lightwave (DXF Export plugin for Lightwave 5 and 6)
and 3D Studio Max here. (UTExporter plugin for 3D Studio Max R3)
In order to reduce
the number of polygons to a reasonable amount a plugin called QEMloss
for Lightwave is very usefull.
Let's start by downloading a complex 3D model of a wolf from any freeware site of the INTERNET or by buying one.
As you can see in the figure to the right, qemloss allows you to specify a goal, which is the number of polygons it tries to reduce the model to. If you do radical reductions in numbers you should not reduce on one single step but do a few consecutive reductions and always watch your new model's quality.
The model has been opened in Lightwave 6.5 here and looks perfectly smooth and nice. (We found the model at http://www.3Dcafe.com which has a large selction of free 3D models in differrent formats.
The problem with this model is however, that it has a number of polygons which is much too large for Unreal to be handled properly. At present the number of polygons for simple objects like doors, plants, decoration and architectural units is usually not higher than some 30 or 40 polygons. Player pawns have a total of some 800 polygons. The wolf to the left consists of more then 4000 polygons and would immediately make any Unreal level crash.
We therefore need to reduce the number of polygons considerably.
Our goal was to arrive at a polygon count of less than 500 polys, and you can see now how the wolf looks like when reduced to 496 triangular polygons.
The qemloss plugin automatically alters polygons of quadrangular shape to triangles, which is essential for us to use the model in Unreal later. The Unreal engine works on triangular polygons only and if it were not qemloss we were using we had to change the polys to trangles in another way. (We could have used the "Triple" command for example.)
Take a carefull look
at the model now:
All the polygons should be triangles.
All the polygon normals should point "outwards", i.e. non of the dashed yellow lines must point inward.
The model should be centered and stand on the ground.
After having selected all the polygons of the model, the status bar on the bottom of Lighwave's modeler window should display the desired number of polygons, in our case 496.
It is a good idea
to save your model now.
The last thing we have to
do before we export from Lightwave to Autocad's .dxf format and reimport into
UnrealEd then, is to correct the size of the model.
The original wolf model had a height of 300 millimeters, which is not the height of a real wolf. But even if we rescaled the model to 68 centimeters, which is the natural height, the model would ariive in UnrealTournament as a tiny little object the size of a player pawn's foot only. Unreal uses strange metrics called world units, which do not correspond to Meters at all. If we scale the Lightwave model to 68 meters height, it will be displayed in Unreal later on as something like 68 centimeters. Watch the image on the top of this page for the relation of player pawn and the imported wolves.
Lightwave we now select the DXF_Export utility in the "Construct"
panel, by pulling down the "More" tab on the lower end of the
Don't flip polygons! There is no need to triple them, because they are already triangular, and the "Output Polygons As..." buttons should be set as shown in the dialog box to the left.
In UnrealEd we need to select the "Brush" menu, then select "Import ..." and arrive at a dialog box as shown underneath.
If your model was well built, did not exceed the number of polygons your hardware is capable to render and if anything else went fine, a blue brush should be visible in the 2D-views of UnrealEd. You just have to select a texture, click on "Add Brush" and after having rebuilt the level your wolf should nicely be standing in the room.
If you want to experiment yourself with the model of this example, you might want to download the Lightwave 5 compatible .lwo file here. (4.7 kB)