蒙皮骨胳计算问题

3 views
Skip to first unread message

数码猫

unread,
Dec 3, 2008, 9:45:37 PM12/3/08
to 3DGameStudy
骨胳的变换信息是递归的,每个骨胳都记录了当前骨胳的变换信息,需要乘以父骨胳的变换信息才可以的到真正的变换信息。
现在一般的变换信息都是通过矩阵方式实现的。但是我从wow里面获得的骨胳数据并不是以矩阵方式保存的,
他的保存方式如下。
首先是骨胳的信息 头是这样的
// block E - bones
struct ModelBoneDef {
int32 animid;
int32 flags;
int16 parent; // parent bone index
int16 geoid;
// new int added to the bone definitions. Added in WoW 2.0
int32 unknown;
AnimationBlock translation;
AnimationBlock rotation;
AnimationBlock scaling;
Vec3D pivot;
};
然后是 平移 旋转 缩放 的 AnimationBlock 类型是这样的
struct AnimationBlock {
int16 type; // interpolation type (0=none, 1=linear, 2=hermite)
int16 seq; // global sequence id or -1
uint32 nRanges;
uint32 ofsRanges;
uint32 nTimes;
uint32 ofsTimes;
uint32 nKeys;
uint32 ofsKeys;
};
他们的 times 结构是 一个 整形的数据,记载了本桢的时间
keys 与 times 的个数总是一样的。
在这里面 平移和所放的 的keys 结构是 3个float
class Vec3D {
public:
float x,y,z;}
旋转的keys结构是 4个float

class Vec3D {
public:
float x,y,z,w}

我想我在进行递归计算的时候是不是 需要将他们的平移 旋转 缩放 分别相乘 得到新的 平移 旋转 缩放 数据然后 来计算该骨胳上的定点的 位置信
息?

Reply all
Reply to author
Forward
0 new messages