Trimesh-Trimesh Collision

22 views
Skip to first unread message

UZiX

unread,
Mar 26, 2009, 3:24:32 AM3/26/09
to ode-users
Hi all,

i am trying to do trimesh-trimesh collision. it worked, but with very
weird jumping effect. i dont know what cause this but the collision
response is totally wrong. here is my code.

dTriMeshDataID Data = dGeomTriMeshDataCreate();
dGeomTriMeshDataBuildSimple(Data, (dReal*)blockVertices,
blockTotalVertices, (int*)blockIndices, blockTotalIndices);
blockTrimesh = dCreateTriMesh(space, Data, 0, 0, 0);
dGeomSetData(blockTrimesh,Data);

blockPhysixBody = dBodyCreate (world);
dBodySetPosition (blockPhysixBody,RedBlocksPos.pObject
[0].MidPoint.x,RedBlocksPos.pObject[0].MidPoint.y,RedBlocksPos.pObject
[0].MidPoint.z);
dMassSetTrimesh(&blockMass,20,blockTrimesh);
dGeomSetPosition(blockTrimesh,-blockMass.c[0],-blockMass.c[1],-
blockMass.c[2]);
dMassTranslate(&blockMass,-blockMass.c[0],-blockMass.c[1],-blockMass.c
[2]);
dGeomSetBody (blockTrimesh,blockPhysixBody);
dBodySetMass (blockPhysixBody,&blockMass);

it drops a moving trimesh onto a fix terrain trimesh.

the settings are:

contact ERP = 0.8
contact CFM = 0.001

any advice? thanx.

Martijn Buijs

unread,
Mar 26, 2009, 11:58:04 AM3/26/09
to ode-...@googlegroups.com

Try the latest ODE version or SVN revision and compile with OPCODE 'new' or GIMPACT as trimesh library.
I've found GIMPACT to be very stable and efficient for trimesh-trimesh collisions. OPCODE 'new' is a
big improvement, but it still has the occasional jumps you describe in my own simulation, and worse
performance than GIMPACT or at least in my simulation. But that may vary between
applications/geometry complexity, so better try both and see for yourself.

/Martijn

Jon Watte

unread,
Mar 26, 2009, 5:41:27 PM3/26/09
to ode-...@googlegroups.com
Martijn Buijs wrote:
> Try the latest ODE version or SVN revision and compile with OPCODE 'new' or GIMPACT as trimesh library.
>

Also, try posting your collision/contact generating code, rather than
the body set-up code. It's contact generation that matters. For good
trimesh/trimesh intersections, you should extract as many contacts as
you can (say, pass in an array of 100 items), and then filter them down
to a set of 10 or so using various contact manifold filter methods
(point thinning, coincidence merging, convex hull, etc).

Sincerely,

jw

UZiX

unread,
Mar 27, 2009, 12:42:01 AM3/27/09
to ode-users
i used callback function from moving-trimesh demo. that's why i wonder
why my trimesh has that jumping effect while the demo runs fine.
contact manifold filter methods? i dont understand what u mean by
that. Mind sharing some useful resources on how to do that?

thanx.

Reply all
Reply to author
Forward
0 new messages