A newer version of Max is available. Click here to access the latest version of the documentation

jit.gl.mesh Reference

Generate GL geometry from matrices

jit.gl.mesh

Description

Creates a geometric surface from a jit.matrix connected to the left-most inlet containing spatial coordinates. Additional geometry can be specified by attaching other jit.matrix objects to the other inlets.

Examples

Discussion

Matrices feed into inlets represent (from left to right): vertex, texcoord, normal, color, specular, edgeflag, tangent, bitangent, and index data.
The jit.gl.mesh 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.

Attributes

auto_bitangents [int]

Enables or disables the calculation of bitangent (aka binormal) directions (only available if texcoords and normals exist) (default = 0).

auto_colors [int]

Enables or disables the calculation of vertex colors (default = 0).

auto_normals [int]

Enables or disables the calculation of normal directions used for calculating lighting (default = 1).

auto_tangents [int]

Enables or disables the calculation of tangent directions (only available if texcoords and normals exist) (default = 0).

cache_mode [symbol]

The mode to use for the geometry cache. (default = var) Supported modes are:

Possible values:

'auto'
'vertexarray'
'vertexbuffer'
'displaylist'
'none'

color_mode [symbol]

The mode to use for the calculating vertex colors. (default = position) Supported modes are:

Possible values:

'vertex'
'position'
'texcoord'
'normal'
'tangent'
'bitangent'
'edgeflag'

draw_mode [symbol]

The mode to use for rendering the geometry. (default = tri_grid) Supported modes are:

Possible values:

'tri_grid'
'quad_grid'
'points'
'lines'
'line_strip'
'line_loop'
'triangles'
'tri_fan'
'tri_strip'
'quads'
'quad_strip'
'polygon'
'lines_adjacency'
'line_strip_adjacency'
'triangles_adjacency'
'triangle_strip_adjacency'

Common Box Attributes

OB3D Attributes

Messages

(drag)

Drag and drop a Jitter material file

bind

Binds the internal mesh buffers for drawing.

bitangent_matrix

The word bitangent_matrix, followed by a symbol, specifies a matrix of bitangent values. This must be the same size as the matrix specified by the vertex_matrix message. It must be a 3 plane matrix.

color_matrix

Specifies a matrix of color values. This must be the same size as the matrix specified by the vertex_matrix message, and can be a 3 or 4 plane matrix.

edgeflag_matrix

The word edgeflag_matrix, followed by a symbol, specifies a matrix of edge flag values. This must be the same size as the matrix specified by the vertex_matrix message. It must be a 1 plane matrix.

index_matrix

The word index_matrix, followed by a symbol, specifies a matrix of indices. It can be any size, but it must have 1 plane and be an integer matrix.

normal_matrix

The word normal_matrix, followed by a symbol, specifies a matrix of normal values. This must be the same size as the matrix specified by the vertex_matrix message. It must be a 3 plane matrix.

reset

The word reset resets all parameters to their default states.

specular_matrix

The word specular_matrix, followed by a symbol, specifies a matrix of specular values

tangent_matrix

The word tangent_matrix, followed by a symbol, specifies a matrix of tangent values. This must be the same size as the matrix specified by the vertex_matrix message. It must be a 3 plane matrix.

texcoord_matrix

The word texcoord_matrix, followed by a symbol, specifies a matrix of texture coordinate values. This must be the same size as the matrix specified by the vertex_matrix message. It can be a 2, 3, or 4 plane matrix.

unbind

Unbinds the internal mesh buffers after drawing.

vertex_attr_matrix

The word vertex_attr_matrix, followed by a symbol, specifies a matrix of arbitrary per-vertex data

vertex_matrix

The word vertex_matrix, followed by a symbol, specifies a matrix of vertex values. It can be 3 or 4 planes.

OB3D Messages

See Also

Name Description
Working with OpenGL Working with OpenGL
Video and Graphics Programming Tutorials Video and Graphics Programming Tutorials
jit.gl.graph
jit.gl.gridshape
jit.gl.handle
jit.gl.isosurf
jit.gl.model
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