num_triangles = 2 * 4 ^ resolution
A value of 3 or 4 for resolution gives a decent approximation.
num_triangles The number of triangles in the sphere geometry.
radius The radius of the sphere.
resolution_cap Because the number of triangles can grow so rapidly, the resolution_cap instance variable limits the resolution. If the resolution is greater than the resolution_cap, a warning message is dispalyed and the resolution is restricted to the value of the resolution_cap. It can, of course, be set higher. The default value is 7.
num_triangles? Get the number of triangles. Like num_vertices, this value should not be set since it is computed by the sphere_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 sphere 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 sphere's vertices. This is used by the inherited "bounding_box?" method.
calculate! Recomputes all the vertices and triangles of the sphere according to the current value of "resolution", an inherited variable.
radius[=?] Sets/Gets the radius of the sphere. message.
reslution_cap[=?] Sets/Gets the resolution cap of the sphere. message.
sphere_modeller new: sphere_model1;
sphere_modeller new: sphere_model2 resolution=4 scale=(1.5, 0.7, 1.0) ;
actor new: rough_sphere modeller=sphere_model1 ;
actor new: smooth_egg modeller=sphere_model2 ;