   Bounding Box Collision
  Hi,I have a problem about bounding box collision.I searched the forum but i couldn't find any satisfying answer.I am using C plusplus and Direct X for my engine.I need to make a Mesh collision detection, for this i am making a bounding box on my mesh. D3DXVECTOR3  g_vObjectpMin; // This is the Left Lower point of boxD3DXVECTOR3  g_vObjectpMax; // This is the Right Upper point of boxD3DXVECTOR3  worldBounds[8]; // This 8 points are the coordinates of corners of boxD3DXVECTOR3  CameraPoint;    // This is the camera pointNow i need to get the shortest distance between CameraPoint and bounding box.Does anyone has any idea about it?Source code, tutorial or something else can help me?Thanks.   
  Create a new vector, ClosestPoint. Set each component i of ClosestPoint by taking CameraPoint and clamping it to the range g_vObjectpMin, g_vObjectpMax. Once you have the closest point, you can find the squared distance or distance as necessary.;  Thanks for your answer jyk but i can't understand what you mean  " Set each component i of ClosestPoint by taking CameraPoint and clamping it to the range g_vObjectpMin, g_vObjectpMax. "Can you tell it more spesificly?;Quote:Can you tell it more spesificly?Vector3 Closest;for (int i = 0; i < 3; ++i) {    if (CameraPoint < Min) {   Closest = Min;    } else if (CameraPoint > Max) {   Closest = Max;    } else {   Closest = CameraPoint;    }};  Your code is working really well.Thanks jyk.   