All pastes #994812 Raw Edit

Untitled

public text v1 · immutable
#994812 ·published 2008-04-23 17:56 UTC
rendered paste body
 glPushMatrix ();

     glTranslatef (w->attrib.x + (w->width / 2), w->attrib.y + (w->height / 2), 0.0);

     if (w->width < w->height)
	glScalef (w->width, w->width, 1.0 / ((float)s->width / (float)w->width));
     else
        glScalef (w->height, w->height, 1.0 / ((float)s->height / (float)w->height));

     // Draw a circle here with radius 0.5
     glBegin (GL_LINE_LOOP);
     glVertex3f (-0.5, 0.5, 0.0);
     glVertex3f (-0.5, -0.5, 0.0);
     glVertex3f (0.5, -0.5, 0.0);
     glVertex3f (0.5, 0.5, 0.0);
     glEnd ();

     glPushMatrix ();
     glRotatef (90.0, 1.0, 0.0, 0.0);

     glBegin (GL_LINE_LOOP);
     glVertex3f (-0.5, 0.5, 0.0);
     glVertex3f (-0.5, -0.5, 0.0);
     glVertex3f (0.5, -0.5, 0.0);
     glVertex3f (0.5, 0.5, 0.0);
     glEnd ();

     glPopMatrix ();
     glRotatef (90.0, 0.0, 1.0, 0.0);

     glBegin (GL_LINE_LOOP);
     glVertex3f (-0.5, 0.5, 0.0);
     glVertex3f (-0.5, -0.5, 0.0);
     glVertex3f (0.5, -0.5, 0.0);
     glVertex3f (0.5, 0.5, 0.0);
     glEnd ();

   glPopMatrix ();