This topic is 4888 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites
axis aligned? rotated?

##### Share on other sites
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 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).

1. 1
2. 2
Rutin
20
3. 3
khawk
17
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633759
• Total Posts
3013715
×