
Collision detection between a sphere and a plane
Hi all.
I currently have a system with some simple physics in it. There are two balls bouncing around in a cube-shaped volume. The cube is aligned with the axes in world coordinates.
The collision detection between the balls and the cube in which they are bouncing around is done quite simply by what is basically 6 if statements. Each if statement checks if the ball is on the wrong side of one of the bounding planes that makes up the cube. If there is a collision, then the velocity of the ball with respect to the appropriate axis is reversed, and the ball gets moved to where it should be.
So, that''s all pretty simple so far.
I would like to know how I can rotate my bounding cube in world coordinates so that the balls exhibit the same behaviour.
Thanks for any advice you can offer
Harry.

Harry.
http://astronomy.swin.edu.au/~pbourke/geometry/pointplane/
Interests: my money-pit car, computer hardware/programming, anything 3D'93 RX-7
Is this a camera rotation or an actual rotation of the cube?...there is a difference as far as the physics involved (i.e. the balls would take on some of the rotational force of the cube as they bounce)
______________________________________________________________________________________The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ"So. Any n00bs need some pointers? I have a std::vector<n00b*> right here..." - ZahlmanMySite | Forum FAQ | File Formats______________________________________________________________________________________
Thanks JONSKI, that looks like a useful link
I''ll take that away and see what I can do with it.
Thunder_Hawk, the cube will actually be static at run-time, I just wasn''t sure how to change my collision code to handle the rotations. It looks like I should be able to do something with the link JONSKI provided.
Thanks again guys.
Harry.

Thunder_Hawk, the cube will actually be static at run-time, I just wasn''t sure how to change my collision code to handle the rotations. It looks like I should be able to do something with the link JONSKI provided.
Thanks again guys.
Harry.
Harry.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement