Pacman
asked on
Drawing circles in OpenGL
I need to draw circles using OpenGL with Windows NT. The drawing routing should be very fast.
The frame-code is:
glViewport(0, 0, w, h);
glLoadIdentity();
glOrtho(xmin, xmax, ymin, ymax, 1.0f, -1.0f);
glInitNames();
glPushName(1);
glIndexi(0);
glRectf( DirtyRect.GetX1(), DirtyRect.GetY1(), DirtyRect.GetX2(), DirtyRect.GetY2() );
// 1. paint here something
// 2. now paint a circle at, say (45.4 / -12.2 with radius 4.34)
// BUT HOW ????
glFlush();
Does anybody know a good algorithm or possibility in OpenGL ?
(P.S.: no solid circles needed).
The frame-code is:
glViewport(0, 0, w, h);
glLoadIdentity();
glOrtho(xmin, xmax, ymin, ymax, 1.0f, -1.0f);
glInitNames();
glPushName(1);
glIndexi(0);
glRectf( DirtyRect.GetX1(), DirtyRect.GetY1(), DirtyRect.GetX2(), DirtyRect.GetY2() );
// 1. paint here something
// 2. now paint a circle at, say (45.4 / -12.2 with radius 4.34)
// BUT HOW ????
glFlush();
Does anybody know a good algorithm or possibility in OpenGL ?
(P.S.: no solid circles needed).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or gluCylinder
If you don't want to use these directly, then you can get the source code for either of these routines and see how they generate the coordinates for the circle
ASKER
It works. Thank you.