|
|
Hey, new to the site and also new to using Physique for animation exporting. Just a couple of question, to clear things up.
First i have already written a character exporter using max's triangle strips, (running 3D Max 6) And all objects rendering fine in my OpenGL program (with texture and normals all working great), now i have started to work on animation but im getting confuesed on a few issues since this is my first time doing anything like this.
my first problem is when i get the Physique vertex count, the number is much less then the number of vertices in the model, now im assuming that this is correct because its only giving me the vertices that are affected by the bones, am i correct with this assumption?
the second problem is getting the bone(Translation matrix for each bone). at the same time as getting the weights for the bones i call GetNodeTM(T) to get the transformation matrix. heres a bit of the code:
// Get Bone 1 and Bone 2
for (n = 0; n < RigidBlended_vtx->GetNumberNodes(); n++){
INode* Bone = RigidBlended_vtx->GetNode(n);
OffsetVector = RigidBlended_vtx->GetOffsetVector(n);
// get the weight of this bone
Weight[n] = RigidBlended_vtx->GetWeight(n);
/////////////////////////////////////////////////
pdebug = fopen("D:\Bone.txt", "a");
fprintf(pdebug , "Bone weight%d: %fn", n , Weight [n ]);
// Get the Bones TMatrix at the same time (T is the Key Frame time)
BoneTM[n] = Bone->GetNodeTM(T) * Inverse(Bone->GetParentTM(T));
// write data to export file......
}
|
Now, is this code correct? the data i gets doesn't seem to be right, here is what i get:
----- Number Key Frames : 100 -----
----- Number AKey Frames: 0 -----
----- Bone Info----------------
-------------------------------
-------------------------------
----- Number of Vertices: 128 -----
----- Bone Influences: 1 -----
Bone weight: 1.000000
Bone TransM - x:1.000000, y:0.000000, z:0.000000
Bone TransM - x:0.000000, y:1.000000, z:0.000173
Bone TransM - x:0.000000, y:-0.000173, z:1.000000
----- Bone Influences: 1 -----
Bone weight: 1.000000
Bone TransM - x:1.000000, y:0.000000, z:0.000000
Bone TransM - x:0.000000, y:1.000000, z:0.000173
Bone TransM - x:0.000000, y:-0.000173, z:1.000000
----- Bone Influences: 1 -----
Bone weight: 1.000000
Bone TransM - x:1.000000, y:0.000000, z:0.000000
Bone TransM - x:0.000000, y:1.000000, z:0.000173
Bone TransM - x:0.000000, y:-0.000173, z:1.000000
----- Bone Influences: 1 -----
Bone weight: 1.000000
Bone TransM - x:1.000000, y:0.000000, z:0.000000
Bone TransM - x:0.000000, y:1.000000, z:0.000173
Bone TransM - x:0.000000, y:-0.000173, z:1.000000
----- Bone Influences: 2 -----
Bone weight0: 0.500000
Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
Bone TransM - x2:0.000000, y2:1.000000, z2:0.000033
Bone TransM - x3:0.000000, y3:-0.000033, z3:1.000000
Bone weight1: 0.500000
Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
Bone TransM - x2:0.000000, y2:1.000000, z2:0.000173
Bone TransM - x3:0.000000, y3:-0.000173, z3:1.000000
----- Bone Influences: 2 -----
Bone weight0: 0.500000
Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
Bone TransM - x2:0.000000, y2:1.000000, z2:0.000033
Bone TransM - x3:0.000000, y3:-0.000033, z3:1.000000
Bone weight1: 0.500000
Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
Bone TransM - x2:0.000000, y2:1.000000, z2:0.000173
Bone TransM - x3:0.000000, y3:-0.000173, z3:1.000000
----- Bone Influences: 2 -----
Bone weight0: 0.050000
Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
Bone TransM - x2:0.000000, y2:1.000000, z2:0.000033
Bone TransM - x3:0.000000, y3:-0.000033, z3:1.000000
Bone weight1: 0.950000
Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
Bone TransM - x2:0.000000, y2:1.000000, z2:0.000173
Bone TransM - x3:0.000000, y3:-0.000173, z3:1.000000
----- Bone Influences: 2 -----
Bone weight0: 0.250000
Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
Bone TransM - x2:0.000000, y2:1.000000, z2:0.000033
Bone TransM - x3:0.000000, y3:-0.000033, z3:1.000000
Bone weight1: 0.750000
Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
Bone TransM - x2:0.000000, y2:1.000000, z2:0.000173
Bone TransM - x3:0.000000, y3:-0.000173, z3:1.000000
----- Bone Influences: 2 -----
Bone weight0: 0.250000
Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
Bone TransM - x2:0.000000, y2:1.000000, z2:0.000033
Bone TransM - x3:0.000000, y3:-0.000033, z3:1.000000
Bone weight1: 0.750000
Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
Bone TransM - x2:0.000000, y2:1.000000, z2:0.000173
Bone TransM - x3:0.000000, y3:-0.000173, z3:1.000000
----- Bone Influences: 2 -----
Bone weight0: 0.250000
Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
Bone TransM - x2:0.000000, y2:1.000000, z2:0.000033
Bone TransM - x3:0.000000, y3:-0.000033, z3:1.000000
Bone weight1: 0.750000
Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
Bone TransM - x2:0.000000, y2:1.000000, z2:0.000173
Bone TransM - x3:0.000000, y3:-0.000173, z3:1.000000
|
Notice how the data seems repetitive with different bones, each chunk is a vertex (chunk starts with --Bone Influences--), is this still correct? (i have removed alot of the data, but its the same, just different chucks put together)
I have a couple more questions but this one is getting to long, ill ask them after these have been answered, thanks for all your help.
|