I draw a 3-D model and want to highlight some corner points by drawing a disk on each of these points. The following is my drawing routine. But the thing is that a 3rd party always draw its disks on the top of my disks. I clear buffer before rendering. So I think it must render its disks after mine. I cannot change the order so that make my rendering after its. Is there a solution? Please advise. Thanks.
// Draw a disk on a point located in x3D
if (gluProject(x3D, x3D, x3D,
mvMax, projMat, viewport,
&x, &x, &x) == GL_FALSE)
gluOrtho2D (0.0, viewport, 0.0, viewport);
glTranslated(x, x, 0.);
So your problem is that you draw and then this “3D party” draws after and draws over your stuff? Are you sure this is the case? Have you tried just clearing the frame buffer (and then disabling your draw) to see if the 3D party is in fact drawing these disks?
If so, it is really hard to give suggestions without some more information. Why not just disable the 3D party draw? Do you need it for something? Other than that it is going to be difficult to prevent it from drawing over your stuff.
You could try calling…
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
after your draw routine which will disable writing to the frame buffer. However if you need any of the information drawn by this 3D party then this won’t work (it also won’t work if the 3D party makes the same call using GL_TRUE before drawing).
Thanks for your reply.
I’m sure the 3rd party renders the disks over mine. Actually, their disks are ok except for only one color. My project is to draw disks with different colors over their disks. There is no way for me to change the order between my rendering and its. I guess the current order may be that it renders the model first, then passes control to me for rendering, then it finally renders the disks for highlighting. It’s just my guess.