Hi all. I posted this a few days ago on Stack Overflow and have not been having much luck so was hoping some of you fine lads and ladies on here might be able to shed a little light on the problem I am trying to determine the exit point of a ray once it has been determined that it's origin point is contained within a defined bounding box. My givens are: -A bounding box defined by a min and max corner (center is calculable) -An arbitrary point within the bounding box -A direction vector associated with the arbitrary point The goal would be to find the exit point (x, y, z) from the bounding box of a ray originating from the given point and extending along the direction vector as efficiently as possible. My Linear Algebra skills are lacking at best so any information is much appreciated. For context, this would be for determining the point of exit from a cubic portal when a projectile/entity enters another cubic portal (arbitrary point is the center-point of the entity on the frame in which it overlaps the entrance portal), so technically I am looking for the exit point relative to the center of the bounding box, but that is easily calculable from the absolute point.