Help! About GJK algorithm!

Started by
6 comments, last by gotton 20 years, 2 months ago
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!
Advertisement
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.
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
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.
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
Uh, a simplex in n dimensions is defined by n+1 points. (triangle in 2d, tetrahedron in 3d etc)
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.
Is there any transformation needed in GJK algo?
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.

Everything is better with Metal.

This topic is closed to new replies.

Advertisement