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

Plane_modeller(modeller) LYMB Plane_modeller(modeller)

NAME

plane_modeller - create a nxm regular array of polygons

DESCRIPTION

The plane_modeller object creates a geometric representation of a plane. The plane is represented as a regular nxm array of polygons, where n and m are specified as the x and y resolution of the plane_modeller.

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

Plane modeller is often used as a source input to the data_probe (or equivalent) object, or to create a polygon used for walls, flooring, etc.

SUPERCLASS

new_modeller

INSTANCE VARIABLES

resolution a 2-element vector indicating the number of polygons used to represent the plane. The first component is the number of polygons along the x axis, the second the number along the y axis. If either value is less than or equal to 1, then a single polygon is generated along the respective axis.

MESSAGES

resolution= (x,y) Set the x resolution of the modeller to x and the y resolution to y.

resolution= value Set the x and y resolutions of the modeller to value.

resolution? Get the resolution of the modeller.

EXAMPLES

The following LYMB script uses the plane modeller to create a tile floor. /* * Create tile floor using plane modeller and shrink filter. The * shrink filter is necessary because the plane modeller creates * polygons that share vertices. Hence, the shading will look weird. * The shrink filter breaks the polygons up to get distic0t tile * color. */ plane_modeller new: plane

resolution=9 ; shrink_filter new: shrink data_in= plane shrink_factor=1.0 ;

display_data new: color_floor scalars=(0,0,0,0,1,1,1,1) ; merge_filter new: merge_floor_and_color data_in= shrink scalars_data_in=color_floor ;

display_all new: draw_floor data_in=merge_floor_and_color range=(0,1) ; actor new: floor modeller= draw_floor ; /* * Rendering stuff */ camera new: c1 x_range=(0,1) y_range=(0,1) 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


Please send comments and suggestions to
consult@rpi.edu