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

Line_modeller(modeller) LYMB Line_modeller(modeller)

NAME

line_modeller - create a straight line of n+1 points

DESCRIPTION

The line_modeller object creates a geometric representation of a line. The line is represented as a straight line defined by n+1 points, where n is the resolution of the line_modeller. Line_modeller also creates scalars (corresponding to line length) and texture coordinates.

Because the line_modeller is a subclass of new_modeller, it responds to the "data?" message and can be used in the display_data pipeline. In addition, line_modeller also inherits the convenience routines from new_modeller (e.g., output!).

Line modeller is often used as a source input to the data_probe or data_streamer objects.

SUPERCLASS

new_modeller

INSTANCE VARIABLES

point1 the first point defining the line. By default point1=(0,0,0).

point2 the second point defining the line. By default point2=(1,0,0).

resolution the number of line segments used to represent the line. Equivalently, resolution+1 points are used to define the straight line. If resolution <=1, a line defined by two points is created.

MESSAGES

point1= (x,y,z) specify the first point defining the line.

point1? get the coordinates of the first point defining the line.

point2= (x,y,z) specify the second point defining the line.

point2? get the coordinates of the second point defining the line.

resolution= value Set the resolution of the modeller.

resolution? Get the resolution of the modeller.

EXAMPLES

The following LYMB script uses the line modeller and shrink_filter to create a dotted line.

/* * Create a dashed line using the line_modeller and shrink_filter. */ line_modeller new: line resolution=9 ; shrink_filter new: shrink data_in= line shrink_factor=0.5 ;

display_all new: draw_line data_in=shrink range=(0,1) ; actor new: dashed_line modeller= draw_line ; /* * Rendering stuff */ camera new: c1 x_range=(0,1) y_range=(0,0) z_range=(0,0) position=(1,1,1) default! on! ;

environment new: _env variable=`LYMB_RENDERER' ; object# [_env value?] new: aren actors=[actor instances?] cameras=c1 render! ;

SEE ALSO

new_modeller, modeller, display_data, display_filter, shrink_filter, byu, actor, renderer


Please send comments and suggestions to
consult@rpi.edu