Wavefront OBJ

from Wikipedia, the free encyclopedia
OBJ
File extension : .obj
Developed by: Wavefront Technologies
Initial release: 1989
Type: ASCII format
Container for: 3D models


3D models

OBJ (or .obj ) is an open file format for storing three-dimensional geometric shapes. The format developed by Wavefront Technologies is supported by many 3D graphics programs and is therefore suitable for the cross-program and cross-platform transfer of 3D models .

The OBJ format stores geometric properties of an object or grouped objects, i. H. Corners , texture coordinates, normals , surfaces and smoothing. Optical material properties (e.g. reflection, transparency, highlight, etc.) are defined in a separate material file, which can also contain information on texturing. The material file usually has the file extension .mtl (from material template library ) and can be referenced in the actual OBJ file.

construction

  • optional comment
  • if necessary, integration of the material template library .
  • if necessary object naming
  • List of vertices
  • List of texture coordinates
  • List of normals
  • Description of the areas (with grouping)
    • possibly group name for the following areas
    • if applicable, name of the material to be used
    • if necessary number of the smoothing group
    • Description of the areas

Details

Obj files are read line by line, each command requires a new line. Above commands:

"# <string Comment>" Identification of a comment - everything in the same line after the hash is ignored.

 # Dies ist ein Kommentar

"mtllib <string Path>" Integration of a material library - the materials described in the file can now be used.

 mtllib Cube.mtl

"o <string Name>" Name of the object.

 o CubeIstMeinName

"v <float X> <float Y> <float Z> [<float W>]" Description of a vertex .

 v 1.000000 1.000000 -0.999999

"vt <float X> <float Y>" Description of a texture coordinate point.

 vt 0.500000 0.500000

"vn <float X> <float Y> <float Z>" Description of a normal.

 vn 0.000000 -1.000000 0.000000

"g <string Name>" Name of a group (all following areas are assigned to this group).

g HierKommtEinGruppennameHin

"usemtl <string Material_Name>" All following surfaces receive the material defined with them in the material library.

 usemtl DiesesInDerMTLDateiDefinierteMaterialWirdGenutzt

"s <integer smoothing group>" All the following surfaces are given a defined smoothing group number between 1 and 32. The edges of adjacent surfaces with the same smoothing group number are displayed smoothly (the edge between the two surfaces becomes invisible), adjacent surfaces with different smoothing group numbers are displayed normally (the edge between the two surfaces becomes visible).

 s 32

"s off" deactivation of the smoothing.

 s off

"f <integer A_V> <integer B_V> <integer C_V> ..." Description of an area. (Possibility Number 1)

 f 1 2 3

"f <integer A_V> / <integer A_VT> <integer B_V> / ..." Description of an area. (Possibility 2)

 f 2/1 3/1 4/1

"f <integer A_V> // <integer A_VN> <integer B_V> // ..." Description of an area. (Possibility 3)

 f 2//1 3//1 4//1

"f <integer A_V> / <integer A_VT> / <integer A_VN> <integer B_V> / ..." Description of an area. (Possibility 4)

 f 2/3/1 3/4/1 4/6/1

In addition, degrees, basic matrix, "step size" and instead of areas lines, points and curves can be described.

example

# Blender v2.71 (sub 0) OBJ File: 
# www.blender.org
mtllib Cube.mtl
o Cube
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -0.999999
v 0.999999 1.000000 1.000001
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 1.000000 -0.000000 0.000000
vn -0.000000 -0.000000 1.000000
vn -1.000000 -0.000000 -0.000000
vn 0.000000 0.000000 -1.000000
g Cube_Cube_Material
usemtl Material
s off
f 2//1 3//1 4//1
f 8//2 7//2 6//2
f 1//3 5//3 6//3
f 2//4 6//4 7//4
f 7//5 8//5 4//5
f 1//6 4//6 8//6
f 1//1 2//1 4//1
f 5//2 8//2 6//2
f 2//3 1//3 6//3
f 3//4 2//4 7//4
f 3//5 7//5 4//5
f 5//6 1//6 8//6

Related file formats

Web links

Individual evidence

  1. B1. Object Files (.obj). Retrieved October 7, 2018 (eb).