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

cylinder_wedge_modeller(modeller)LYMBcylinder_wedge_modeller(modeller)

NAME

cylinder_wedge_modeller - a geometric representation of a cylinder_wedge

DESCRIPTION

The cylinder_wedge_modeller class implements a geometric representation of a cylindrical wedge. It allows the user to manipulate the wedge without seeing the details of its internal representation. The cylinder_wedge_modeller can be rendered directly on the graphics display. The default wedge has a radius and height of 1.0, and is centered at the origin. It is oriented along the y-axis. The cylinder_model is a variable resolution modeller. By default it has a very coarse approximation to a cylinder wedge, using only 3 rectangles for its sides. The resolution instance variable can be used to set the number of polygons used for the body of the cylinder. A value less than 3 results in three polygons.

SUPERCLASS

cylinder_modeller

INSTANCE VARIABLES

num_vertices The number of vertices in the cylinder_wedge geometry.

num_polygons The number of polygons in the cylinder_wedge geometry. This is just the number of polygons on the cylinder's surface plus two more for the ends of the cylinder.

phi1 The end angle of the cylinder_wedge. The wedge is the parte of the cylinder between 0 and phi1. Recall that the wedge has its center at the origin and its axis oriented along the y-axis.

MESSAGES

num_vertices? Get the number of vertices. Although the class interface allows this value to be set, it should not be since it is a value computed by the cylinder_wedge_modeller when it builds itself.

num_polygons? Get the number of polygons. Like num_vertices, this value should not be set since it is computed by the cylinder_wedge_modeller when it builds itself.

open! Sends the geomtry to the rendering primitive.

renderer_name? Returns the suffix of the class name used to draw

the model on the graphics display.

generate_data! Builds the geometric representation of the wedge required by the rendering primitive.

return_data! Returns the data built by generate_data! instead of sending it to the rendering primitive. This allows another class in the system to use this geometry.

bounds? Returns the minimum and maximum x, y and z values of the wedge's vertices. This is used by the inherited "bounding_box?" method.

calculate! Recomputes all the vertices and polygons of the wedge according to the current value of "resolution", an inherited variable.

radius= Sets the radius of the wedge by sending itself a "scale+(r,1,r)" message.

height= Sets the height of of the wedge by sending itself a "scale+(1,h,1)" message.

phi1[=?+] set/get/increment the phi1 instance variable

EXAMPLES

The following LYMB script create a cylinder_wedge model with a radius of 2 and a height of 1 (the default) and rotates a camera about it in space. NOTE: the LYMB_RENDERER environment variable must be set.

cylinder_wedge_modeller new: the_model resolution=40 phi1= 120 radius= 2 ;

actor new: the_actor color=(.2,.6,.6) modeller=the_model;

environment new: env variable="LYMB_RENDERER";

camera new: c1 position=(7,2,0)

focal_point=(0.0,0.0,0.0) view_angle=45 on!;

light new: l1 position=(10,3,6) on!;

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

aren render!;

cue new: rotate duration=100 tick_actions="c1 azimuth:2;" ;

scene new: ascene cues=rotate duration=100 renderers=aren ;

ascene start!;

aren render!;

SEE ALSO

actor, modeller, cylinder_modeller, byu, cube_modeller, hershey_text, points_modeller, polyline_modeller, sphere_modeller


Please send comments and suggestions to
consult@rpi.edu