Jump to content
  • Advertisement
Sign in to follow this  
cannonicus

quad-quad interception

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

Hello What is the fastest way of checking whether or not 2 quads are partially or completly overlapping each others in 2d? I guess one could check for line interception between all lines in the quads, but that would be 16 pretty costly computations. There should be a better way. Thanks in advance //Emil

Share this post


Link to post
Share on other sites
Advertisement
one of them will always be axis aligned. the other one can be both rotated and scewed, but it will always be a quad.

I will use this to determin if a section of my 2d sidescroller terrain (the axis alined quad) is partially or completly inside the camera frustum (the skewed / rotated quad).

Share this post


Link to post
Share on other sites
Quote:
one of them will always be axis aligned. the other one can be both rotated and scewed, but it will always be a quad.

I will use this to determin if a section of my 2d sidescroller terrain (the axis alined quad) is partially or completly inside the camera frustum (the skewed / rotated quad).
As oliii will probably tell you as well, the separating axis theorem may be what you're looking for. In 2d, it can very quickly determine intersection or non-intersection between the shapes you mention.

However, for frustum culling of any sort, accuracy is often sacrificed for a slightly faster test. The standard AABB/frustum test culls the AABB against the planes of the frustum; this method can easily be adapted to 2d. It's basically the SAT, except that only the axes from the frustum planes are tested (resulting in the occasional false positive).

Share this post


Link to post
Share on other sites
Sign in to follow this  

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