(おそらく、これは数学スタック交換に適していますか?)
私は骨で構成されたチェーンを持っています。各ボーンには、先端と尾のある があります。次のコードは、指定された回転で先端がどこにあるかを計算し、次のリンクをチェーンの位置に適切に設定します。
// Quaternion is a hand-rolled class that works correctly (as far as I can tell.)
Quaternion quat = new Quaternion(getRotationAngleDegrees(), getRotation());
// figure out where the tip will be after applying the rotation
Vector3f rotatedTip = quat.applyRotationTo(tip);
// set the next bone's tail to be at this one's tip
updateNextPosFrom(rotatedTip);
これは、オブジェクトの座標系の原点を中心に回転が発生する場合に機能します。しかし、オブジェクト内の他の任意の点を中心に回転させたい場合はどうすればよいでしょうか? 四元数の変換方法がわかりません。それを行う最良の方法は何ですか?
(JOGL / OpenGLを使用しています。)