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

light(oscar) Animation light(oscar)

NAME

light - abstract light source class for LYMB

DESCRIPTION

Light implements a simple point light source.

SUPERCLASS

rendering_primitive

INSTANCE VARIABLES

position is the position of the light in 3-space.

focal_point is the point at which the light is aimed.

intensity is the brightness of the light.

color is the color of the light.

status indicates whether or not the light is turned on.

MESSAGES

position= (x,y,z) sets the position of the light.

position? returns the light's position.

focal_point= (x,y,z) sets the focal point of the light.

focal_point? returns the light's focal point.

color= (r,g,b) sets the color of the light.

color? returns the light's color.

intensity=i sets the intensity of the light (max of 1).

intensity? returns the light's intensity.

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

camera, gl_light, renderer


Please send comments and suggestions to
consult@rpi.edu