Sign in to follow this  

How to create a bounding box?

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

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 3555 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this