Bounding boxes no XNA são axis-aligned , isto é, tu não consegue rotacionar elas, devido elas serem alinhadas aos 3 eixos. tu só consegue transladar elas - isto evita custos mais pesados para checagem de interseção, principalmente.
Agora se tu quiser criar uma bounding box não alinhada, tu vai querer ou importar um modelo ou criar as 6 faces do cubo na mão ( definir os pontos em relação a origem, ter uma matrix de transformação deste cubo, Texturas, etc... e implementar os métodos intersects, etc... ) =P
Já coloco uma classe implementando um cubo, usando vertex declaration.
EDIT:
Código-exemplo de como criar um cubo, criando vértice por vértice sem ser "alinhado ao eixo".
class SimpleDrawableBox : DrawableGameComponent
{
VertexBuffer vb;
VertexDeclaration vertexDecl;
Matrix worldMatrix;
Matrix viewMatrix;
Matrix projMatrix;
BasicEffect basicEffect;
public Matrix WorldMatrix
{
get { return worldMatrix; }
set { worldMatrix = value; }
}
public Matrix ViewMatrix
{
get { return viewMatrix; }
set { viewMatrix = value; }
}
public Matrix ProjMatrix
{
get { return projMatrix; }
set { projMatrix = value; }
}
public SimpleDrawableBox(Game game)
: base(game)
{
}
protected override void LoadContent()
{
GraphicsDevice device =
((GraphicsDeviceManager)Game.Services.GetService(
typeof(IGraphicsDeviceService))).GraphicsDevice;
vertexDecl = new VertexDeclaration(device, VertexPositionNormalTexture.VertexElements);
vb = new VertexBuffer(device, VertexPositionNormalTexture.SizeInBytes * 24,
BufferUsage.None);
VertexPositionNormalTexture[] verts = new VertexPositionNormalTexture[24];
//face 1
verts[0] = new VertexPositionNormalTexture( new Vector3(-1, 1, -1), new Vector3(0, 1, 0), new Vector2(0, 0));
verts[1] = new VertexPositionNormalTexture(new Vector3(1, 1, -1), new Vector3(0, 1, 0), new Vector2(1, 0));
verts[2] = new VertexPositionNormalTexture(new Vector3(1, 1, 1), new Vector3(0, 1, 0),new Vector2(1, 1));
verts[3] = new VertexPositionNormalTexture(new Vector3(-1, 1, 1), new Vector3(0, 1, 0), new Vector2(0, 1));
//face 2
verts[4] = new VertexPositionNormalTexture(
new Vector3(1, -1, -1), new Vector3(1, 0, 0), new Vector2(0, 0));
verts[5] = new VertexPositionNormalTexture(
new Vector3(1, -1, 1), new Vector3(1, 0, 0), new Vector2(1, 0));
verts[6] = new VertexPositionNormalTexture(
new Vector3(1, 1, 1), new Vector3(1, 0, 0), new Vector2(1, 1));
verts[7] = new VertexPositionNormalTexture(
new Vector3(1, 1, -1), new Vector3(1, 0, 0), new Vector2(0, 1));
//face 3
verts[8] = new VertexPositionNormalTexture(
new Vector3(1, -1, 1), new Vector3(0, 0, 1), new Vector2(0, 0));
verts[9] = new VertexPositionNormalTexture(
new Vector3(-1, -1, 1), new Vector3(0, 0, 1), new Vector2(1, 0));
verts[10] = new VertexPositionNormalTexture(
new Vector3(-1, 1, 1), new Vector3(0, 0, 1), new Vector2(1, 1));
verts[11] = new VertexPositionNormalTexture(
new Vector3(1, 1, 1), new Vector3(0, 0, 1), new Vector2(0, 1));
//face 4
verts[12] = new VertexPositionNormalTexture(
new Vector3(-1, -1, -1), new Vector3(0, 0, -1), new Vector2(0, 0));
verts[13] = new VertexPositionNormalTexture(
new Vector3(1, -1, -1), new Vector3(0, 0, -1), new Vector2(1, 0));
verts[14] = new VertexPositionNormalTexture(
new Vector3(1, 1, -1), new Vector3(0, 0, -1), new Vector2(1, 1));
verts[15] = new VertexPositionNormalTexture(
new Vector3(-1, 1, -1), new Vector3(0, 0, -1), new Vector2(0, 1));
//face 5
verts[16] = new VertexPositionNormalTexture(
new Vector3(-1, -1, 1), new Vector3(-1, 0, 0), new Vector2(0, 0));
verts[17] = new VertexPositionNormalTexture(
new Vector3(-1, -1, -1), new Vector3(-1, 0, 0), new Vector2(1, 0));
verts[18] = new VertexPositionNormalTexture(
new Vector3(-1, 1, -1), new Vector3(-1, 0, 0), new Vector2(1, 1));
verts[19] = new VertexPositionNormalTexture(
new Vector3(-1, 1, 1), new Vector3(-1, 0, 0), new Vector2(0, 1));
//face 6
verts[20] = new VertexPositionNormalTexture(
new Vector3(1, -1, -1), new Vector3(0, -1, 0), new Vector2(0, 0));
verts[21] = new VertexPositionNormalTexture(
new Vector3(-1, -1, -1), new Vector3(0, -1, 0), new Vector2(1, 0));
verts[22] = new VertexPositionNormalTexture(
new Vector3(-1, -1, 1), new Vector3(0, -1, 0), new Vector2(1, 1));
verts[23] = new VertexPositionNormalTexture(
new Vector3(1, -1, 1), new Vector3(0, -1, 0), new Vector2(0, 1));
vb.SetData(verts);
worldMatrix = Matrix.Identity;
//load basic effect
basicEffect = new BasicEffect(device, null);
basicEffect.Alpha = 1.0f;
basicEffect.DiffuseColor = new Vector3(0.5f, 0.3f, 0.7f);
basicEffect.SpecularColor = new Vector3(0.25f, 0.25f, 0.25f);
basicEffect.SpecularPower = 5.0f;
basicEffect.AmbientLightColor = new Vector3(0.75f, 0.75f, 0.75f);
basicEffect.DirectionalLight0.Enabled = true;
basicEffect.DirectionalLight0.DiffuseColor = Vector3.One;
basicEffect.DirectionalLight0.Direction =
Vector3.Normalize(new Vector3(1.0f, -1.0f, -1.0f));
basicEffect.DirectionalLight0.SpecularColor = Vector3.One;
basicEffect.DirectionalLight1.Enabled = true;
basicEffect.DirectionalLight1.DiffuseColor =
new Vector3(0.5f, 0.5f, 0.5f);
basicEffect.DirectionalLight1.Direction =
Vector3.Normalize(new Vector3(-1.0f, -1.0f, 1.0f));
basicEffect.DirectionalLight1.SpecularColor =
new Vector3(0.5f, 0.5f, 0.5f);
basicEffect.LightingEnabled = true;
basicEffect.World = worldMatrix;
basicEffect.View = viewMatrix;
basicEffect.Projection = projMatrix;
base.LoadContent();
}
public override void Update(GameTime gameTime)
{
//updates your world matrix
//transformation sequence is always I.S.R.O.T. ( identity, scale, rotation, orbit, translation )
worldMatrix = Matrix.CreateRotationY((float)gameTime.TotalRealTime.TotalSeconds) * Matrix.CreateRotationZ((float)gameTime.TotalRealTime.TotalSeconds);
base.Update(gameTime);
}
public override void Draw(GameTime gameTime)
{
GraphicsDevice device =
((GraphicsDeviceManager)Game.Services.GetService(
typeof(IGraphicsDeviceService))).GraphicsDevice;
//device.RenderState.CullMode = CullMode.CullCounterClockwiseFace;
device.VertexDeclaration = vertexDecl;
device.Vertices[0].SetSource(vb, 0, VertexPositionNormalTexture.SizeInBytes);
basicEffect.World = worldMatrix;
basicEffect.View = viewMatrix;
basicEffect.Projection = projMatrix;
basicEffect.Begin();
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Begin();
for (int x = 0; x < 6; x++)
{
device.DrawPrimitives(PrimitiveType.TriangleFan, x * 4, 2);
}
pass.End();
}
basicEffect.End();
base.Draw(gameTime);
}
}