Extracting the BoundingSphere
and BoundingBox
information often helps you in detecting collisions in a 3D game. The BoundingSphere and BoundingBox come from the model vertices. For BoundingSphere, you should know the center and radius, whereas for BoundingBox, you need the min and max points. In this recipe, you will learn how to build and get the BoundingSphere and BoundingBox from 3D models produced by 3D modeling tool such as 3DS MAX or Maya. The default format in XNA is FBX, a compatible format shared between most 3D modeling tools in the content processing phase for Windows Phone 7 XNA game.
BoundingBox is actually specified by eight points, whereas BoundingSphere consists of a center point and the radius. BoundingBox is axis aligned, where each face is perpendicular to the axis.
The reason to use BoundingBox is for performance and ease. BoundingBox has the advantage that it fits the non-rotated rectangular...