Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2557
  • Last Modified:

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).
0
Pacman
Asked:
Pacman
  • 3
1 Solution
 
RONSLOWCommented:
gluDisk

0
 
RONSLOWCommented:
or gluCylinder

0
 
RONSLOWCommented:
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

0
 
PacmanAuthor Commented:
It works. Thank you.
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now