[ODE] 0.8.2 candidate

Jon Watte (ODE) hplus-ode at mindcontrol.org
Mon Oct 1 10:28:10 MST 2007

Oleh Derevenko wrote:
> Well, it IS normalized. But because of limited precision of floats the 
> modulo of vector is something around 0.996. In addition to using floats, 
> also the way the normalization is performed increases negative effect on 
> precision of result. To be more time efficient normalization is performed as 
> multiplication for length reciprocal instead of division. This adds extra 
> computational error.

The error in a float is not 0.4% of the value. The error in a float is 
in the sixth digit, at worst.

Perhaps what you're saying is that, because the value into the 
normalization function is so large (far away from the origin), the 
normalize fails. That means that normalize isn't robust. Typically, 
you'll want to multiply by the reciprocal of the largest component 
BEFORE you take the square root to measure the length, if you know that 
your normal will be far off (e g, longer than 10.0 units).
A "quick hack" fix is to normalize the vector twice.

If this is pre-processing, then it's worth the extra cycles to make it 


          / h+

More information about the ODE mailing list