Thread: Intersection with cubic View Single Post 2008-01-24, 14:54 #7 Wacky   Jun 2003 The Texas Hill Country 100010000012 Posts First, a "cubic", normally refers to "a cubic equation" (one of the third degree). You are looking for intersections with a "cube" (a right- rectilinear solid whose faces are squares). The traditional approach is to determine which, if any, face the ray first intersects. But notice that each face is just a portion of a plane. Therefore, we can determine at what point the ray intersects the plane and then whether or not that point is a part of the face. Start by describing the ray in parametric form (which it appears you have already done). R(t) = { Rx(t), Ry(t), Rz(t) } where Rx(t) = Rx0 + Vx * t, etc. Now, if you have the luxury of selecting the cubes, you choose one oriented in an alignment parallel to the axes. There, one of the faces is described by the equation x=X, where X is a constant. Now, our parametric ray intersects this plane at Rx(t) = X. Solve for t. Substitute and determine Ry and Rz. If both of these are within the bounds of the face, there is an intersection. Repeat as necessary for all other faces in the view. Note that there are a number of ways to shortcut the testing in order to speed up the overall process. But here we are just discussing the underlying math.  