Hi Gang,
Need some clarification on how Depth Buffering works in the case where the Z values for two objects being drawn are the same value. Does the object being drawn second go on top of the object drawn first? When I tried to test this situation, it looked like the two objects “blended” together, with the second object intersecting the first object in some spots. Is there w way that I can get the second object to lay directly on top of the first (without using a offset for the Z axis)?
For instance my first object it a Sphere (actually a globe) and I am trying to draw a lat/lon grid on top of the globe, but I don’t want any space between the globe and the lat/lon grid.
so this is what I do (in theory - not real code!)
glEnable(GL_DEPTH_TEST);
gluSphere(globe_, globeRadius, 48, 48);
// Draw Lat/Lon takes in a radius value
drawLatLon(globeRadius);
Like I said earlier - keeping the radius of both objects the same seems to make the objects blend together, with the lat/lon grid intersecting through the globe in some areas.
if I do the following, I solve the intersecting problem, but the lat/lon grid seems to “float” above the globe (i.e. you can see a space between the grid and the globe).
glEnable(GL_DEPTH_TEST);
gluSphere(globe_, globeRadius, 48, 48);
// Draw Lat/Lon takes in a radius value
drawLatLon(globeRadius + 0.1);
Any ideas? Comments?
Thanks
Roach