#### Archived

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

This topic is 5396 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 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 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 on other sites
This question should have been posted to the Maths & Physics Forum. I''m moving it there since it will get a better treatment from the M&P members.

Timkin

##### Share on other sites
Uh, a simplex in n dimensions is defined by n+1 points. (triangle in 2d, tetrahedron in 3d etc)

##### 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 on other sites
Is there any transformation needed in GJK algo?

##### 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.

1. 1
Rutin
31
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633313
• Total Posts
3011320
• ### Who's Online (See full list)

There are no registered users currently online

×