Link to home
Start Free TrialLog in
Avatar of Pacman
PacmanFlag for Germany

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).
ASKER CERTIFIED SOLUTION
Avatar of RONSLOW
RONSLOW

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RONSLOW
RONSLOW

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

Avatar of Pacman

ASKER

It works. Thank you.