PDA

View Full Version : Rotate an ellipse



Ziggurat
03-25-2002, 02:47 PM
I need to rotate an ellipse, my code to draw it is:

double const TWO_PI = 6.2831853071795865;
int const NSTEPS = 100;
double t = 0;
glBegin( GL_LINE_LOOP );
for ( int i = 0; i < NSTEPS; ++i )
{
glVertex2d( 0.5 * cos( t ), 0.5 * sin( t ) );
t += TWO_PI / NSTEPS;
}
glEnd();


Now, how do i rotate it???

Jeeeez
03-25-2002, 03:30 PM
Check the function glRotate...

chxfryer
03-25-2002, 03:30 PM
does glRotatef not work?

Jambolo
03-27-2002, 12:40 AM
In anticipation of your next problem... Since the scale values for both X and Y are .5, you are going to get a circle with a radius of .5 and rotating it will do nothing, of course.