[ODE] Using rays to generate a light/shadow map

Jon Watte hplus-ode at mindcontrol.org
Wed Nov 3 08:54:00 MST 2004

> surface( 791.01, 4990.24, 0.57 )  <-- ray origin

Are you using floats or doubles? Values of magnitude 5000 
don't have all that much useable precision in floats -- only 
about 1e-3 at that point.

> Anyway, I know there's nothing for the ray to collide with. Also, I'm 
> projecting the ray's origin away from the triangle center along the 

There's the actual triangle surface. It's quite possible that 
the ray collides with the base surface because of numerical 
imprecision problems.

> So, I'm thinking that even though I'm manually calling dCollide with my 
> ray and with the terrain geom, perhaps there's some magic that needs 
> doing by calling dWorldStep at least once?

That seems unlikely.

I would pick a single, representative spot, and run the collision 
from there (possibly using "manual code" right before the automated 
ray cast). Then examine what you're actually colliding with inside 
the collision callback. Maybe use the ability to extract the collided 
triangle from the mesh, too.


			/ h+

More information about the ODE mailing list