libsphere(3L)
libsphere - the Sphere Library
As shipped in IRIX 6.5.30. Unchanged since IRIX 6.5.
NAME libsphere - the Sphere Library SYNOPSIS #include <gl/fsphere.h> intger*4 function sphdra(params) real params(4); integer*4 sphgnp() subroutine sphfre() integer*4 function sphmode(attribute, value) integer*4 attribute, value; subroutine sphobj(objid) integer*4 objid; subroutine sphrma(mat) real mat(4,4); subroutine sphbbp(void) subroutine sphebp(void) subroutine sphclr(clr) real clr(4); DESCRIPTION The Sphere Library renders spheres by issuing GL calls. sphdra draws a sphere. sphmod sets various attributes that affect the speed and quality of spheres rendered by sphdra. sphrma allows you to control the orientation of spheres by providing a rotation matrix. sphgnp returns the number of polygons per sphere, in the mode currently selected by sphmod. sphobj operates like sphdra, except that, instead of immediately rendering a sphere, it creates and returns a GL object, which can be rendered using callob. The routines sphbbp and sphebp are for drawing collections of spheres using a special bitmap image of a phong- shaded sphere. The diffuse color of the bitmap spheres are set with the routine sphclr. USAGE To link a program with libsphere, specify -lsphere on the compile line. When linking a program with libsphere, you must also specify the Graphics Library, -lfgl -lgl_s, and the Math Library, -lm. CAVEAT In the current implementation, the Sphere Library maintains an internal cache of GL objects, one for each combination of sphere attributes for which sphdra or sphobj has been called. The first call to sphdra, or sphobj, with a combination of attributes that has not yet been rendered will result in the creation of a new GL object and, thus, will take longer than subsequent calls with the same combination of sphere attributes. If your program uses the Sphere Library and also manipulates its own GL objects, you must be careful that your allocation of object identifiers does not conflict with the Sphere Library's allocation of object identifiers for its internal cache. The Sphere Library calls genobj for its object identifier allocation. If your program allocates object identifiers for its own use, you should either use genobj to allocate object identifiers or use isobj to verify that any object identifiers your program generates are not already being used by the Sphere Library. See makeob(3g) and genobj(3g) for further discussion of object identifiers. If you need to free the virtual memory used by the Sphere Library's internal cache, you can call sphfre to free all its GL objects and their associated memory. SEE ALSO sphdra, sphgnp, sphfre, sphmod, sphobj, sphrma, sphbbp, sphebp, sphclr