Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS6360 Collision Detection/Response Loose End David Johnson.

Similar presentations


Presentation on theme: "CS6360 Collision Detection/Response Loose End David Johnson."— Presentation transcript:

1 CS6360 Collision Detection/Response Loose End David Johnson

2 Work Through An Example Two objects –Rectangle and Triangle (-1, -2)(1,-2) (-1,-1)(1,-1) (-1,2) (1,2)(0,1)

3 Compute Center of Mass Find the area using signed area of polyline face –Nth vertex same as 0th Compute centroid coordinates

4 Translate the Triangle (-1, -2)(1,-2) (2,-1)(4,-1) (-1,2) (1,2)(3,1)

5 Check for Collision Use GJK –Pick a random direction to start the simplex (1,1) –Find the support vertex of Minkowski difference Z support(Z, d) = support(Y, d) – support(X, -d)

6 Support for the Box Support(Y,d) = (1,2) (-1, -2)(1,-2) (-1,2) (1,2)

7 Support for the Triangle (2,-1)(4,-1) (3,1) support(X, -d) = (2,-1)

8 Total Support support(Z, d) = support(Y, d) – support(X, -d) = (1,2) – (2,-1) = (-1,3) Increase the simplex by finding new dir

9 Find new support Support(Z,d) = (1,-2) – (3,1) = (-2,-3) (-1, -2)(1,-2) (-1,2) (1,2) (2,-1)(4,-1) (3,1)

10 Extend Simplex Simplex is now a line Find closest point Make new dir (-1.45, 0.24)

11 Find new support Support(Z,d) = (1,-2) – (2,-1) = (-1,3) (-1, -2)(1,-2) (-1,2) (1,2) (2,-1)(4,-1) (3,1)

12 Simplex Doesn’t Extend Closest Point has same distance as last time –No collision (-1.45, 0.24)

13 Look at Collision Case Support(Z,d) = (-1,2) – (2.5,-1) = (-3.5,3) (-1, -2)(1,-2) (-1,2) (1,2) (0.5,-1) (2.5,-1) (1.5,1)

14 Initialize Simplex Simplex is a point Find closest point Make new dir

15 Look at Collision Case Support(Z,d) = (1,-2) – (1.5, 1) = (-0.5,-3) (-1, -2)(1,-2) (-1,2) (1,2) (0.5,-1) (2.5,-1) (1.5,1)

16 Extend Simplex Simplex is a line Find closest point Make new dir

17 Look at Collision Case Support(Z,d) = (1,2) – (0.5, -1) = (0.5,-3) (-1, -2)(1,-2) (-1,2) (1,2) (0.5,-1) (2.5,-1) (1.5,1)

18 Extend Simplex Simplex is a line Find closest point Make new dir

19 What is the Collision Normal? (-1, -2)(1,-2) (-1,2) (1,2) (0.5,-1) (2.5,-1) (1.5,1)


Download ppt "CS6360 Collision Detection/Response Loose End David Johnson."

Similar presentations


Ads by Google