[ODE] Very close to solving trimesh problem (Normals question).

Jon Watte hplus-ode at mindcontrol.org
Tue Aug 24 09:16:02 MST 2004


> normals), if any moving body came along and collided with that fence,
> during the first timestep, it will be partially intersecting with
> triangles on the front and back of the fence. Then the simulator has no
> idea how to deal with this condition, and the body is pushed in two
> opposite directions at once. This is what happens, so I had to work around

You have to patch that up, by adding code to make sure that you 
only collide with triangles whose face normal point against your 
velocity direction, and/or you only collide with triangles whose 
depth along THEIR normal is less than half your diameter.

But it's not pretty, I agree -- much better to create correct art 
in the first place.


Btw: if you have a random-orientation poly-soup, and can't turn 
it into correct-orientation soup in your tool, you may be able to 
do it automatically, assuming that all the geometry is well 
conditioned (manifold in the sense that each edge is shared by 
exactly two triangles).

First, find ONE triangle that you know the orientation of. You 
could take the lowest triangle in the entire set, and assume that 
this is a floor, and make sure the orientation is such that the 
triangle normal points up, for example. (Assuming you're walking 
along on the inside of a closed manifold mesh).

Then, for each neighbor, make sure that the face normal matches. 
But "matches" is a little tricky -- you have to make sure that if 
you crawl across the edge connecting the triangles, the side that 
you end up on has the face normal pointing up, just like the side 
you crawled from. (Not that "face normal" means "winding order").

Repeat the process on all neighbors of this new set of triangles, 
etc, until you're done.

Cheers,

			/ h+




More information about the ODE mailing list