PDA

View Full Version : how to draw a 3d ellipse!



jackhsw
06-01-2004, 12:28 AM
I know draw 2d ellipse,but I don't know how to draw 3d ellipse

dvm
06-01-2004, 12:40 AM
How do you want to draw it exatly? I'm used to thinking of an ellipse as a 2-d scheme! But for any 3-d geometric surface rendering I think you should look at meshes and nurbs. A link I found on google which is from the red book is this: opengl & nurbs (http://fly.cc.fer.hr/~unreal/theredbook/chapter11.html) . I think it should take care of your questions (the problem would be to define the points now.) Good luck!

mikael_aronsson
06-01-2004, 03:45 AM
Hi !

If you do mean a true 2D ellipse in 3D world, then you just use glRotate/glScale/glTranslate to transform it in 3D.

If you mean an ellipsoid, have a peek at the glu source code (mesa or the SGI sample implementation), there you can see how it is done.

Just do a sphere and use glScale to transform it to an ellipsoid.

Mikael