Obj

From Wikipedia, the free encyclopedia

Jump to: navigation, search

OBJ (or .OBJ) is a geometry definition file format first developed by Wavefront Technologies for its Advanced Visualizer animation package. The file format is open and has been adopted by other 3D graphics application vendors. For the most part it is a universally accepted format.

The OBJ file format is a simple data-format that represents 3D geometry alone — namely, the position of each vertex, the UV position of each texture coordinate vertex, normals, and the faces that make each polygon defined as a list of vertices, texture vertices, and normals.

A typical OBJ file looks like this:

# this is a comment
# Here is the first vertex, with (x,y,z) coordinates.
v 0.123 0.234 0.345 
v ... 
...

#Texture coordinates
vt ...
...

#Normals in (x,y,z) form; normals might not be unit. 
vn ...
..

#Each face is given by a set of indices to the vertex/texture/normal
#coordinate array that precedes this.
#Hence f 1/1/1 2/2/2 3/3/3 is a triangle having texture coordinates and 
#normals for those 3 vertices,
#and having the vertex 1 from the "v" list, texture coordinate 2 from 
#the "vt" list, and the normal 3 from the "vn" list

f v0/vt0/vn0 v1/vt1/vn1 ...
f ...
...

# when there are named polygon groups or materials groups the following 
# tags appear in the face section,
g [group name]
usemtl [material name]
# the latter matches the named material definitions in the external .mtl file.
# each tag applies to all faces following, until another tag of the same type appears.
...

...

An OBJ file also supports smoothing parameters to allow for curved objects, and also the possibility to name groups of polygons. It also supports materials by referring to an external MTL material file.

OBJ files, due to their list structure, are able to reference vertices, normals, etc either by their absolute (1-indexed) list position, or relatively by using negative indices and counting backwards. However, not all software supports the latter approach, and conversely some software inherently writes only the latter form (due to the convenience of appending elements without needing to recalculate vertex offsets, etc), leading to occasional incompatibilities.

[edit] Software which supports OBJ

[edit] See also

[edit] External links


Personal tools