Triangle order, normal inversion

litghost

21-01-2007 02:00:04

I have integrated ODE with my game, but I found the collision response was always inverted. It would pull objects toghter instead of keep them apart. I figured out the problem was EntityInformer created a trimesh from the model, but the triangle order was "wrong", so normals were facing inward. Regardless, when I flip the normals on the model in Blender, and exported the collisions worked as expect.

However, Blender seems to need them the other way for sane rendering. I can reverse the culling order in Ogre trivally, but can't seem to find it in Blender or EntityInformer. If I can change the triangle order in either of those, I can be consistent everywhere.

Is there a method to do it in EntityInformer that I have not seen? Or ODE for that matter?

Thanks.

luis

21-01-2007 11:03:12

hmmm, just to try..... use the OgreMeshUpgrade, may be it fixes the problem for you. I'm just guessing :)

litghost

21-01-2007 11:26:21

I am using the latest version of the OgreXmlConverter, so I don't think versioning is a problem.

tuan kuranes

22-01-2007 12:20:16

Is there a method to do it in EntityInformer that I have not seen? Or ODE for that matter?
Ogre, Ode, OgreOde, current use a "convention" (namely opengl order) about how indexed triangle order is and how normal comes from it, and I would guess that Blender is surely able to follow it somehow.

However, Blender seems to need them the other way for sane rendering.
If you have to change culling in material for your mesh it rather seemt to be a blender-ogre problem rather than OgreOde, try posting on Ogre main forum to get some specialist advice.

litghost

22-01-2007 17:11:43

I would agree, if OgreODE needed the OpenGL triangle winding order (clockwise). However, that is the default for Blender and Ogre, and what I originally have been using. When I use that winding order, the trimesh collisions operate backwards (suck instead of repulse). I don't really know why, but reversing the triangle winding order makes the collision reponse make sense.