Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm hoping if anyone can help me draw a simple 2d circle or hoop in openGL. I can't find any simple tutorials online and I'm just starting out with openGL. If anyone could help me find a good tutorial or lead me in the right direction I would greatly appreciate it!
Posted

Here is shown how to draw a 2D circle: 2D Drawing in OpenGL[^]. I know it is Basic4GL, however you could easily convert the circle drawing code to C++ and insert it in one of the many C++/OpenGL skeleton projects available.
 
Share this answer
 
There are many way you can draw circles in openGL Used points or just used the lines even you can wish to go with your own way.

As circle can be made from indefinite points or line use
GL_POINTS
or
GL_LINES
with changing the coordinate to radial format (polar coordinate) as

x=r*sin(theta)-h
and
y =r*cos(theta)+k
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900