# Thread: How to solve the "sawtooth" shape?

1. ## 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

-SirKnight

3. ## Re: How to solve the "sawtooth" shape?

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

4. ## Re: How to solve the "sawtooth" shape?

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

5. ## Re: How to solve the "sawtooth" shape?

Originally posted by Zeno:

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
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?

6. ## Re: How to solve the "sawtooth" shape?

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).]

7. ## Re: How to solve the "sawtooth" shape?

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

8. ## Re: How to solve the "sawtooth" shape?

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).]

9. ## Re: How to solve the "sawtooth" shape?

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

-SirKnight

10. ## Re: How to solve the "sawtooth" shape?

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

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•