0

I'm writing a program that generates penrose tilings and I wanted to use Java's Graphics2D class. I was wondering if there was any way to check if 2 or more shapes share a border with each other. Should I just compare the slopes and base points or is there an alternate method?

Thanks!

ckann7
  • 1

1 Answers1

0

I feel it is best to compare the coordinates with collision detection.

I found these tutorials, they may help you if you need it.

2d collision detection - http://zetcode.com/tutorials/javagamestutorial/collision/

3d collision detection - http://www.java-tips.org/other-api-tips/java3d/collision-detection-with-java3d-2-2.html

Hope this helps

Phil
  • 463
  • 3
  • 9