Two Sided triangles
I want to draw a triangle and make it have a back using directx 7.1a. I specify two triangles using my own structure that is equivalent to the D3D sturcutres, only with diffuse color informaiton, the normal, and the vertices. I then specify the same 3 vertexes except with the opposite of the normal, but instead of drawing the triangle with a back, they both end up apart. Why would this happen? Any help wouldbe nice.
I don''t know why this happens, but you could instead turn off backface culling, and then your triangle will be two-sided.
You have to wind the other triangle the other way around, or else things will go wrong (i.e. backface culling will detect both triangles to be facing the same direction, due to the math, but using the inverted normal for lighting). So switch the last two verticies of the second face, flip the normal (as you did), and you''re homefree
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement