1

Can anyone please tell me how I can detect whether two images intersect or not? Actually, I had two images, one image can rotate. I need to check that whether the second image intersects with the first image or not. Is there any function in JavaScript to check such intersection? Thanks in advance.

Kevin
  • 53,822
  • 15
  • 101
  • 132
Mayank Nimje
  • 573
  • 4
  • 16
  • 3
    Check out the demo in my answer here: http://stackoverflow.com/questions/4230029/jquery-javascript-collision-detection/4230951#4230951 – Šime Vidas Dec 14 '11 at 16:19
  • Do you need this to be **exact** (testing for single pixel overlaps in non-square semi-transparent images, and/or **fast** (able to run on many pairs of images at 30fps)? – Phrogz Dec 14 '11 at 18:19
  • Hi Sime sir, i checked what you have mentioned, but it is not working in my case. If i rotate the image (i.e a rectangle) and then try to find the collision (i.e rectangle (rotated) with other rectangle(movable)) it fails. please give me suggestion. – Mayank Nimje Dec 15 '11 at 10:54

0 Answers0