tag:blogger.com,1999:blog-7553595438846063219.post4210594930183239059..comments2016-06-03T14:37:14.766+01:00Comments on Randomchaos: Graphics Adventures with XNA: Line Intersection – y = mx + cCharles Humphreynoreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7553595438846063219.post-4203652942322901042012-08-01T09:32:56.961+01:002012-08-01T09:32:56.961+01:00Yup, would only work for axis aligned stuff as rec...Yup, would only work for axis aligned stuff as rectangle has no concept of a rotation. You could also do an easy out and wrap a sphere round each rectangle first and check for overlap before you continue. Also you 'should' handle the case where there are multiple nearest points of intersection and where one rectangle is contained by another..... ;)<br /><br />m<xexuxjyhttp://www.blogger.com/profile/05353933907345465245noreply@blogger.comtag:blogger.com,1999:blog-7553595438846063219.post-58403342283217254572012-07-25T08:58:49.574+01:002012-07-25T08:58:49.574+01:00I think that would work fine, but would only be of...I think that would work fine, but would only be of use for axis aligned checks. I might be wrong, I guess you need to test test it out :)Charles Humphreyhttp://www.blogger.com/profile/10935746329039730399noreply@blogger.comtag:blogger.com,1999:blog-7553595438846063219.post-53095598646804697842012-07-25T08:48:33.300+01:002012-07-25T08:48:33.300+01:00oo, different approach to the one I'd take (as...oo, different approach to the one I'd take (as math makes my head hurt) which would be to do a Rectangle.Intersect to find the area of intersection (also as a rectangle) then a Ray.Intersect from the centre of Rectangle 1 to the centre of the result of the first intersection. *scratches head* I think. (Wah! Now my head hurts)Anne-Lise Paschhttp://www.blogger.com/profile/07599093117281057746noreply@blogger.com