Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

knight

OpenGL Drawing in OpenGL

This topic is 5962 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I am new in OpenGL Programming and I have only gone through some of the NeHe Tutorials(currently 11). What i want to know is that is there any tutorial(s) that teaches how to construct arcs and circles in OpenGL. Does anyone know what is the dimension of the window/display at different zoom level? Thanks Edited by - knight on March 19, 2002 3:54:10 AM

Share this post


Link to post
Share on other sites
Advertisement
Zoom level? What are you asking about? Being the programmer of the app, you are the one who sets the dimensions of the screen, so I would assume you already know... Unless I am reading the question wrong.

Oh well,
Landsknecht

Share this post


Link to post
Share on other sites
knight: about that zoom..?! you should have know that or you did not read tutorials enough deep and also understand them so that you could make same thing now without help.

circles, red book has a piece of code about them, this will more or less be copied from there:
----------------

#define PI 3.14159265
#define circle_points 100

GLint angle;

glBegin(GL_LINE_LOOP);
for (int i=0; i{
angle=2*PI*i/circle_points;
glVertex2f(cos(angle),sin(angle));
}
----------------


[edited by - kren on March 19, 2002 3:05:25 PM]

Share this post


Link to post
Share on other sites
Thanks anyway
Regarding the zoom, what i meant was that if
for example i use glTranslate(0.0f,0.0f,-0.5f), There are more spaces available than using glTranslate(0.0f,0.0f,0.0f) so how is this space calculated?
Are there any online tutorials for ARC and CIRCLES?
Thanks for your help

[edited by - knight on March 19, 2002 8:41:36 PM]

Share this post


Link to post
Share on other sites
Thanks Kren
But what I want is just a simple circle ... I don''t want a circle that is made up of polygons and there an error in the for loop so what should the i variable be limited to?
Is the simple circle possible?

Share this post


Link to post
Share on other sites
no. there are no circles. what do you need if for? HUD? you can draw a circle to a texture and render the texture in ortho projection. if you need to know how to draw a circle, look up bresenham''s circle algorithm.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!