Jump to content
  • Advertisement


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


BBox rotation

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

For my collision detection I worked out four vertices around my car using the D3DXComputeBoundingBox() function form the D3DX library. Now I want to rotate and translate the vertices so they are always the tightest fit around the car. Basically its a OBB. Any ideas on how to do this. I could cos/sin or use some matrix stuff but I need more info.

Share this post

Link to post
Share on other sites
One more question.

How would I work out if a bounding box hit a triangle plane or triangle and also work out the intersection point.

Ok no more questions.

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
if you really want to rotate rectangle (change coordinates of points):
for rotate you must define center for your rectangle in point 0,0. for example your rectangle:

--------x 10,10
| |
| 0,0 |
| |

and rotation:

float fWorkAngleCos, fWorkAngleSin, fWorkAngleMinusSin, nx, nz, negVecRx;


//-- for first point ---

//-- for second ---
and so on for last three points.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!