PDA

View Full Version : How to use Depth Buffer to render triangles intersection ?



minghon
12-04-2001, 12:27 AM
Dear All:
I wantto show the intersection line segment of two triagles with Z-buffer.So First Step,rendering first triangle. Then enable Depth Test with DepthFunction GL_EQUAL. Finally, rendering second triangle. So I think it will just show the intersection line and first triangle on the screen. But it not works ??? Please ! Thanks for you help.

Bob
12-04-2001, 01:19 AM
Probably because no fragments in the second triangle matches the depth buffer. Close to the interesection, the fragment either have a depthvalue slightly less than, or slightly greater than, the value in the depthbuffer.

minghon
12-04-2001, 05:48 PM
Thanks