Solved

Drawing circles in OpenGL

Posted on 1998-04-07
4
2,500 Views
Last Modified: 2013-12-03
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
Comment
Question by:Pacman
  • 3
4 Comments
 
LVL 10

Accepted Solution

by:
RONSLOW earned 100 total points
ID: 1412591
gluDisk

0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1412592
or gluCylinder

0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1412593
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
 
LVL 9

Author Comment

by:Pacman
ID: 1412594
It works. Thank you.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question