Solved

Drawing circles in OpenGL

Posted on 1998-04-07
4
2,473 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now