Skip to main content
gamedev.net
🔒 Locked

Triangle Strip Culling

Started by Christoph Oct 10, 2004 at 8:35 AM 2 replies 2.4k views
Original Post
Christoph
Christoph
Hi, a probably simple question: given is a the following vertex group: v1 v3 v5 | /| /| |/ |/ | v2 v4 v6 it is rendered using a triangle strip. I wonder why DirectX doesn't cull some of the triangles, because not all of them are clockwise. v1, v2, v3 are counterclockwise. v2, v3, v4 are clockwise. v3, v4, v5 are counterclockwise and so on... How does DirectX order the vertices in a triangle strip so that it does not have to cull away half of the triangles? thx
Namethatnobodyelsetook
Namethatnobodyelsetook
In order for stripping to work, the culling order toggles each triangle. The 1st, 3rd, 5th, etc. are one winding order. 2nd, 4th, 6th, etc. are in the opposite winding order.

Also, if you're ever calculating normals from tri-strip face data you should be aware that the normal will keep flipping.
Supernat02
Supernat02
Correct, and the first triangle defines the order. So, if you set DirectX up to cull out clockwise and start your triangle strip in a clockwise direction (by making the first triangle clockwise), the entire strip will be culled. If you make the first triangle counter-clockwise, the entire strip will be rendered.

Chris
Chris ByersMicrosoft DirectX MVP - 2005
Christoph
Christoph
ok, thanks!
I assumed something like that ;-)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.