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 cube 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 cube's vertices. This is used by the inherited "bounding_box?" method.
cube_modeller new: cube_model;
actor new: cube modeller=cube_model scale=(1,0.7,1.3) ;
The following LYMB script uses the "vertices=" message to set the cube's geometry directly. This demonstrates how the bounding box of a model can be easily turned into another model. Note that in the first cube_modeller instance, the vertices are obtained from the bounding box of the byu model, while in the second case they are obtained from the actor. Thus, the modelling_coords_box will be displayed in the modelling coordinates of the shuttle model, while the world_coords_model will be displayed around the shuttle.
byu new: shuttle_model geometry_file="shuttle.g" ; actor new: shuttle modeller=shuttle_model scale=0.5 position=(-10,4,20) rotate_y:30 ;
cube_modeller new: bbox_mc_model vertices=[shuttle_model bounding_box?] ; actor new: modelling_coords_box modeller=bbox_mc_model ;
cube_modeller new: bbox_wc_model vertices=[shuttle bounding_box?] ; actor new: world_coords_box modeller=bbox_wc_model ;