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

jit.gl.multiple Reference

Create multiple object instances

jit.gl.multiple

Description

Uses several jit.matrix objects to repeatedly draw an instance of a jit.gl object like jit.gl.mesh or jit.gl.gridshape. It attaches to a named instance of a jit.gl (OB3D) object provided by the name attribute.

Examples

Discussion

Parameters that can be set include position, rotation, rotatexyz, scale, color, tex_plane_s, tex_plane_t, and texture. All of these parameters take float32 matrices except texture which takes a char specifying the texture from a list. Parameter matrices can be of differing dim sizes, and will wrap to the dimensions of the matrix specified by the dimparam attribute.

For transformation attributes (position, rotate, rotatexyz, and scale), the order parameters are listed in the glparams attribute determines the order transformations are applied. The standard jit.gl transformation order is position, rotation, scale.

Arbitrary object attributes and shader parameters can be set by including in the glparams list attr. followed by the attr name, or shader. followed by the shader parameter name. For example, shader.zoom creates a matrix input for the zoom parameter of the td.rota.jxs shader, and attr.rad_minor creates a matrix input for the rad_minor attribute of a jit.gl.gridshape.

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.

There is an optional second argument which specifies the number of inlets corresponding to the number of arguments in the glparams attribute. If this second argument is not present, the default number of inlets is two. Those inlets will be for position and scale if the glparams attribute is not specified. If there are glparams, it defaults to the first two specified params.

Attributes

dimparam [symbol]

The name of the input parameter to wrap all other input matrices to.

glparams [10 symbols]

The list of OB3D attributes corresponding to object inlets that are modifiable by passing in a matrix. Valid attributes are position, rotate (angle-axis), rotatexyz, scale, color, and texture.

targetmode [int]

Flag for draw mode. 1 = draw_raw, 0 = draw.

targetname [symbol]

The name of the jit.gl object to attach to and draw multiple times.

texture [256 symbols]

The list of textures that could potentially be bound to the OB3D object. The specific texture can be specified by passing in a char matrix where the values of the matrix index into the texture list.

Common Box Attributes

OB3D Attributes

Messages

(drag)

Drag and drop a Jitter material file

color_matrix

Arguments

matrix name [symbol]
Specifies a named matrix to use for the color parameter if it's in the glparams list. Must be a 4-plane float32 matrix in RGBA format.

position_matrix

Arguments

matrix name [symbol]
Specifies a named matrix to use for the position parameter if it's in the glparams list. Must be a 3-plane float32 matrix.

rotate_matrix

Arguments

matrix name [symbol]
Specifies a named matrix to use for the rotate (angle-axis) parameter if it's in the glparams list. Must be a 4-plane float32 matrix.

rotatexyz_matrix

Arguments

matrix name [symbol]
Specifies a named matrix to use for the rotatexyz parameter if it's in the glparams list. Must be a 3-plane float32 matrix.

scale_matrix

Arguments

matrix name [symbol]
Specifies a named matrix to use for the scale parameter if it's in the glparams list. Must be a 3-plane float32 matrix.

tex_plane_s_matrix

Arguments

matrix name [symbol]
Specifies a named matrix to use for the tex_plane_s parameter if it's in the glparams list. Must be a 4-plane float32 matrix. The tex_map attribute of the target gl object must be set to 1 or 3.

tex_plane_t_matrix

Arguments

matrix name [symbol]
Specifies a named matrix to use for the tex_plane_t parameter if it's in the glparams list. Must be a 4-plane float32 matrix. The tex_map attribute of the target gl object must be set to 1 or 3.

texture_matrix

Arguments

matrix name [symbol]
Specifies a named matrix to use for the texture parameter if it's in the glparams list. Must be a char matrix.

OB3D Messages

See Also

Name Description
Working with OpenGL Working with OpenGL
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