Game Development Reference
In-Depth Information
vt 0.375000 1.000000
vt 0.625000 0.750000
vt 0.875000 0.000000
vt 0.875000 0.250000
vt 0.125000 0.000000
vt 0.125000 0.250000
vn 0.000000 -0.000000 1.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 0.000000 -1.000000
vn 0.000000 -1.000000 -0.000000
vn 1.000000 0.000000 0.000000
vn -1.000000 -0.000000 -0.000000
g Box_Box_initialShadingGroup.004
usemtl initialShadingGroup.004
s off
f 1/1/1 2/2/1 3/3/1
f 4/4/2 3/3/2 5/5/2
f 6/6/3 5/5/3 8/7/3
f 2/8/4 1/9/4 7/10/4
f 2/2/5 7/11/5 5/12/5
f 8/13/6 1/1/6 6/14/6
f 4/4/1 1/1/1 3/3/1
f 6/6/2 4/4/2 5/5/2
f 5/5/3 7/10/3 8/7/3
f 1/9/4 8/7/4 7/10/4
f 3/3/5 2/2/5 5/12/5
f 1/1/6 4/4/6 6/14/6
Let's understand this file format. The Box.obj file has six types of elements defined,
which are as follows:
mtllib : This element defines the name of the material file attached. We will
cover this in more detail shortly.
o : This element defines the objects exported. Remember that we can have many
objects in a single OBJ file. In our case, we have a single object, that is, Box .
v : This element defines the vertices in the object. This file shows eight vertices
for a cube. The exporter tries to reduce redundancy of vertices.
vt : This element defines the vertex texture coordinates ( x, y values) of the
texture listed in the Box.mtl file. The two values corresponding to vt are
called UV coordinates and are listed in each row. This is the reason that we
also refer to texture mapping as UV mapping. The Box.obj file defines 15
UV coordinates.
vn : This element defines the normals of the cube. It defines eight normals.
 
Search WWH ::




Custom Search