jit.gl.model Read and draw Wavefront .obj models

The jit.gl.model object requires one argument: the name of a drawing context. A named drawing context is a named instance of a jit.window, jit.pwindow, or jit.matrix object that has an instance of the jit.gl.render object associated with it. This value may also be set via the OB3D drawto attribute. The jit.gl.model object reads and draws Alias/Wavefront .obj files. Currently, only tessellated polygons are supported, and not advanced features of the .obj format such as NURBS or parametric surfaces.

GL Group

Attributes:
Name Type Description
drawgroup int If nonzero, draw only one group of polygons. It zero, draw all polygon groups in the model.
facet int The facet drawing mode (default = 0 (use built-in normals))
0 = built-in normals or automatically generated normals are used when rendering the model
1 = draw each triangle in the model with its own normal.
material_mode int Mode for applying built-in material properties of a model.
0 = material properties are ignored.
1 = the diffuse color component of the material is used to generate a vertex color.
2 = all components of the material are used.
verbose int Verbose mode flag (default = 0) In verbose mode, the jit.gl.model object will print out messages useful for debugging patches or models.

Messages:
make_normals [0/1 (int)]
Toggles automatically calculating vertex normals for the model, overwriting any existing ones. (default = 0) This is done automatically if the model has no vertex normals.

read { [filename (symbol)] }
Loads an .obj model file. The read message will attempt to find the model file in the Max search path and load it. If no model name is specified, a file dialog box is presented.

texgroup [group-number (int)] [texture-name (symbol)]
The texgroup message is used to apply a named texture to a numbered group of polygons within the model. The groups for a model are specified in its .obj file. The texture applied to a group will override any textures which have been applied to the object using the texture message. If 0 is used in place of a texture name, the texture for that group is removed and the texture of the OB3D is restored (or lack of texture).

Example:

See Also:
jit.gl.graph, jit.gl.gridshape, jit.gl.handle, jit.gl.isosurf, jit.gl.mesh, jit.gl.nurbs, jit.gl.plato, jit.gl.render, jit.gl.shader, jit.gl.sketch, jit.gl.slab, jit.gl.text2d, jit.gl.text3d, jit.gl.texture, jit.gl.videoplane, jit.gl.volume