Rendering Spheres glutSolidSphere and glutWireSphere using GLUT in C – A sample program

GLUT provides function glutSolidSphere to render a Solid Sphere and glutWireSphere to render a Wire Frame Sphere. They Render the spheres centered at the modeling coordinates origin of the specified radii. The sphere is subdivided around the Z axis into slices and along the Z axis into stacks. Here are the syntax of both the above functions

void glutSolidSphere (GLdouble radius, GLint slices, GLint stacks);

void glutWireSphere (GLdouble radius, GLint slices, GLint stacks);

Where, radius –> The radius of the spheres, slices –> The number of subdivision around the Z-axis and stacks –> The number of subdivisions along the Z-axis.

Source Code

Output

GLUTSpheres

SHARE Rendering Spheres glutSolidSphere and glutWireSphere using GLUT in C – A sample program

You may also like...

3 Responses

  1. Anonymous says:

    sir, can u please post the opengl c source code of Lunar phases?

  2. anonymous says:

    thanks a lot for the code

  3. anonymous says:

    thanks a lot for the code

Leave a Reply

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

Share