PDA

View Full Version : Accessing Triangles when using glut function



Janaka Prabhash
06-01-2009, 12:58 PM
Hi,

I want to change the shape of the sphere when I use,
glutSolidSphere()

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

todayman
06-06-2009, 07:53 PM
How do you want to deform the sphere? You can certainly modify the modelview matrix before drawing the sphere (scale it, rotate it).

Optik
06-07-2009, 10:22 AM
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