0
\$\begingroup\$

Have two limited planes. That means just squares or stripe in 3D space (or two connected triangles on the same plane). What i want to know is exactly how (and whether) they collide.

My first approach would be to assume endless planes and calculate the collision line (which is always endless and exists unless the planes are parallel). However the resulting line just changes my problem to: "find the intersection of a line and a limited plane" and again I cannot think of a direct solution...

Anyone having a hint or an approach to a solution?

Btw. if it simplifies things, it would be safe to assume the planes to be limited in only one direction as in consisting of the area between two endless, parallel rays.

Huge thanks in advance!

\$\endgroup\$
2
\$\begingroup\$

For the case that someone needs this one day... I solved it by computing the intersection line of the two planes (explanation and code here: http://geomalgorithms.com/a05-_intersect-1.html ) and then compute how this line intersects with the edge-lines of my actually limited planes. The intersection code can provide the value where on the intersection-line it hits the edge (code for that int he upper link as well). So one can use simple comparisons to detect how the two 3d-rectangles are intersecting each other exactly and whether they do at all. Ask please if needing any help :)

\$\endgroup\$
  • \$\begingroup\$ That is the way to go. I think you should accept your own answer. \$\endgroup\$ – Theraot Feb 8 '18 at 19:10
  • \$\begingroup\$ @Theraot Oh didn't even know that was possible! Thank you! \$\endgroup\$ – DragonGamer Feb 9 '18 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.