Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualWaterlimon

Posted 30 March 2013 - 09:58 AM

If you mean a 2D bounding box regardless of whether its 2D or 3D, you need to:

1.Transform all the points to 2D coordinates (using all the matrices, projection, model, etc. you pass to opengl) (you might want to find a way to ignore points you know not to affect the bounding box, like stuff inside the object, or make a simplified representation of it...)

(if its top down and practically 2D however, you can probably just ignore the depth and treat them like 2D points)

2.Find the maximum X coord you can find, max y, min X, min Y

3.You have an axis aligned bounding box


#1Waterlimon

Posted 30 March 2013 - 09:57 AM

If you mean a 2D bounding box regardless of whether its 2D or 3D, you need to:

1.Transform all the points to 2D coordinates (using all the matrices, projection, model, etc. you pass to opengl) (you might want to find a way to ignore points you know not to affect the bounding box, like stuff inside the object, or make a simplified representation of it...)

2.Find the maximum X coord you can find, max y, min X, min Y

3.You have an axis aligned bounding box


PARTNERS