PDA

View Full Version : Ellipsoid. How?



jrbcast
09-01-2001, 01:02 PM
Hi

I want to make an Ellipsoid using triangle primitives but i dont know how. Does anyone know where can i find the solution please?.

Now I have made it using a glSphere and Scaling it by (xLong,yLong,zLong) where xLong, yLong and zLong are the three axis length of the ellipsoid (They can be different) but the light effects dissapear and it looks poor.

What can I do?. Thanks

ffish
09-01-2001, 06:21 PM
Lighting won't work any more because the normals are scaled too and become non-unit normals. If you want the lighting to work, you could try glEnable(GL_NORMALIZE);

Hope that helps.

Morglum
09-01-2001, 10:48 PM
Good idea, but GL_NORMALIZE is very slow. If you want something faster, draw your ellipsoid yourself. To achieve this, decompose it in horizontal slices. Each slice could be drawn as a gluCylinder with Radius1 different form Radius2. Of course it would be fastest if you drew everything yourself with a vertex array...but it would be more complicated, too.

Hope that helps
Morglum

jrbcast
09-02-2001, 05:06 AM
Thakyou.

I used the aproach propossed by ffish because it works fine and I did not understand the cylinders one :-).

Bye and thanks again