lördag 18 februari 2017

First implementation of GJK

Today we implemented a first version of GJK in 2D. For now it only shows us whether or not our 2D shapes are touching. We are planning to extend this version into one which also tells us how far apart they are. We would also like to implement a GJK for 3D.




In our current version, the squares are red when they are touching and green when they are not. The algorithm also works when we rotate the squares.



Although we haven't hard coded the algorithm for squares only, we have only tested it with squares. This is simply because it is the only polygon that is readily available in Unity. Before we move on to our 3D implementation, we will test our algorithm with other polygons.

Inga kommentarer:

Skicka en kommentar