Skybuck Flying
unread,May 1, 2022, 10:13:12 PM5/1/22You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I discovered another dangerous one while trying to compute overlap of interval (basically ranges) and/or trying to clip/cap line segments:
0 * +infinity = -NAN
This happens as the ray is on the edge of a boundary/box... cause tMinX will become -NAN.
Leading to weird situations depending on how the code was written, either the wrong point will be taken or it will not clip at all.
Once intersection segment with ray and box has been calculated, the ray segment has to be checked against the interestion segment to check if it overlaps... it's still possible it does not overlap.. for a "ray segment box intersection" algorithm. Analog to "line triangle intersection" algorithm, first "line plane intersection" then check if intersection point lies inside triangle which lies inside the plane.
I have seen some papers that try and work around these issues at least for ray/box intersection, but if these tricks work for ray segment box intersection remains to be seen.
Anyway best way to solve it is to use custom code for when delta x, y, or z is zero... instead of trying to divide or multiply by zero and infinity and such things cause certain combinations can lead to -NAN problems. Also win32 and win64 behave differently in delphi somewhat... perhaps 0 * infinity produces something else in win64... not yet sure...
It's in my video which I will upload shortly... hmmm...
Anyway... I am leaving math hell for now... leaving fpu hell... and returning back to the surface ! =D
Bye,
Skybuck =D