0

Heya I'm currently working on my Degree Final year project, which is 2 part A) Creating a good 3D Engine and B) within it implement an IK System and evaluate a couple of types of IK solving. CCD (Cyclic-Coordinate Descent) is where I have begun and I have run into a problem. I've used lots of sources to try and get to grips with IK's, and specifically when it comes to CCD I have used Source Code as a base available here : http://www.darwin3d.com/gdm1998.htm

Before I start posting my Source code, I'm hoping that my problem is something obvious or simple that someone has come across before. Here is a short video showing the problem : http://www.youtube.com/watch?v=XtU8rFR-DuE

Obviously it is not right, The IK spins off and generally seems to get confused alot! If the target stays still then it converges fine but even the smallest movement (which happens alot in this system as the Target is driven by IR based Motion capture in my Engine) and it seems to recalculate and begin the spinning again.

Also when the Joint is out of range you would assume that following CCD technique, the Joints would all point at the Target and just hit the Loop limit but you would still have the IK aim in the right way, but as is evident in the video if the target is out of range the IK again just sits iterating away and spinning.

If anyone can help I would Really! appreciate it. and if any more information is needed (code etc) then feel free to ask.

Thanks in advance Chris

4

1 回答 1

0

很多事情都可能是错误的;你必须调试你的程序。

对于每个关节:

  1. 检索目标位置target和末端执行器位置end
  2. 计算新的关节值q,知道关节的变换。
  3. endNew计算新关节值的末端执行器位置q

如果 to 的距离end小于 totarget的距离endNew,则target您发现了一个错误(所有旋转都是错误的)。该错误可能q在 2. 中的选择中,或者在 1. 和 3. 中的末端执行器位置的计算中。

我不愿意使用其他人的随机示例代码(甚至我自己的)。Lander 例如写道

CrossProduct(&curVector, &targetVector, &crossResult);
NormalizeVector(&crossResult);

但是我们确定这不会因除以零而崩溃(例如 if curVector = -targetVector)吗?

如果关节是旋转的(而不是像 Lander 的示例中那样是球形的),那么请参阅 Lander 的数学参考资料中的 Wang & Chen。

于 2011-03-10T01:43:59.997 回答