Page 1 of 1
[solved] how to set face normals?
Posted: Sat Apr 21, 2007 6:43 pm
by madMAx4
Hi,
I got GIMPACT collision to work properly.
but now i have a terrain mesh that lets objects fall through. so i turned the gravity vector from -10 to 10 an put a box below the terrain and everything works great.
now, how can i turn the terrain mesh that objects falling down don't fall through?
normally there are face normals defined, but i can't find such an attribute in btTriangleMesh and the others?
so how do you define them?
Posted: Sun Apr 22, 2007 9:11 am
by Erwin Coumans
You don't need to set facenormals using Bullet.
Please check the MovingConcaveDemo, for an example of GIMPACT.
For most cases, it is recommended to approximate moving concave objects with a convex or a grounp of convexes inside a compound shape.
The GIMPACT contribution is not well tested against latest Bullet mesh improvemens. This needs to be tested properly, but for a start, you might want to try if disabling 'quantization' helps.
Hope this helps,
Erwin
Posted: Sun Apr 22, 2007 11:02 am
by madMAx4
GIMPACT collision works great.
i simplified the whole thing by using a box for the terrain too.
now, when the box falls down it collides not with the hull of the terrain box, but with the inner sides of the faces of the terrain box.
so i flipped all the face normals in blender and actually the box collides with the hull of the terrain now.
but the other side is that my grahpics engine (irrlicht) uses the same mesh file and therefore displays it wrong, with the face normals vice-versa.
then i compared the 2 different obj files, one with the original face normals and one with the flipped normals and the difference is the order in which the vertex indices of the faces are defined:
original face:
and with flipped normals:
so i have to flip the normals when importing the obj into bullet.
i think GLModel can do that for me, lets see.
thx so far
EDIT: GLMmodel::glmReverseWinding() does it
