“the chosen initial direction is invalid, will produce (0,0,0) for a subsequent direction later”. Why is this ? Can you explain ? ]]>

I have one question. Could it be possible that your GJk-EPA is not able to calculate the penetration depth if the input data are laying in one plane? For example my test data got the form (x,y,0). I think your Tetrahedon will be a degenerate one in the xy-plane.

In your EPA if u try to find the closet triangle and afterwards the penetration depth, each triangle will contains the origin and the pen depth will be always zero.

Isnt it the right way to reduce in this case the problem to 2D and calculate the distance between origin and the line segments of one triangle ?