The IRIS GL Sphere Library
OpenGL does not support the IRIS GL sphere library. You can replace your sphere library calls with quadrics routines from the GLU library. For more information about the GLU library, see the Open GL Programming Guide and OpenGL Utility Library.
The following table lists the OpenGL quadrics functions.
OpenGL function | Meaning |
---|---|
gluNewQuadric | Creates a new quadric object. |
gluDeleteQuadric | Deletes a quadric object. |
gluQuadricCallback | Associates a callback with a quadric object, for error handling. |
gluQuadricNormals | Specifies normals: no normals, one per face, or one per vertex. |
gluQuadricOrientation | Specifies direction of normals: outward or inward. |
gluQuadricTexture | Turns texture-coordinate generation on or off. |
gluQuadricDrawstyle | Specifies drawing style: polygons, lines, points, and so on. |
gluSphere | Draws a sphere. |
gluCylinder | Draws a cylinder or cone. |
gluPartialDisk | Draws an arc. |
gluDisk | Draws a circle or disk. |
You can use one quadric object for all quadrics you want to render in similar ways. The following code sample uses two quadric objects to draw four quadrics, two of them textured.
GLUquadricObj *texturedQuad, *plainQuad;
texturedQuad = gluNewQuadric(void);
gluQuadricTexture(texturedQuad, GL_TRUE);
gluQuadricOrientation(texturedQuad, GLU_OUTSIDE);
gluQuadricDrawStyle(texturedQuad, GLU_FILL);
plainQuad = gluNewQuadric(void);
gluQuadricDrawStyle(plainQuad, GLU_LINE);
glColor3f (1.0, 1.0, 1.0);
gluSphere(texturedQuad, 5.0, 20, 20);
glTranslatef(10.0, 10.0, 0.0);
gluCylinder(texturedQuad, 2.5, 5, 5, 10, 10);
glTranslatef(10.0, 10.0, 0.0);
gluDisk(plainQuad, 2.0, 5.0, 10, 10);
glTranslatef(10.0, 10.0, 0.0);
gluSphere(plainQuad, 5.0, 20, 20);
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for