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

jit.gl.handle Reference

Use mouse movement to control position/rotation

jit.gl.handle

Description

jit.gl.handle responds to mouse clicks and drags in the destination by generating rotate and position messages out its left outlet.

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 which 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. When the context is being drawn to a jit.window or jit.pwindow, jit.gl.handle responds to mouse clicks and drags in the destination by generating rotate and position messages out its left outlet. When these messages are sent to 3D objects, the objects can then be rotated and moved in space using the mouse.

If the messages from jit.gl.handle are sent directly to jit.gl.render, mouse motion has the effect of moving and rotating the entire 3D space defined by the renderer. In this setup, the inherit_transform attribute should be set to 1, so that the jit.gl.handle object does not move within the world as well.

While mouse input is present, the jit.gl.handle is drawn as circles around a sphere on the x, y, and z axes. Clicking and dragging on the sphere rotates connected objects. Dragging with the command key held moves the objects along the xy plane relative to the camera. Dragging with the option key held moves the objects towards and away from the camera.

Attributes

auto_handle [int]

Enable/disable auto handle mode. When enabled the handle will perform mouse picking to select 3D objects under the mouse. This mode is enabled by default when the jit.gl.handle left inlet is unconnected.

auto_rotate [int]

Continue spinning along last rotation when no UI input is present (default = 0)

auto_time [int]

The time between automatic rotations for auto_rotate (default = 0)

filters [10 symbols]

Specify a list of filterclass names that can be picked when auto_handle is enabled (default = all). Possible values include all and default . Additional values include any user-specified filterclass names (maximum allowed = 10).

hilite_color [4 floats]

Set the hilite color, used when select_mode is hilite (default = 1. 1. 0. 1.).

hover [int]

Enable/disable mouse hovering (default = 0).

radius [float]

The radius of control sphere in 3D world (default = 1.0)

rgb_axes [int]

Sphere axis color flag (default = 1) When the flag is set, the sphere axes are drawn in RGB colors, Otherwise, the color attribute determines the color used.

select_mode [symbol]

Set the selection mode to use when auto_handle = 1 (default = none).

Possible values:

'none'
'bounds'
'wireframe'
'hilite'
'depth'

tracking [float]

The rotation amount relative to amount of mouse movement (default = 1.)

ui_priority [int]

UI priority value (default = -700). When multiple UI objects are listening to the same window, ui_priority determines the order objects receive input. Lower values test first.

visible [int]

Visibility flag (default = 1) When the flag is set, the sphere axes are visible in the 3D world.

Common Box Attributes

OB3D Attributes

Messages

reset

Returns jit.gl.handle and attached objects to the original viewing origin and undoes all rotation.

OB3D Messages

See Also

Name Description
Working with OpenGL Working with OpenGL
jit.gl.graph
jit.gl.gridshape
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 36: 3D Models Tutorial 36: 3D Models