Rendering Torus glutSolidTorus and glutWireTorus using GLUT in C

GLUT provides function glutSolidTorus to render a Solid Torus and glutWireTorus to render a Wire Frame Torus. glutSolidTorus and glutWireTorus render a solid or wireframe torus (doughnut) respectively centered at the modeling coordinates origin whose axis is aligned with the Z axis. Here are the syntax of both the above functions
 
void glutSolidTorus (GLdouble innerRadius, GLdouble outerRadius, GLint nsides, GLint rings);
void glutWireTorus (GLdouble innerRadius, GLdouble outerRadius, GLint nsides, GLint rings);
Where, innerRadius –> Inner Radius of the Torus, outerRadius –> Outer Radius of the Torus,  nsides –> Number of sides for each radial section, rings –> Number of radial divisions for torus.

Source Code

Output

GLUTTorus

SHARE Rendering Torus glutSolidTorus and glutWireTorus using GLUT in C

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Share