[ODE] newby: collision detection with ODE and my triangle mesh

Adam D. Moss adam at gimp.org
Mon Apr 5 19:58:04 MST 2004


trapni at surakware.net wrote:
> However, I've no clue yet how to add my triangle mesh into the
> space of ODE. My scene is built in a hierarchy, so doing this
> with the spaces in ODE is even possible, too. But now, how do
> I add my final leaf nodes to ODE that are (actually) just a set
> of triangles (everything is made in tris ATM).
> 
> // create my world root nodes for ODE
> dWorldID worldId = dWorldCreate();
> dSpaceID rootSpace = dCreateHashSpace(0);
> 
> // create my foo-object sub-space for ODE
> dSpaceID fooSpace = dCreateHashSpace(0);
> dSpaceAdd(rootSpace, fooSpace);
> 
> but how do I now add a non-trivial-geometric object into my fooSpace,
> that is, not just a sphere/capsule/box/cylinder/plane/bar?
> 
> Imagine a pyramid, that can't be described by one of the objects above.
> How do I add such a pyramid with the coordinates:
> 	[1,0,0] [0,0,0] [0,0,1] [1,0,1] [1/2, 1, 1/2]
> (with z=up)?

You need a fairly recent version of ODE, with OPCODE/Trimesh
support enabled (it's disabled by default).  Then consult
the ODE manual for the trimesh functions with which you
push triangles into ODE.

Regards,
--Adam
-- 
Adam D. Moss   . ,,^^   adam at gimp.org   http://www.foxbox.org/   co:3


More information about the ODE mailing list