Graphics Programs Reference
In-Depth Information
Exporting Mesh Data
Now that you have seen the modeling of objects for
Tank Fence
, we discuss how to
export the mesh data to
.obj
files. If you had difficulty understanding the examples
previously discussed, you may find it helpful to go through the Blender files in the
source code for this chapter.
Note
.obj
is a geometry definition file format first developed by
Wavefront Technologies
. This file format is a simple data-format
that represents 3D geometry alone—namely, the position of each
vertex, normals, faces (that make each polygon defined as a list of
vertices), and texture-vertices. The
.mtl
file format is a compan-
ion file format that describes surface shading (material) properties
of objects within one or more
.obj
files.
You can read more about these file formats at
ht-
Before we export the mesh data, recall what you learned in the beginning of this
chapter. Based on what we've already discussed, you should understand that the kind
of mesh data we have to export should be composed of triangles.
Blender makes it very easy to “triangulate” faces of an object. To do so, after select-
ing the object, toggle to
Edit
mode. Then, press
Ctrl T
to triangulate faces. That's all!
Note
Although the default (mesh) select-mode is
Vertex select
,
Blender understands that you want to triangulate faces.
Now, open the
tankFence5.blend
file from the source code for this chapter
(
Blender/tankFence5.blend
). It consists of all the game objects you created.
If you toggle to
Edit
mode, observe that all the objects (that is, faces of objects) are
already triangulated. To export this file as
.obj
(and accompanying
.mtl
) format,
complete the following steps:
1. To ensure the required “Import-Export” add-on is available, select the
option “User Preferences” under File menu.
Search WWH ::
Custom Search