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

Cone_modeller(modeller) LYMB Cone_modeller(modeller)

NAME

cone_modeller - a geometric representation of a cone

DESCRIPTION

The cone_modeller object creates a geometric representation of a cone. Depending upon the particular value of resolution, the cone_modeller can be used to generate a single triangle, two triangles in intersection, or a full 3D representation of a cone. The 3D representation caps the cone with a n-sided polygon, unless the cap instance variable is turned off.

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

SUPERCLASS

new_modeller

INSTANCE VARIABLES

resolution the number of polygons used to represent the cone. If resolution<=1, then a single triangle is generated. If resolution=2, two rtinagles in intersection are used. If resolution>=3, then a 3D representation is created, with resolution side polygons, and a single cap polygon.

cap Whether or not to generate a cap for the base of the cone.

radius The radius of the cone. Defaults to 0.5.

height The height of the cone. Defaults to 2.0.

MESSAGES

resolution= value Set the resolution of the modeller.

resolution? Get the resolution of the modeller.

radius[=?] Set/Get the radius

height[=?] Set/Get the height

cap[=?] Set/Get cap status

cap_{on,off}! Turn the cap on and off

EXAMPLES

The following LYMB script creates three cone models, one with the default resolution of 1, the next with resolution 2, and the last with resolution 3.

/* * Create 3 cones of varying resolution */ cone_modeller new: cone_model1 resolution=1 ; actor new: triangle color=(1,0,0) modeller=cone_model1 ;

cone_modeller new: cone_model2 resolution=2 ; actor new: crossed_triangles position+ (2,0,0) color=(0,1,0) modeller=cone_model2 ;

cone_modeller new: cone_model3 resolution=3 ; actor new: three_d position+ (0,2,0) color=(0,0,1) modeller=cone_model3 ; /* * Rendering stuff */ camera new: c1 x_range=(0,5) y_range=(0,5) z_range=(0,5) 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, byu, actor, renderer


Please send comments and suggestions to
consult@rpi.edu