jit.gl.path Reference

Generate and render a path in OpenGL

jit.gl.path

Description

The jit.gl.path object generates and renders a 3D path. See the jit.path object for more information on the underlying path structure. The 3D visualization can be rendered as either a line, an extruded line (ribbon), an extruded circle (tube), or an extruded 2D contour. The path stores 10 values: position x/y/z, color r/g/b/a, scale x/y, and orient angle.
For more information on how the extrusion is handled, see the GLE library: http://www.linas.org/gle

Examples

Generate and render a path in OpenGL

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.

Attributes

autohandles [int]

Enable the calculation of handle values every time the path is edited (default = 1).

closed [int]

g/s(get)

Indicates the path is closed (first and last points are equal).

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.

drawhandles [int]

Enable drawing of path handles, for debugging (default = 0).

endcap [int]

Enable the closing of extruded path endpoints. (default = 0)

evalin [float]

A parameter between 0 and 1 to determine where in the path rendering starts (default = 0.).

evalout [float]

A parameter between 0 and 1 to determine where in the path rendering ends (default = 1.).

extrudescale [2 floats]

2D scaling factor for extrusion contours in the form x y (default = 1. 1.).

interpmode [symbol]

Path interpolation method (default = linear).

Possible values:

'linear' ( Linear interpolation )
'spline' ( Hermite interpolation )

joinstyle [symbol]

Extrusion segment join method (default = angle). See the GLE library for more information.

Possible values:

'raw'
'angle'
'cut'
'round'

normgen [symbol]

Normal generation method for extruded paths (default = none). See the GLE library for more information.

Possible values:

'none' ( No generation )
'facet' ( Normal vector per facet )
'edge' ( Normal vectors lie along edges )
'pathedge' ( Normal vectors lie along edges and interpolate between segments )

pathstyle [symbol]

Path drawing method (default = line).

Possible values:

'line'
'ribbon'
'tube'
'contour'

pointcount [int]

g/s(get)

Number of path points (default = 0).

segments [int]

Number of segments between points (default = 20).

texscale [3 floats]

The 3D scaling factor for textures in the form x y z (default = 1. 1. 1.) .

texturemode [int]

Texturing coord generation method for extruded paths (default = 1). See the GLE library for more information.

Possible values:

0 = 'none' ( No texture coord generation )
1 = 'vertex_flat' ( Vertex X is U, accumulated segment length is V )
2 = 'normal_flat' ( Normal vector X is U, accumulated segment length is V )
3 = 'vertex_cylinder' ( Vertex cylinder mapping for U, accumulated segment length for V )
4 = 'normal_cylinder' ( Normal cylinder mapping for U, accumulated segment length for V )
5 = 'vertex_sphere' ( Vertex sphere mapping )
6 = 'normal_sphere' ( Normal sphere mapping )
7 = 'vertex_model_flat' ( same as vertex_flat but with untransformed vertices )
8 = 'normal_model_flat' ( same as normal_flat but with untransformed vertices )
9 = 'vertex_model_cylinder' ( same as vertex_cylinder but with untransformed vertices )
10 = 'normal_model_cylinder' ( same as normal_cylinder but with untransformed vertices )
11 = 'vertex_model_sphere' ( same as vertex_sphere but with untransformed vertices )
12 = 'normal_model_sphere' ( same as normal_sphere but with untransformed vertices )

Common Box Attributes

OB3D Attributes

Messages

addcolor

Arguments

r [float]
g [float]
b [float]
a [float]
Add color values to the last point in the path.

addcontour

Arguments

contour-vals [list]
Set the contour to be used for pathstyle contour. The contour-vals are a list of X and Y position values describing a contour in 2D space. A minimum of 4 are required.

addorient

Arguments

orient [float]
Add an orientation value to the last point in the path.

addscale

Arguments

scale-x [float]
scale-y [float]
Add scale values to the last point in the path.

append

Arguments

x [float]
y [float]
z [float]
r [float]
g [float]
b [float]
a [float]
scale-x [float]
scale-y [float]
orient [float]
Append point values to the end of the path.

calchandles

Calculate the path handles of each point in the path using the Catmull-Rom method. This will overwrite any previously stored handles.

clear

Remove all points from the path

closepath

Close the path by adding a point to the end equal to the first point.

delete

Arguments

index [int]
Delete the point at index

edit

Arguments

index [int]
x [float]
y [float]
z [float]
r [float]
g [float]
b [float]
a [float]
scale-x [float]
scale-y [float]
orient [float]
Edit the point at index

edithandle

Arguments

index [int]
x [float]
y [float]
z [float]
r [float]
g [float]
b [float]
a [float]
scale-x [float]
scale-y [float]
orient [float]
Edit the point handle at index

gethandle

Arguments

index [int]
Get handle values at index and output through dump outlet.

getpoint

Arguments

index [int]
Get point values at index and output through dump outlet.

insert

Arguments

index [int]
x [float]
y [float]
z [float]
r [float]
g [float]
b [float]
a [float]
scale-x [float]
scale-y [float]
orient [float]
Insert a new point at index

setcolor

Arguments

index [int]
r [float]
g [float]
b [float]
a [float]
Set color values at index

setorient

Arguments

index [int]
orient [float]
Set orientation value at index

setscale

Arguments

index [int]
scale-x [float]
scale-y [float]
Set scale values at index

OB3D Messages

See Also

Name Description
Working with OpenGL Working with OpenGL
jit.path
jit.anim.path
jit.gl.sketch