<<<<<<<<<<<<<<<<<

scene(oscar) Animation scene(oscar)

NAME

scene

SUPERCLASS

loop

DESCRIPTION

Scene is a subclass of loop specialized for coordinating the various cues, renderers, and recording devices necessary for producing animations. Each pass of the loop, all scene tick actions are performed, then all cues associated with the scene receive "tick!" messages, all renderers associated with the scene receive "render!" messages, and all recorders associated with the scene receive "tick!" messages, in that order. If a scene's duration is zero when it receives a "start!", the scene calculates a duration from the aggregation of its cues' durations.

Upon scene termination, the scene's end_actions are executed, then all renderers are sent a "complete!" message.

INSTANCE VARIABLES

cues is the list of cue objects associated with the scene.

renderers is the list of renderers associated with the scene.

recorders is the list of recorder-like objects (for instance, the minivas object) associated with the scene.

MESSAGES

reset! is forwarded to all cues.

EXAMPLE

cue resolution= 1; scene resolution= 1;

<../x/colors <../x/xinit

xset_window_attributes new: wa1 background_pixel=gray backing_store=Always ;

xwindow new: w1 width=500 height=500 xset_window_attributes=wa1 gc=gc1 map!

;

xgc new: gc1 drawable=w1 foreground=aquamarine change! ;

xgc new: gc2 drawable=w1 foreground=pink change! ;

scalar new: x = 0.0; scalar new: y = 0.0; scalar new: radius = 100; scalar new: x_center = 100; scalar new: y_center = 100; scalar new: theta = 0.0; scalar new: delta = 20; scalar new: last_x = 0.0; scalar new: last_y = 0.0;

cue new: moveit duration=180 tick_actions=" x_center + 1; y_center + 1; " ;

cue new: drawit duration=180 start_actions=" theta = delta * -1; last_x = [theta sin?] * radius + x_center; last_y = [theta cos?] * radius + y_center; " tick_actions=" theta + delta; x = [theta sin?] * radius + x_center; y = [theta cos?] * radius + y_center; w1 draw_line: (last_x, last_y, x, y); last_x = x; last_y = y; " ;

/* We can't draw into the window until it is

mapped, so let's prompt the user. */

prompter new: aprompter prompt= "Please press return when X window is mapped...." ask? ;

scene new: ascene cues=(moveit, drawit) start! ;

/* make sure that the X buffer gets to the server so we'll see

the output */ xdisplay flush!;

SEE ALSO

loop, minivas, cue, renderer


Please send comments and suggestions to
consult@rpi.edu