How to solve the "sawtooth" shape?

Hi,my teacher,

When I draw two intersection surfaces, I found that there is a visual error occured in intersection lines of the surfaces,and the shapes look like “sawtooth” from different observed angle.
How to solve this problem, or when I draw two intersection objects, I hope there is smooth in intersection.

thanks

student

I think what you’re describing is called “Z-Fighting.” Check the FAQ on this site about this.

-SirKnight

Yes, what he is describing are artifacts due to the finite precision of the depth buffer.

You can minimize these artifacts by being sure to use a 24 bit depth buffer (instead of 16 bit), but the best solution is to avoid intersecting geometry altogether.

Can you describe why this situation is coming up? Perhaps we can help eliminate it.

– Zeno

Try moving the near clip plane out as far as you can and less importantly try and bring the far clip plane in too.

Originally posted by Zeno:
[b]
You can minimize these artifacts by being sure to use a 24 bit depth buffer (instead of 16 bit), but the best solution is to avoid intersecting geometry altogether.

– Zeno[/b]

I have to draw some intersection objects.But when they are rotated, some visual errors occured at some viewing angle. It is a bad thing.
I can not draw them using polygon offset,because it seems not to ne real.

How can I do?

Zeno and dorbie already told you how.
Make the zFar/zNear ratio in your frustum as small as possible and use a depth buffer with 24 bits if you have used 16 bits so far.

[This message has been edited by Relic (edited 10-29-2002).]

You can also use the stencil buffer for this too. I seem to remember many dicussions about this kind of thing on this board.

-SirKnight

Stencil helps for coplanar surfaces but for intersections it doesn’t. You need Z precision.

When people post a question they should at least take the time to read the replies.

[This message has been edited by dorbie (edited 10-29-2002).]

Ah yes correct, I was just thinking of coplaner surfaces. Opps.

-SirKnight

Move the near clip plane as far forward as you can. The far clip plane doesn’t matter much.