jit.world Reference

The Jitter world context

jit.world

Description

The jit.world object encapsulates the functionality of several jitter objects, including jit.window, jit.gl.render, jit.gl.node, jit.gl.cornerpin and jit.phys.world. Physics and GL objects are automatically added to the jit.world context and video objects have their automatic output enabled, when in the same patch.

Examples

jit.world

Arguments

None.

Attributes

border [int]

Show window border (default = 1).

auto_handle [int]

Enable auto-handle mode on the internal jit.gl.handle object (default = 0).

enable [int]

Enable automatic rendering (default = 0). When enabled, rendering is performed automatically.

dim [2 ints]

Internal texture dimensions (default = 640 x 480). This attribute is set only if the desired texture output dimensions should differ from the window size. If no arguments are given, the texture dimensions will adapt to the window size.

Enable render draw sync to display swap (default = 1) (Mac only). When enabled, render draw calls are synced to the display swap.

drawbang [symbol]

The draw bang output timing (default = prerender). Determines if the middle-outlet draw bang happens before or after rendering.

Possible values:

'prerender' ( Before rendering )
'postrender' ( After rendering )

drawto [symbol]

The internal jit.gl.render context name (default = UID). jit.world drawto is the parent context of the internal jit.gl.node sub-context.

capture [int]

Capture to the internal texture (default = 0). When enabled, all rendering is captured to texture and the texture name is output out the left outlet. The texture is also drawn to the internal jit.gl.cornerpin for display on the window. Synonym for output_texture.

floating [int]

Enable floating window style (default = 0).

fps [float]

The frames per second of automatic rendering (default = 30). Setting fps also sets interval. These attributes only have an effect if enable is 1 and displaylink is 0.

fsaa [int]

Enable full scene anti-aliasing (default = 0).

fsmenubar [int]

Enable menubar in fullscreen (default = 1).

fullscreen [int]

Enable fullscreen (default = 0).

enable_cornerpin [int]

Enable the internal jit.gl.cornerpin object (default = 0). When enabled the cornerpin's handles are visible, and mouse handler is enabled. Enabling also sets output_texture to 1. Attributes and messages of the cornerpin can be sent using sendcornerpin.

erase_color [4 floats]

Background and clear color as RGBA values (default = 0.2 0.2 0.2 1.0).

esc_fullscreen [int]

When enabled, the escape key sends the window to fullscreen (default = 1).

interval [int]

The millisecond interval of automatic rendering (default = 33). Setting interval also sets fps. These attributes only have an effect if enable is 1 and displaylink is 0.

high_res [int]

Enable high resolution accelerated drawing on supported high DPI Retina devices (default = 0) (Mac only).

matrix_mode_async [int]8.0.0

Enable asynchronous matrix output (default = 1). When enabled jit.world will use the more CPU efficient asynchronous code path for matrix output. Disable if synchronous output is desired.

output_matrix [int]

Output the scene as a matrix (default = 0). When enabled, all rendering is captured to texture then read back to an internal matrix, and the matrix name is output out the left outlet. The texture is also drawn to the internal jit.gl.cornerpin for display on the window.

output_texture [int]

Capture to the internal texture (default = 0). When enabled, all rendering is captured to texture and the texture name is output out the left outlet. The texture is also drawn to the internal jit.gl.cornerpin for display on the window. Synonym for capture.

name [symbol]

The drawing context name (default = UID). Jitter GL objects attach to this context through their drawto attribute. The jit.world name is actually the internal jit.gl.node sub-context name.

phys_worldname [symbol]

The internal jit.phys.world physics world name (default = UID).

position [3 floats]

The 3D origin in the form x y z (default = 0. 0. 0.). This attribute sets the internal jit.gl.node position.

ortho [int]

Orthographic projection mode (default = 0)
0 = orthographic projection off (perspective projection)
1 = orthographic projection on, using lens angle
2 = orthographic projection on, ignoring lens angle

Possible values:

0 = 'Off (Perspective)'
1 = 'Orthographic (Lens Angle)'
2 = 'Orthographic (No Lens Angle)'

preserve_aspect [int]

Preserve aspect ratio flag of input image (default = 1)

size [2 ints]

Window size (default = 640 480)

rect [4 ints]

The window rectangle is specified in pixels giving the left, top, right, and bottom coordinates of the window from the upper left corner.

shared [int]

Sets the window as a shared OpenGL context (default = 0).

sync [int]

The vertical sync flag sets the window to update synchronous to the monitor's refresh (default = 1).

rotate [4 floats]

The angle of rotation and the three axes about which the rotation is performed in the form rotation-angle x y z (default = 0. 0. 1. 0.). This attribute sets the internal jit.gl.node rotate.

quat [4 floats]

Specifies a quaternion orientation in 3D space (default = 0 0 0 1). This attribute sets the internal jit.gl.node quat.

rotatexyz [3 floats]

Specifies an Euler orientation in 3D space (default = 0 0 0). This attribute sets the internal jit.gl.node rotatexyz.

scale [3 floats]

The 3D scaling factor in the form x y z (default = 1. 1. 1.). This attribute sets the internal jit.gl.node scale.

windowposition [2 ints]

Window position is specified in pixels by an x and y offset value in global coordinates from the upper left corner of the screen.

visible [int]

Enable window visibility (default = 1).

Common Box Attributes

Messages

bang

Draw and update all automatic clients and animations. Should only be called if enable is 0.

int

Set the enable attribute. When enabled frame updates are handled automatically.

clear

Clear the matrix or texture image from the background, replacing with the erase_color.

(mouse)

Mouse events and double-click to bring window to front.

draw

Draw and update all automatic clients and animations. Should only be called if enable is 0.

front

Bring window to front.

jit_gl_texture

Arguments

texture-name [symbol]
Draw the named texture to the background.

sendcornerpin

Arguments

message [symbol]
values [list]
Sends messages to the internal jit.gl.cornerpin object.

sendhandle

Arguments

message [symbol]
values [list]
Sends messages to the internal jit.gl.handle object.

sendnode

Arguments

message [symbol]
values [list]
Sends messages to the internal jit.gl.node object.

sendphys

Arguments

message [symbol]
values [list]
Sends messages to the internal jit.phys.world object.

sendrender

Arguments

message [symbol]
values [list]
Sends messages to the internal jit.gl.render object.

sendwindow

Arguments

message [symbol]
values [list]
Sends messages to the internal jit.window object.

See Also

Name Description
Working with OpenGL Working with OpenGL
Video and Graphics Programming Tutorials Video and Graphics Programming Tutorials
jit.window
jit.gl.render
jit.gl.node
jit.gl.cornerpin
jit.phys.world