jit.gl.gridshape Reference

Generate simple geometric shapes as a grid

jit.gl.gridshape

Description

Creates one of several simple shapes (sphere, torus, cylinder, opencyclinder, cube, opencube, plane, circle) laid out on a connected grid. These shapes may be either rendered directly, or sent out the leftmost outlet as a matrix of values.

Examples

Discussion

The jit.gl.gridshape 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

cache_mode [symbol]

The mode to use for the geometry cache (default = vertexarray).

Possible values:

'immediate'
'vertexarray'
'vertexbuffer'

dim [2 ints]

The dimensions of the grid (default = 20 20)

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.

gridmode [int]

Grid render mode (default = 0 (quadrilateral grid))
0 = quad_grid (quadrilateral grid)
1 = tri_grid (triangular grid)

rad_minor [float]

The minor radius of a torus, if one is rendered or sent out as a matrix. (default = 0.25)

shape [symbol]

The shape to be used (default = sphere) Supported shapes are:

Possible values:

'sphere'
'torus'
'cylinder'
'opencylinder'
'cube'
'opencube'
'plane'
'circle'
'cone'
'capsule'

Common Box Attributes

OB3D Attributes

Messages

(drag)

Accepts a jitmtl material file and applies it to the shape.

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.handle
jit.gl.isosurf
jit.gl.mesh
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
Tutorial 32: Camera View Tutorial 32: Camera View
Tutorial 33: Polygon Modes, Colors and Blending Tutorial 33: Polygon Modes, Colors and Blending
Tutorial 37: Geometry Under the Hood Tutorial 37: Geometry Under the Hood
Tutorial 41: Shaders Tutorial 41: Shaders
Tutorial 42: Slab: Data Processing on the GPU Tutorial 42: Slab: Data Processing on the GPU