OBJ_TO_TRI_SURFACE
Convert data from OBJ to TRI_SURFACE format


OBJ_TO_TRI_SURFACE is a MATLAB program which reads data from an OBJ file describing a polygonal mesh of a 3D surface, and converts it to a pair of arrays describing a triangular mesh or TRI_SURFACE.

Since the faces in an OBJ file can be of any polygonal order, while the faces in a TRI_SURFACE file must be triangular, the program automatically uses a crude method to break up higher order faces from the OBJ file into triangles.

An OBJ file is format for storing a description of the surface of a 3D object, composed of triangles or higher degree polygons.

A TRI_SURFACE or triangulated mesh surface, is described by a pair of arrays:

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages:

OBJ_TO_TRI_SURFACE is available in a MATLAB version.

Related Data and Programs:

OBJ, a data directory which contains a description and examples of OBJ files.

OBJ_DISPLAY, a MATLAB program which reads an OBJ file and displays it.

OBJ_IO, a MATLAB library which reads or writes an OBJ file.

PLY_TO_TRI_SURFACE, a MATLAB program which reads a PLY file and extracts the surface mesh data as a TRI_SURFACE dataset.

STLA_TO_TRI_SURFACE, a MATLAB program which reads an ASCII STL file and extracts the surface mesh data as a TRI_SURFACE dataset.

TRI_SURFACE, a data directory which contains examples of TRI_SURFACE files.

TRI_SURFACE_DISPLAY, a MATLAB program which displays a TRI_SURFACE.

TRI_SURFACE_IO, a MATLAB library which reads and writes the 3D graphics information in a TRI_SURFACE file;

TRI_SURFACE_TO_OBJ, a MATLAB program which reads a TRI_SURFACE dataset and extracts the surface mesh data as an OBJ file.

TRI_SURFACE_TO_PLY, a MATLAB program which converts TRI_SURFACE data to data suitable for storage as a PLY file.

Source Code:

Examples and Tests:

CESSNA is a Cessna airplane. The OBJ version is drawn using 3745 nodes and 3897 faces. The faces range in order from 3 (triangles) up to 42! OBJ_TO_TRI_SURFACE converts this to 3745 nodes and 7446 triangles before writing it out as a TRI_SURFACE file.

CUBE is a cube using 12 triangular faces and 36 nodes.

HUMANOID is a humanoid shape. The OBJ version is drawn using 64 nodes and 48 quadrilaterals. OBJ_TO_TRI_SURFACE converts this to 64 nodes and 96 triangles before writing it out as a TRI_SURFACE file.

SHUTTLE is the space shuttle. The OBJ version is drawn using 310 nodes and 393 faces, with 170 triangles and 223 quadrilaterals. OBJ_TO_TRI_SURFACE converts this to 310 nodes and 616 triangles before writing it out as a TRI_SURFACE file.

You can go up one level to the MATLAB source codes.


Last revised on 05 December 2010.