Accessing Triangles when using glut function


I want to change the shape of the sphere when I use,

which is available in glut.

So, how can I access the triangles in this object?

Are there any existing deformable object libraries in opengl community?

Thanks in advance,

Janaka Prabhash

How do you want to deform the sphere? You can certainly modify the modelview matrix before drawing the sphere (scale it, rotate it).

The only flat polygon you will get is by using glutSolidSphere(radius,2,2)
which means 2 stacks and 2 slices(this is a bare minimum condition).

with this call you will get a rhombus.

however if you want something close to a triangle you might want to try with 3 stacks and 2 slices or vice versa, in which case the result will be a tetrahedron.

I’m writing a new tutorial for beginners to OpenGL programming do visit it