OBJ (File Format)

From Custom Mario Kart
(Redirected from OBJ)
Jump to navigation Jump to search
Under Construction
This article is not finished. Help improve it by adding accurate information or correcting grammar and spelling.

Wavefront OBJ files are simplified model files which are easy to edit in notepad. They are mainly used to create custom tracks with CTools or the SZS Modifier. The file is separated in the following sections:

  • Object (o): Objects split the file into separate models. They are ignored by the SZS Modifier, CTools and Wiimms SZS Tools.
  • Group (g): Used to separate polygons, textures are assigned to a group. A group can't have more than 1 texture. Multiple groups are possible.
  • Vertices (v): Points where multiple edges come together.
  • Texture Coordinates (vt): The location of the upper-left corner of the texture.
  • Normals (vn): Gives information about which side of a face is the front, and how textures are placed on curved surfaces.
  • Faces (f): Binding v, vt and vn to create the model.

OBJ File

On this page multiple examples are given with the same model.

The model we use as example with the lengths given in red
mtllib mod.mtl

g lolz_Main-Metal_Brass_Ceiling
usemtl Metal_Brass_Ceiling
v 1.999698 0.000000 -0.000000
v 1.499773 0.000000 -0.999849
v 1.499773 0.000000 -0.000000
v 1.499773 0.000000 -1.999698
v 1.999698 0.000000 -1.999698
v 0.499924 0.000000 -0.000000
v 0.000000 0.000000 -1.999698
v 0.000000 0.000000 -0.000000
v 0.499924 0.000000 -1.999698
v 0.499924 0.000000 -0.999849
v 0.999849 0.000000 -0.000000
v 0.999849 0.000000 -0.999849
vn -0.000000 1.000000 0.000000
vn -0.000000 1.000000 0.000000
vn -0.000000 1.000000 0.000000
vn -0.000000 1.000000 0.000000
vn -0.000000 1.000000 0.000000
vn -0.000000 1.000000 0.000000
vn -0.000000 1.000000 0.000000
vn -0.000000 1.000000 0.000000
vn -0.000000 1.000000 0.000000
vn -0.000000 1.000000 0.000000
vn -0.000000 1.000000 0.000000
vn -0.000000 1.000000 0.000000
vt 10.000008 4.000004
vt 9.000006 6.000003
vt 9.000006 4.000003
vt 9.000007 8.000003
vt 10.000009 8.000004
vt 7.000002 4.000001
vt 6.000001 8.000000
vt 6.000000 4.000000
vt 7.000003 8.000001
vt 7.000002 6.000001
vt 8.000004 4.000002
vt 8.000004 6.000002
f 1/1/1 2/2/2 3/3/3
f 2/2/2 1/1/1 4/4/4
f 4/4/4 1/1/1 5/5/5
f 6/6/6 7/7/7 8/8/8
f 7/7/7 6/6/6 9/9/9
f 9/9/9 6/6/6 10/10/10
f 9/9/9 10/10/10 11/11/11
f 9/9/9 11/11/11 12/12/12
f 12/12/12 11/11/11 2/2/2
f 12/12/12 2/2/2 4/4/4

Vertices

These are points where edges come together, as described above. These are used to create faces. So basically are the vertices the only points that create the model, using the f section.
In a wavefront obj file the lines giving vertices start with "v" and the values are given as [x, y, z, (w)] where w is optional.

The previous model with only the vertices given
All faces drawn


Links