Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Drawing circles in OpenGL

Posted on 1998-04-07
4
Medium Priority
?
2,535 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 10

Accepted Solution

by:
RONSLOW earned 300 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

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 …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

715 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