ase files + shadow volume

Hello guys,

i have a huge problem. I want to do shadow volume. i draw my objects with 3d studio max and export it in a ase file. Now i have a problem with the winding order of the triangles of my object. what can i do?

Can i change the winding order in 3d studio? Or how can i recognize if i must change the order in the ase file?

thank you for reply, i really need it.


Shadow Volumes don’t care what the winding order is, as long as OpenGL is told which is the correct order for front facing, beit CW or CCW. Changing the winding order is very easy. I’m not sure if 3ds max can do it for you but you can load the model in your own program and go through each triangle and reverse the winding. If for example one triangle’s indices are [0,1,2] and that describes a CW winding order, then to change it to CCW make it [0,2,1]. See, easy.


[This message has been edited by SirKnight (edited 01-05-2003).]

To change winding in 3dsmax:
apply the Edit Normals modifier
check the “flip normals” checkbox

To change winding in OpenGL:
glFrontFace( GL_CW / GL_CCW );

If you have problems with mixed winding, then you’re probably not extracting the data entirely correctly from Max, paying attention to the various scales and flags.