Jump to content
  • Advertisement

Archived

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

RXB gamer

Bounding Box normals

This topic is 5831 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

Sorry, this is probably pretty simple, but so far I''ve based inter-object collisions on bounding boxes and I want to create a slide effect if I collide with something. To do this I need the normal of whatever side of the box I hit. How do I find this? Thanks When they come for me I''ll be sittin'' in my desk with a gun in my hand wearing a bullit-proof vest singing "My, my, my, how the time does fly when you know your gonna die by the end of the night!"

Share this post


Link to post
Share on other sites
Advertisement
If you using axis-aligned bounding boxes or oriented bounding boxes? If they''re axis aligned then the normals are just the basis vectors or their negations, ie (1,0,0) (-1,0,0) (0,1,0) (0,-1,0) (0,0,1) (0,0,-1). If you''re using bounding boxes oriented to the object''s local space then it''s a bit more complicated, you need to transform those basis vectors back into world space coordinates.

Share this post


Link to post
Share on other sites
And if it''s not Axis aligned, but the world coordinates of the oriented box are known (they should be, how else do you compare)
it''s not that hard either.

Each normal is parallel to 4 edges of the box.

---------------------------
I may be getting older, but I refuse to grow up

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!