Wavefront .obj file

This product was added to computer science because of the content, defects on the quality assurance side of the editor. This is done to bring the quality of the articles from the computer science subject area to an acceptable level. Help us to eliminate the substantive shortcomings of this article and take part you in the discussion! ( )

Template: Infobox file format / Maintenance / MIME missing template: Infobox file format / Maintenance / Magic number is missing template: Infobox file format / Maintenance / default missing template: Infobox file format / Maintenance / missing site

OBJ ( or. Obj ) is a file format for storing geometric shapes. The invented by Wavefront Technologies format is adopted by almost all animation programs and is therefore very suitable for cross-program sharing of geometric models.

The format only stores the individual objects per se ( each vertex is defined by coordinate individually and then combined to form areas). For the specification of optical data (eg reflection, transparency, specular, etc. ) there is this. Monthly format, which can be integrated and used by command in the. Obj file.

Structure

Comments are defined using the double cross (#):

# This is a comment There are different ways of defining a point:

V 1.0 1.0 1.0 # Definition of a point. The following, numbers describe the X -, Y -, and Z- position in space (optional can still be added to W as a fourth statement ).

. A valid obj file that describes a cube:

O cuboid # Specifies the name of the object created       # Definition of the points    v 1.0 -1.0 -1.0    v 1.0 -1.0 1.0    v -1.0 -1.0 1.0    v -1.0 -1.0 -1.0    v 1.0 1.0 -1.0    v 1.0 1.0 1.0    v -1.0 1.0 1.0    v -1.0 1.0 -1.0       # Definition of the land:    f 1 2 3 4    f 5 6 7 8    f 1 5 6 2    f 2 6 7 3    f 3 7 8 4    f 5 1 4 8       # Definition of the key points:    f 1 2 3    f 5 6 7 8 scheme

The definition of a surface with points is carried out according to the scheme keyword f - position of the first point - position of the second point - position of the third point If necessary, additional points can be added, but it must be given at least three vertices, which earlier in the source have been defined.

Other commands

The "o [ name]" command specifies the name of the object created. All definitions described below in the source code automatically belong to this until a new object is defined.

O Area # Definition of the " Area ", all made ​​from here definitions automatically refer to this object       v 1.0 2.0 3.0    v 4.0 5.0 6.0    v 1.0 5.0 2.5       f 1 2 3          o Dice # Definition of the " Dice ", all made ​​here from definitions apply automatically to this object       v 10.0 11.0 12.0    ... The "g" command works just like the command object definition, but in this case a group is created.

814695
de