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

actor(oscar) Animation actor(oscar)

NAME

actor - an actor

SYNOPSIS

actor new: name;

DESCRIPTION

An actor is an object that defines the transformations, properties and models for a geometric object that can be rendered with a renderer. A compound transformation for each actor is calculated as follows: [x y z 1] = [x y z 1] T(-origin) S(scale) R(y) R(x) R(z) T(origin) T(position) where T is a translation, S a scale and R a rotation matrix.

Many messages understood by actors are actually delegated to internal property objects. Those messages are mentioned here, but the reader should refer to the manual page for the property object for a complete description. NOTE: an actor will create a property if it receives a delegated property message and its property instance variable is empty. Otherwise it forwards the delegated messages to the property named by the actor. This indirectly results in changes to the instance variables to the named property.

SUPERCLASS

object

INSTANCE VARIABLES

position is the x,y,z position of the actor. Position is specified in world coordinates.

origin is the x,y,z origin of the actor. Scaling and rotation are performed about this point.

orientation is the x,y,z orientation in degrees of the actor. Orientation is normally not set directly, but rather through the

property is the name of a property object that contains appearance attributes for the actor. These properties are applied to bith the front and back faces of an actor's polygons unless backface_property is specified, then they only apply to the front faces.

visible boolean indicates whether actor is visible or not.

pickable boolean indicates whether actor can be picked in picking operations.

dragable boolean indicates whether actor can be dragged, using the interactive_renderer after being picked.

backface_property is the name of a property object that contains appearance attributes for the backfaces of an actor's polygons.

rotate_x: , rotate_y: , and rotate_z: messages. Orientation angles are applied in the order y, x, z.

scale is the scale factors for x,y,z. Scaling is done about the origin before any rotations.

MESSAGES

Although not mentioned explicitly, for each set message (such as ambient=), there is a corresponding get message (e.g., ambient?).

ambient[=+] amount Delegated to property.

ambient_color[=+] (r,g,b) Delegated to property.

bounding_box? returns the bounding box of the actor as eight (x,y,z) coordinates.

bounds? returns the bounding box of the actor as (xmin,xmax, ymin,ymax, zmin,zmax).

color[=+] (r,g,b) Delegated to property.

diffuse= amount Delegated to property.

diffuse_color= (r,g,b) Delegated to property.

diffuse_color+ (r,g,b) Delegated to property.

dragable? returns non-zero value if actor is dragable.

dragable= set the dragable of the actor.

undragable! turns draging off for this actor (i.e., sets dragable=0).

dragable! turns draging on for this actor (i.e., sets dragable=1).

edge_color= (r,g,b) Delegated to property.

edge_visibility_on! Delegated to property.

edge_visibility_off! Delegated to property.

flat! Delegated to property.

gouraud! Delegated to property.

modeller= modeller_name sets the actor's modeller. Modellers define the geometry for an actor. The same modeller can be referenced by many actors, but each actor only has one modeller.

visibility? returns non-zero value if actor is visible.

visibility= set the visibility of the actor.

off! turns the actor off (i.e., sets visibility=0). If an actor is off, it will not be rendered.

on! turns the actor on (i.e., sets visibility=1). If an actor is on, it will be rendered.

pickable? returns non-zero value if actor is pickable.

pickable= set the pickable of the actor.

pickable_off! turns picking off for this actor (i.e., sets pickable=0).

pickable_on! turns picking on for this actor (i.e., sets pickable=1).

orientation= (x,y,z) sets an actor's orientation. Only the sophisticated user should use this message. Most users will find that rotate_x:, rotate_y:, rotate_z: or rotate_wxyz: are adequate.

orientation+ (x,y,z) adds (x,y,z) to an actor's orientation. Only the sophisticated user should use this message. Most users will find that rotate_x:, rotate_y:, rotate_z: or rotate_wxyz: are adequate.

origin=, origin+ (x,y,z) defines an actor's origin. Rotation and scaling are performed about this point.

phong! Delegated to property.

points! Delegated to property.

rotate_x: angle rotates the actor clockwise by angle degrees about its y axis, centered at its origin. rotate_y: angle rotates the actor clockwise by angle degrees about its y axis, centered at its origin.

rotate_z: angle rotates the actor clockwise by angle degrees about its z axis, centered at its origin.

rotate_wxyz: (angle,x,y,z) rotates the actor clockwise by angle degrees about the vector x,y,z centered at its origin.

scale= factor

scale+ factor

specular= amount Delegated to property.

specular_color= (r,g,b) Delegated to property.

specular_color+ (r,g,b) Delegated to property.

surface! Delegated to property.

texture= texture_object Delegated to property.

transparency= factor Delegated to property.

transparency+ factor Delegated to property.

wireframe! Delegated to property.

x_range? returns the x extent of the actor.

y_range? returns the y extent of the actor.

z_range? returns the z extent of the actor.

range? is a convenience message that returns the x, y, and z extents of the actor.

EXAMPLE

camera new: c1 position=(10,10,10) range=(-2,2,-2,2,-2,2) focal_point=(0,0,0) default! on! azimuth:90 ;

light new: l1 position=(5,2,3) focal_point=(1,1,1) on! ;

light new: l2 position=(0,5,0) focal_point=(-1,-1,-1) intensity=.2 color=(1,1,0) on! ;

cube_modeller new: cube_model;

actor new: cube1 color=(1,1,0) modeller=cube_model position=[l1 focal_point?] ;

actor new: cube2

color=(1,0,1) modeller=cube_model position=[l2 focal_point?] scale=(1,2,1) ;

renderer new: aren actors=[actor instances?] cameras=[camera instances?] lights=[light instances?] background=(.8,.8,.8) ;

aren render!;

SEE ALSO

person, follower, modeller, renderer, property, texture, transform


Please send comments and suggestions to
consult@rpi.edu