Basically I want to put a bounding box/cube around my 3D Model in XNA (in this case it is a simple painting so the model itself is just a textured rectangle).
I tried the following code to create the cube:
public BoundingBox BoundingBoxCreation()
{
min = Position + Vector3.Up * Height - Size / 2
max = Position + Vector3.Up * Height - Size / 2;
boundingBox = new BoundingBox(min, max);
return boundingBox;
}
Then I create two of the same models, with the same height, size and scale: Scale: new Vector3(500.0f) (large scale because I created them in Blender) Height: 2f Size: new Vector3(6.75f * 500, -1.09f * 500, 0.35f * 500) (Multiplied everything by the scale). Then I tried to check for the collision between the two like so:
if (CollisionTest.boundingBox.Intersects(tapestryLeftOne.boundingBox))
{
Window.Title = "Collision";
}
However the Window Title will only change to show the collision when the two are absolutely 100% perfectly aligned, but what I was going for is trying to make it so even if they touch at any point not just when they match up. Any ideas on how I could achieve this?
If there is a better way to construct a Bounding box/cube and detect collision between another bounding cube,sphere, etc then I would very much appreciate if you could show me.