I need to aproximate an ellipse using ogl primitives. Also i need to draw it rotated without using glRotatef. Thanks.

Originally from Mancha (http://www.opengl.org/discussion_boards/ubb/Forum2/HTML/009191.html)

glBegin( GL_LINE_STRIP );

Segments=10.f;

for( float angle = 0.0f; angle <= (2.0fPI); angle += (2.fPI/Segments){

x = cos(angle)*XRadius;

y = sin(angle)*YRadius;

glVertex3f( x, y, 0);

}

glEnd();

edit:

Segments are the number of lines that’ll approximate the ellipse;

XRadius/YRadius are the radius you want for both the axis (if both are 1, you’ll have a circle with radius 1)

[This message has been edited by t0y (edited 07-14-2002).]