This demo displays an Approximated Sphere using set polygons defined by lines of longitude and latitude. We could use either quad strips or triangle strips for Sphere Approximation. We can describe it by following three equations:-




The sphere would be rotated by clicking the left mouse button or right mouse button. By clicking the right mouse button we obtain circles of constant longitude. Similarly we obtain circles of constant latitude by clicking left mouse button. The size of the sphere could be varied using middle mouse button.

Sphere Approximation with Quadrilaterals

If we fix θ and draw curves as we change Ф, we get circles of constant longitude. Similarly if we fix Ф and vary θ we obtain circles of constant latitude by generating points at fixed increments of θ and Ф we can define quadrilaterals.

However we may encounter a problem at poles where we can no longer use strips because all lines of longitude converge there. We can however use two triangle fans at each pole.

Some of the most common built-in functions are:-

glMatrix Mode:  specifies which matrix is current matrix.

glEnable  : enables or specifies symbolic constants indicating gl capability.

glClear  : clears buffer to present value.

glutInit  : initializes GLUT libraries.

glutMainLoop : enters glut unit processing loop.



Minimum hardware specification

  • Processor                          : AMD processor
  • Main memory : 512 MB RAM
  • Hard Disk                        : 40 GB


Minimum software specification

  • Operating system             : Windows
  • Visual C++
  • OPENGL Library


Mouse Buttons:- 

Left button                    –        For constant latitude rotation 

Right button        –        For constant longitude rotation 

Middle button     –        To vary the size of the sphere


  • Adding Texture to Sphere

We can add various texture to the sphere, so that we can simulate a globe.

  • Adding Light Source to the sphere

We can add Light Source to the Sphere to give the appearance of depth and illusion of 3D object will be more precise.

  • Change of Object

To approximate Geometrical surfaces such as cube, polygon etc.


The project “Approximation of Sphere” was designed and implemented by solely by its creators as the exercise of “Computer Graphics and Visualization” Laboratory. The concepts used in the design are that of our own, but certain referrals were made to my lecturers and others regarding some technical issues.  More features to make it a competitive. . Further work on projects like this would enable greater knowledge and prowess in approximation of geometrical objects in OpenGL. This project has laid the groundwork for bigger undertaking in the future.