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

arith_filter(display) Filter arith_filter(display)

NAME

arith_filter - perform simple arithmetic operations on entire display_data objects.

DESCRIPTION

Arith_filter allows LYMB programmers to combine display_data objects using elementary arithmetic operations (+, -, *, and /).

SUPERCLASS

display_filter

INSTANCE VARIABLES

operator is a string denoting the operation to perform.

MESSAGES

fields=(field1, field2,...) states which fields of the input operand are to be combined. The valid values are "x", "y", "z", "scalars", "vectors", and "normals".

operator=string sets the operator to string. There is a bug in the LYMB parser (as of 3/6/91) that prevents the string "-" from being used. Instead, use "- ". Only the first character of the string is considered by the generate_data method.

generate_data! causes the input operands to be processed, with output going to the display_data object named as data_out. Any fields not specified with the "fields=" message will be passed through from the first operand.

EXAMPLE

-- add the x, z, and scalar components of two cubes together -- y will be the y of the first operand

-- unit cube - scalar values are edge distances from point at origin display_data new: dd1 points=(0,0,0, 0,0,1, 0,1,1, 0,1,0, 1,0,0, 1,0,1, 1,1,1, 1,1,0) polygons=(4,1,2,3,4, 4,1,2,6,5, 4,2,3,7,6, 4,5,6,7,8, 4,1,4,8,5, 4,3,7,8,4) scalars=(0,1,2,1,1,2,3,2) ;

-- unit cube X 2 display_data new: dd2 points=(0,0,0, 0,0,2, 0,2,2, 0,2,0, 2,0,0, 2,0,2, 2,2,2, 2,2,0) polygons=(4,1,2,3,4, 4,1,2,6,5, 4,2,3,7,6, 4,5,6,7,8, 4,1,4,8,5, 4,3,7,8,4) scalars=(0,2,4,2,2,4,6,4) ;

arith_filter new:af operands=(dd1, dd2) fields=(`x',`z',`scalars') operator=`+' generate_data! ;

display_surface new: surf data_in=af range=(0,6) ;

camera new: c1 position=(10,10,10) focal_point=(1.5,0,1.5) view_up=(0,1,0) on! ;

light new: l1 position=[c1 position?] focal_point=[c1 focal_point?] on! ;

actor new: a modeller=surf origin=(1.5,0,1.5) ;

environment new: env variable="LYMB_RENDERER" ;

object # [env value?] new: ren actors=[actor instances?] cameras=[camera instances?] lights=[light instances?] render! ;

cue new: q resolution=6 duration=10 tick_actions=` c1 azimuth:6; ' ;

scene new: s resolution=[q resolution?] cues=q renderers=ren start!

;

SEE ALSO

display_filter, display_data


Please send comments and suggestions to
consult@rpi.edu