Archived

This topic is now archived and is closed to further replies.

gotton

Help! About GJK algorithm!

Recommended Posts

I got a problem when try to program the distance subalgorithm of GJK algorithm. The main idea of distance subalgorithm is to compute the distance between the origin and a simplex. I used a simple sample to test the subalgorithm: the simplex is defined by 3 points: {1,0,0}, {0,1,0}, {0,0,2}, it''s a triangle. The result (closest point) is {0.333,0.333,0.667}, of course it''s wrong. I think I maybe forget something? So plz help me!

Share this post


Link to post
Share on other sites
Which language are you using?
And what code?
(it is a bit hard to help you if we do not know what has gone wrong, in what language)

Nice coder

Humans are Human oriented, it is because of there nature: a design flaw-greed, jelosy the solution: AI- never greedy, and they stick to there ethics no matter what.

Share this post


Link to post
Share on other sites
It''s a little hard to describe the problem, since I can''t type math formula. Here is the doc:
http://www.win.tue.nl/~gino/solid/jgt98convex.pdf

The subalgorithm is in page 5-6, maybe I forget something about the computation of delta.

Share this post


Link to post
Share on other sites
yes, a simplex in n dimensions is defined by n+1 points
but the mininum distance between origin point and the simplex is either distance between the origin & one point of the simplex, or between the origin & one line segment, or between the origin & a triangle.
I think i forget something in the caculation of lambda in page 5-6.

Share this post


Link to post
Share on other sites
you''re aware that there is a collision library out there, implementing the GJK stuff?

Solid

I am not sure of what you mean by transformation. All you need are support mapping functions, and doing the calculation in one object space or in world space is up to you.

Share this post


Link to post
Share on other sites