I need to aproximate an ellipse using ogl primitives. Also i need to draw it rotated without using glRotatef. Thanks.
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_boa...ML/009191.html)
edit:Code :glBegin( GL_LINE_STRIP ); Segments=10.f; for( float angle = 0.0f; angle <= (2.0f*PI); angle += (2.f*PI/Segments){ x = cos(angle)*XRadius; y = sin(angle)*YRadius; glVertex3f( x, y, 0); } glEnd();
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).]