[ODE] Trimesh Sphere Interactions - how to break 'test_trimesh.cpp'

Alex Green alexg at acfr.usyd.edu.au
Mon May 16 17:16:46 MST 2005


My simulation has a vehicle with spherical wheels and a trimesh terrain.
I have had a lot of trouble getting consistent results with the trimesh
sphere collisions. My stepsize is small and my erp is fine. Trimesh
sphere collisions only work when the trimesh data is upside down and it
depends on the shape of the trimesh. I have scoured the mail archives to
no avail. For testing I output a txt file of every triangle in the
trimesh data structure and they are: valid triangles, wound in the
clockwise fashion and the normal points correctly. No Surprises.

Today I ran some experiments with the trimesh example code. Try this:
Take 'test_trimesh.cpp' turn the trimesh upside down by inserting the 
following lines after the trimesh is created:
   dMatrix3 triRot;
   dRFromAxisAndAngle(triRot, 0, 1, 0, M_PI);
   dGeomSetRotation(TriMesh, triRot);
   dGeomSetPosition(TriMesh, 0, 0, 1.0);

Now drop a sphere on the trimesh, it falls straight through!! Drop a box 
it may work. To start with the following questions need to be put 
straight for all the new users using trimesh:

What effect does the WINDING ORDER of the triMesh have on opcode/ode
simulation?

What effect does the SHAPE of the trimesh (eg. convex, concave) have on
the opcode/ode simulation?

What effect does including the NORMALS actually have in
dGeomTriMeshDataBuildSingle1(, , , , , , ,normalsPTR)?

What else do you need to know to get reliable trimesh/shpere collisions?

When I sort this out I will be happy to write up a section in the WIKI 
on trimesh use. Many thanks -alex green


More information about the ODE mailing list