Game Development Reference
In-Depth Information
s : This element allows us to enable or disable smooth shading. The value,
off , denotes that smooth shading has been disabled.
f : This element defines each vertex of a face/primitive in the v/n/t format
depicted as follows:
f v/n/t v/n/t v/n/t
f 1/1/1 2/2/1 3/3/1
These three values (v, n, and t) show that each face of the Box object is
defined by three vertices, or a triangle. The value 1/1/1 means that you pick
the first vertex from the vertices list, the first normal from the normal list, and
the first texture coordinate from the texture coordinates list. In short, we can
say, each vertex of a face is defined by the vertex index, normal index, and
texture coordinate index (v/n/t). The relation between the vertex and the
texture coordinate is thus defined in the face definition.
Now, open Box.mtl in your favorite text editor. The content of the file is as follows:
# Blender MTL File: 'None'
# Material Count: 1
newmtl initialShadingGroup.004
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.000000 0.000000 0.000000
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 0.000000
illum 2
map_Kd boxDiffuse.jpg
The Ka element defines the ambient color, Kd defines the diffuse color, and Ks defines
the specular color. The map_kd element defines the name of the file with the texture.
The texture mapping is defined in the Box.obj file. The following figure shows the
texture map to texture a cube:
 
Search WWH ::




Custom Search