3D Box Collision Data Import

Posted by cboe on Game Development See other posts from Game Development or by cboe
Published on 2013-10-24T17:20:11Z Indexed on 2013/10/24 22:10 UTC
Read the original article Hit count: 158

Filed under:
|
|

I'm trying to implement a collision system using oriented bounding boxes, using a center for the box, it's extents as a 3D Vector and a rotation matrix, which is all stuff I picked up online and seem to be somewhat the standard.

Detecting the center is no problem so I'm gonna leave these out here.

My problem however is importing the data from a 3D file. Say I've placed a box with 2 units length on each side aligned to the world axis. The logic results here are extents of 1,1,1 and I use an identity matrix for rotation - easy.

However I'm stuck when I rotate the box in the 3D program, say 30 degrees each axis. How would I parse the box? I only have these 8 vertices as information, and I guess what I would need to do is to find out the rotation of said box, apply it to the vertices so they are aligned to world axes and then calculate the extents out of that.

How do I get the rotation of the box when I only have the vertex information of the box available?

© Game Development or respective owner

Related posts about 3d

Related posts about collision-detection