jit.gl.handle Use mouse movement to control position/rotation

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. This value may also be set via the OB3D drawto attribute. 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.

GL Group

Attributes:
Name Type Description
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)
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.
tracking float The rotation amount relative to amount of mouse movement (default = 1.)
visible int Visibility flag (default = 1) When the flag is set, the sphere axes are visible in the 3D world.

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

rotatexyz [x-angle (float)] [y-angle (float)] [z-angle (float)]
Sets the current rotation (which in Jitter is expressed in angle/axis format) to the concatenation of rotations about the positive x, y, and z axes (in that order). Angles are expressed in degrees.

Example:

See Also:
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