   Point in Box ?
  Hello all, I was wondering how to detect if a vector is inside a box defined by 8 vectors.So far i have only seen source examples that only works if Y is up.I need a function that will work whatever the worldup is and if LeftHand or RightHand is used.Any have a sample of this ?   
  Left- or right-handed doesn't matter for this. Now when you say 8 vectors I assume you mean the corners of the box; is the box axis-aligned, or arbitrarily oriented?   ;  It's easier if you have the box represented as center + side lengths + orientation; then you can transform the test vector into the coordinate space of the box, and test as an AABB against half-side-length (using fabs). If at all possible, you should use this representation for box -- eight vertices aren't guaranteed to actually make up a rectilinear box (or even a convex shape).If you KNOW that the vertices are a box, but you can't use the explicit box representation, then you can recover it by deriving the three sides (assuming you know which vertices are supposed to go with which corner), and normalize those sides and stick into a matrix to represent the orientation.   ;  The reason to use 8 vectors (corners), is to be able to define a box that is not nescearly a cube, it could be a "half" pyramid or any other shape that can be define by 8 corners.   ;  If the box remains always as a convex shape, then simple point-behind-all-6-planes-test should be enough.But 8 points, more and less random, can create a shape which isn't convex. Then perhaps you could use vector-triangle hit-test. Ray would be defined by the point and another point which is definetely outside of the box. Then you just count how many triangles were hit by the ray and if the number of the hits is even, the point is inside the box.   ;  hmm, so to speed this up I could compute a sphere from the 8 vectors and do a PointInSphere check, be4 doing the hit test.Ill try that, thx   