#### Archived

This topic is now archived and is closed to further replies.

# collision detection w. modified boundingbox

This topic is 5988 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I''m making a 2D game in Directx8 which uses textured rectangles as ''sprites'' but the rectangles rotate so I can''t use plain bounding box collision detection...i think...I thought of the idea of re-computing a bounding box in which the rotated rectangle will fit, but then I''ll often end up with an much to big collision box, so I wondered if anyone else had any suggestion of how to do this? or if anyone knows of an article about a subject like this? Chris

##### Share on other sites
why not just transform the boundingbox together with the triangles?

Abnormal behavior of abnormal brain makes me normal...

##### Share on other sites
If I understand the problem correctly I had a similar problem.

original vesoljc:
if I got this right, what happens when you transform the bounding
box(the corners that is), it is no longer a square

**********
* * then becomes *
* * * *
* * * *
* * * *
********** * *
*
bounding box algorithms work on squares by making four
comparisons, it falls apart when it is no longer a rectangle.

There''s a couple of articles on gamedev.net about pixel-perfect
collision detection.
What you should probably do is go ahead and compute a larger
than necessary bounding box since they are the fastest thing I
know of, and if it''s within the bounding box, then you do the
pixel-perfect stuff cause it''s slower.

##### Share on other sites
I didn''t put the ascii diagram in between the code flags so
it didn''t turn out right, anyways, the rectangle becomes
a parallelogram(diamond-shaped for those who haven''t been in
geometry class for a while).

##### Share on other sites
There are 2 types of boxes. Axis aligned bounding box and "generic" bounding box.

The axis aligned cannot be rotated, they must always fit axis, but the generic bounding boxes can be rotated at will.
Obviously, they do not use the same algorithm!

1. 1
2. 2
Rutin
23
3. 3
JoeJ
20
4. 4
5. 5

• 22
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631732
• Total Posts
3001926
×