Graphics Reference
In-Depth Information
The .obj file format was developed by Wavefront years ago to store
geometric information, including lines and polygons (and more). The
glman
application supports a subset—but a very useful subset—of the format. A full
description of the file format is found in [30], and there are various public-
domain sources for .obj files that you can import. You will find several .obj files
in the topic's Web resources. If you have a particular geometry on which you
want to test your shader(s), creating an .obj version of the geometry could be
useful, and it is not difficult to create.
Reads a list of
GL_TRIANGLES
from an .obj file named
filename
. If
a filename is not given,
glman
will prompt you for it. The full
.obj format can be quite complex, but
glman
just supports verti-
ces, normals, texture coordinates, and faces.
Obj filename
WireObj filename
Same as
Obj
, but creates a wireframe object.
Reads a list of
GL_TRIANGLES_ADJACENCY
from an .obj file named
filename
. Triangles with adjacency are described in Chapters 5
and 12, and this command is useful for working with geometry
shaders. If you don't have a real need to use triangle adjacency,
use
Obj
instead of
ObjAdj
. The file will read faster, and the
resulting geometry will display faster. If no filename is given,
glman
will prompt you for it. As with the
Obj
command, this
feature just supports vertices, normals, texture coordinates, and
faces.
ObjAdj filename
In order to work with tessellation shaders,
glman
must support the con-
cept of a patch. This requires one new command and a construction to define
the patch geometry.
Specify the number of vertices in a patch.
NumPatchVertices N
Define the vertices that make up the patch. The total num-
ber of
glVertex
statements must match the number of ver-
tices specified for the patch.
glBegin gl_patches
glVertex X Y Z
...
glVertex X Y Z
glend
Specifying Textures
These commands let you load a 1D, 2D, or 3D texture from a file to use with
your shaders.