Ray->Box intersection

Blitz3D Forums/Blitz3D Programming/Ray->Box intersection


; 2. The line-relative position, in CLIP_Intersect_U#, where a value of 0..1 means the intersection point lies between V1 and V2,
; and a value less than 0 or greater than 1 means the intersection occured at a location outside the line segment.




Use the U coordinate returned for where the pick point is on the line to determine whether the pick point is behind your start point, or beyond your endpoint.

The U coordinate will be less than 0 if the pick point is "behind" the first point you specify in the pick, and greater than 1 if it's beyond the second point.

And if only one of your pick points is outside this range, then you're inside the cube, assuming your start point is the camera's position.