Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
22 Views

Floating point problem

Hi,

as a test, I have a rectangle of size 20 with its center at origin 0,0,0 with the face normal on the x axis and shoot a ray from org=(254894535,0,0) and dir=(-1,0,0)

I would expect tfar to return 254894535 but it return 254894528 instead, 7 is a lot when calculating the hit point, any idea what this could be??? thanks.

 

0 Kudos
2 Replies
Highlighted
New Contributor I
22 Views

Your absolute error is 7, but the relative error is 2.7e-8, which is pretty low for IEEE754 single precision. This is just how IEEE floating point numbers work. Just use a closer origin (with possibly negative tnear, but I dont know if embree supports that)

0 Kudos
Highlighted
Beginner
22 Views

Thanks

0 Kudos