chandlerp

Members
  • Content count

    2
  • Joined

  • Last visited

Community Reputation

105 Neutral

About chandlerp

  • Rank
    Newbie
  1. Problem computing GJK support points

    [quote name='greggles' timestamp='1352084345' post='4997410'] Maybe I'm missing something, but what is wrong with (0, 20)? Although it is not one of the vertices, it [i]is[/i] on the bounds of the minkowski difference. My understanding of the GJK algorithm is that it should still work correctly. [/quote] Ah, yep. I think I've been staring at code and formulas too long. Thank you!
  2. I'm trying to implement the GJK algorithm but am having difficulty calculating the support points. For my test case I am using equally size boxes stacked on top of each other, with box 2 at the origin and box 1 translated 10 units on the Y axis. [CODE] ____ | 1 | |____| | 2 | |____| [/CODE] I start with a search direction of ( 0, 1 ) which finds the support points: Box 1 - ( 5, 15 ) Box 2 - ( 5, -5 ) This yields the GJK support point of ( 5, 15 ) - ( 5, -5 ) == ( 0, 20 ). The Y term is correct but the X term is obviously wrong; the correct point on the Minkowski difference is ( 20, 20 ). This is found if Box 2's vertex at ( -5, -5 ) is used, but because both ( 5, -5 ) and ( -5, -5 ) meet the max( -DtBj ) requirement it depends which vertex was added to the hull first. Question is how to guarantee the correct vertex is found to calculate the difference? Bonus points for a solution which works in 3 dimensions as that is the world the algorithm lives in.