This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

OBJ (.obj)

Wavefront OBJ format.
3D geometry format.
Used for storage and exchange of 3D geometry definitions.
Native format of the Wavefront application.
Stores a geometry as a collection of line, point, and polygon primitives and their properties.
Can store face color information.
ASCII format.
Developed by Alias Wavefront.
Stores a single geometry.
  • Import imports the specified element from an OBJ file.
  • Import imports multiple elements.
  • Export creates an OBJ file by treating expr as specifying element elem.
  • Export treats each as specifying the corresponding .
  • Export exports expr with the specified option elements taken to have the specified values.
  • Export uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"Elements"list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties, and settings
  • Data representation elements:
"Graphics3D"OBJ file represented as a Graphics3D object
"GraphicsComplex"GraphicsComplex object, representing the geometry stored in the file
"LineData"lines represented as lists of indices, referencing the vertices as given by the element
"LineObjects"list of Line primitives given in absolute coordinates
"PointData"point data in indexed form
"PointObjects"list of Point primitives given in absolute coordinates
"PolygonData"polygon data in indexed form
"PolygonColors"face color information for each polygon
"PolygonObjects"list of Polygon primitives given in absolute coordinates
"VertexData"list of vertex coordinates
"VertexNormals"normal vectors corresponding to the vertices given by
  • When rendering an OBJ color model, Import automatically uses the setting Lighting.
BackgroundAutomaticwhat background color to use
ImageSizeAutomaticoverall size of the graphics to display
LightingAutomaticwhat simulated lighting to use in coloring 3D surfaces
  • All options of Graphics3D can be given when importing from OBJ.
  • Advanced options:
"InvertNormals"Falsewhether to invert the orientation of vertex normals
"VerticalAxis"{0,0,1}orientation to assume for the coordinate system used in the file
  • By default, Mathematica assumes that in the coordinate system used by the OBJ format the vertical axis corresponds to the third coordinate.
  • With the setting , Mathematica will apply the transformation to all graphics coordinates when importing from OBJ, and the inverse transformation when exporting to OBJ.
Import an OBJ example file:
Show the Import elements available in this file:
Import and count the polygons stored in this file:
Export a 3D model with transparent faces:
Compute a 3D geometry using ParametricPlot3D:
Export it to OBJ:
Import an OBJ example file:
In[1]:=
Click for copyable input
Out[1]=
Show the Import elements available in this file:
In[2]:=
Click for copyable input
Out[2]=
Import and count the polygons stored in this file:
In[3]:=
Click for copyable input
Out[3]=
 
Export a 3D model with transparent faces:
In[1]:=
Click for copyable input
Out[1]=
 
Compute a 3D geometry using ParametricPlot3D:
In[1]:=
Click for copyable input
Out[1]=
Export it to OBJ:
In[2]:=
Click for copyable input
Out[2]=