Archived

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

RXB gamer

Bounding Box normals

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
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