jit.gl.model
Description
jit.gl.model Reads and draws a variety of 3D model formats, such as OBJ, Collada, and Blender. Only tessellated polygons are drawn, and surfaces that are not tessellated are converted before drawing. Certain model formats, such as Collada, support skinned animation.
Examples

Discussion
This 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. Additionally it can reference the name of a jit.gl.node sub-context. This value may also be set via the OB3D drawto attribute. If no argument is present, the object is implicitly added to the first valid drawing context or sub-context found in the current patch or by searching up the patcher hierarchy.
Supported model file types include:
Wavefront Object Model File
Collada Model File
Blender 3D Model File
3ds Max 3DS Model File
3ds Max ASE Model File
Stanford Polygon Library Model File
AutoCAD DXF Model File
LightWave Model File
Modo Model File
Stereolithography Model File
AC3D Model File
Milkshape 3D Model File
TrueSpace COB Model File
TrueSpace SCB Model File
Valve SMD Model File
Valve VTA Model File
Quake I Mesh File
Quake II Mesh File
Quake III Mesh File
Quake III BSP File
Return to Castle Wolfenstein Model File
Doom 3 Model File
Biovision BVH Motion Capture File
CharacterStudio Motion Capture File
Direct X Model File
BlitzBasic 3D Model File
Quick3D Q3D Model File
Quick3D Q3S Model File
Ogre3D XML Model File
Irrlicht Mesh File
Irrlicht Scene File
Neutral File Format File
Sense8 WorldToolKit File
Object File Format File
PovRAY Raw Model File
Terragen Terrain File
3D GameStudio Model File
3D GameStudio Terrain File
Izware Nendo Model File
For more information see the
Assimp
website.
Attributes
animblendmode [int]
Determine how multiple enabled animations will be blended (default = 0 - Average).
Possible values:
0 = 'Average'
( Weights will be averaged to equal 1 )
1 = 'Cumulative'
( Weights will be added and can go greater than 1 )
cache_mode [symbol]
The mode to use for the geometry cache (default = var). Synonym for mode.
Possible values:
'displaylist'
'vertexarray'
'vertexbuffer'
'immediate'
displaylist [int]
Cache in displaylist flag (default = 0). This feature may be used to speed up rendering time by creating and storing a list of gl drawing commands on the graphics card. This will have no effect if matrixoutput turned on, and will prevent model animation when enabled.
drawgroup [int]
If non-zero, draw only one mesh. If zero, draw all mesh groups in the model (default = 0).
drawskeleton [int]
If enabled draw a wireframe representation of the bones in the model (default = 0).
file [symbol]
Load a model file
find_instances [int]
Mesh instance removal on import (default = 1). An optional post-processing step when importing the model file. Instanced meshes are removed by referencing one master.
fix_normals [int]
Fix normals on import (default = 0). An optional post-processing step when importing the model file. Tries to fix normal vectors that are facing inwards.
gen_normals [int]
Generate normals on import (default = 1). An optional post-processing step when importing the model file.
gen_tangents [int]
Generate tangents on import (default = 1). An optional post-processing step when importing the model file. Calculates tangents and bitangents if possible.
hasbones [int]
Indicates whether the loaded model has bone nodes.
material_mode [int]
Mode for applying built-in material properties of a model. (default = 1 - Diffuse)
Possible values:
0 = 'Ignore (Inherit Colors From OB3D)'
( Material properties are ignored )
1 = 'Diffuse (Use Diffuse Only)'
( Only diffuse color component is used )
2 = 'All (Use All Color Values)'
( All material components are used )
3 = 'JMTL (Use Jitter Material)'
( Internal jit.gl.material object is used )
mode [symbol]
Determines the method used to draw the model (default = var).
Possible values:
'displaylist'
( Synonym for Immediate mode with displaylist enabled )
'var'
( Vertex Arrays )
'vbo'
( Vertex Buffer Objects )
'immediate'
( Immediate mode drawing )
nodeaxes [int]
If non-zero, draw a RGB axes at the location of all the nodes in the model.
normalize [int]
Normalize model coordinates flag (default = 1). When enabled, the model is scaled to the range (-1.,1.) for the x, y, and z axes.
numanimations [int]
Indicates the number of animations in the model.
numgroups [int]
Indicates the number of mesh groups. A mesh group consists of vertex data and material data.
optimize [int]
Optimize vertices and nodes on import (default = 1). An optional post-processing step when importing the model file. Identical vertices are jointed to optimize indexing, small meshes are joined if possible, and Nodes with no data assigned are collapsed and joined.
smoothing_angle [float]
Specifies the edge angle above which to smooth vertex normals (default = 89.)
verbose [int]
Verbose mode flag (default = 0). If enabled, messages useful for debugging are printed to the Max Console.
Common Box Attributes
OB3D Attributes
Messages
(drag)
animenable
Arguments
enable [int]
animloop
Arguments
loop-enable [int]
animlooppoints
Arguments
loop-start [float]
loop-stop [float]
animrate
Arguments
rate [float]
animreset
Arguments
animtime
Arguments
time [float]
animweight
Arguments
weight [float]
copynodestoclipboard
getanim_dict
Arguments
getanimnames
getbonenames
getmaterial_dict
Arguments
getnodenames
gettexnames
nodeanimenable
Arguments
anim-enable [int]
nodebind
Arguments
jit.anim.node name [symbol]
nodereset
Arguments
nodesetinitial
Arguments
read
sendmaterial
Arguments
message [symbol]
values [list]
sendtexture
Arguments
message [symbol]
values [list]
texgroup
Arguments
texture-name [symbol]
OB3D Messages
See Also
Name | Description |
---|---|
Working with OpenGL | Working with OpenGL |
Video and Graphics Programming Tutorials | Video and Graphics Programming Tutorials |
Online Resources | Online Resources |
jit.gl.mesh | |
jit.gl.render | |
jit.gl.texture | |
jit.gl.material | |
jit.gl.camera | |
Tutorial 36: 3D Models | Tutorial 36: 3D Models |