fromobj

by Stewart Dickson

This is a program for converting a Wavefront OBJ-format geometrical object description file to one of the Open Inventor file format.

Program Command Usage

fromobj [options] infile.obj outfile.iv Options:

The infile.obj is assumed to be of the format as produced by the Wavefront Advanced Visualizer.

The OBJ Input File Format

The following example OBJ file is a tetrahedron.
% Comment ...

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

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

Note

In the OBJ file format, the geometrical vertices are indexed in the specification of the polygons. That is, the polygons refer to the integer index of the vertex in the vertex list (beginning with '1'). The OBJ file description format therefore supports the preservation of "winged-edge" topological linkages in the imported object. (See Glassner reference, below.)

fromobj -w (weld) option will remove redundant vertices at each common edge and produce welded Open Inventor IndexedFaceSet nodes on output.

The optional floating-point number after the -w option is the welding resolution, or the distance below which vertices will be considered identical.

Without specifying the welding resolution, fromobj will dynamically set the effective welding resolution to be one-half the length of the shortest polygon edge it encounters.

fromobj reports the value of the effective welding resolution after conversion to allow the user to fine-tune this value, if necessary.

See Also