How to create a bounding box?

Started by
1 comment, last by PM-Heavy 16 years ago
I'm currently working on a pong clone (my first graphical game). The only hard parts left to implement are collision detection and physics. My question is how should I create the bounding boxes for the paddles and ball. I googled this but the links seem to be theoretical or unrelated to my game. I'm using C++ with SFML. Thanks in advance.
Advertisement
Hi,

Simply get the min and max vertices of an object. Together with the transformation matrix of the object you get an OBB (oriented bounding box). To check for collisions check whether the OBB of the ball collides with the OBB of the paddle. Source code for this can be easiliy found with goggle. That's it.

Hope this helps you.
Best regards, Porthos.
Thanks for the info. I shouldn't have a difficult time now.

This topic is closed to new replies.

Advertisement