Re: 実験 -
sio29 2011/02/19(Sat) 19:51
No.7420
で以下メモというか、特定の誰か宛なのですが…^^;)
MKMもVMDも中身はQuaternionなのでオイラー角への変換は必要ありません。
MKMとVMDでは座標系が違うようなので以下の変換が必要です。
//MKMのローカル座標系に変換したQuaternionからMMDのQuaternionへの変換
static QUAT EXPQuat_MMDQuat(const QUAT &n){
QUAT n2;
n2.x=-n.x;
n2.y=-n.y;
n2.z= n.z;
n2.w= n.w;
return n2;
}
//MKMのローカル座標系に変換したTranslateからMMDのTrnaslateへの変換
static FVECTOR EXPTrans_MMDTrans(const FVECTOR &n){
FVECTOR n2;
n2.x= n.x;
n2.y= n.y;
n2.z=-n.z;
return n2;
}
QUATとFVECTORは以下の構造体です
struct QUAT{
float x;
float y;
float z;
float w;
};
struct FVECTOR{
float x;
float y;
float z;
};