PDA

View Full Version : Does order of points in a triangle matter?



varieux
10-22-2010, 06:19 PM
I'm trying to solve a pernicious, difficult bug.

My code is splitting up triangles that are too big into smaller ones. Each triangle is split into four. Unfortunately some of the triangles that result appear gray instead of white. I'm using the two-sided triangle lighting model.

I'm beginning to notice however that when I change the order of the points within each triangle, I can get some of them to return to the normal white color. Why might this be the case?

Thanks.

Alfonse Reinheart
10-22-2010, 07:12 PM
I'm using the two-sided triangle lighting model.

Front and back sides of triangles are determined by the order you submit the vertices in. If you change the order of the vertices (http://www.arcsynthesis.org/gltut/Positioning/Tutorial%2004.html#d0e2962), then you change which side is front and which side is back.

ugluk
10-22-2010, 08:31 PM
Yeah, it's the so-called triangle (polygon) winding.