@GOM
Python is being unkind to me tonight and I can't find
my bug yet, but I still wanted to clarify two things:
(1) Went through the quaternion to yaw, pitch, and roll
and I think I'm following the same conventions. Meaning I
followed my quat vs euler matrices and worked through your
QuatToEuler function and I arrive at the same ATan2
relations for the angles. So I think
your code for rotations x, y, z -> roll, pitch, yaw is right
without having to interchange roll->pitch, pitch->yaw, and
yaw->roll. Does Milkshape really require this (excluding the roll
minus sign)?
(2) Byte counts: My example last night was for the CR_spear_charge.cas
which is a small one (7 KB) . If I count bytes this way
Code:
5 - header
nframes*NBONES*4*4 - quaternion block
nframes*NBONES*4*3 - pose block
nframes*4*3 - global block (only bone_pelvis)
nframes*4*3 - relative block (only bone_pelvis)
40 final bytes, or 10 float - leftovers
Last 8 bytes always seem to be FF FF 0F 00 00 00 00 00, so maybe a
terminating signature.
This seems to square with the bytelength in the index file so I think
this is ok. For 11 anim frames I get 33+33+10=76 floats that I had last
night. So the global block and the relative block track the movement
of the single bone_pelvis to give the overall traversal of the model, and
the quaternions give the relative animation?
The game then seems to be, merge a .cas with a .ms3d and write the
anim stuff to the joint section, suitably merging the global and relative to
the pose data, since Milkshape doesn't have extra places for this, and
put the transformed quats into the rotation angles part. Reverse process
is separate the global and relative from the position vectors, reconvert
angles back to quaternions and write out a new .cas.
Is the jerky nature of the unpacked .cas files simply that the number of
bones in the standard skeleton for M2TW is different from RTW so the anim
frames aren't coming out right? Caliban has hinted that someone could
simply (simply?) change the MaxScript script to fix this but no one has
stepped to the plate.
Back to fighting Python, I can see the data I want in xvi32 put it won't print
out for me. This is finally the end for me, it's easier to simply read the data
in hex than it is to try to print it out.
Bookmarks