• Advertisement
Sign in to follow this  

drawing something at the same position

This topic is 3492 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

i want to draw two circles at the same position like this glColor3f(1.0f, 0.0f, 0.0f); DrawCircle(10.0f); // draw a red circle with radius 10 on the x-z plane at (0, 0) glColor3f(0.0f, 1.0f, 0.0f); DrawCircle(5.0f); // draw a green circle with radius 5 on the x-z plane at (0, 0) but the green circle isn't not drawn properly how do i draw the green circle properly without disabling depth buffer?

Share this post


Link to post
Share on other sites
Advertisement
Try using polygon offset:

glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.0, 1.0); // Might have to change the values here,

glColor3f(1.0f, 0.0f, 0.0f);
DrawCircle(10.0f); // draw a red circle with radius 10 on the x-z plane at (0, 0)

glDisable(GL_POLYGON_OFFSET_FILL);


glColor3f(0.0f, 1.0f, 0.0f);
DrawCircle(5.0f); // draw a green circle with radius 5 on the x-z plane at (0, 0)


I used this when rendering a mesh and a surface simulatneously.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement