
Howdy,
I'm writing a proggy to play animations out of ASE files. So far, everything works fine but the camera. It's a target camera which I handle using D3DUtil_SetViewMatrix (DX7). As far as I can see, the translations are relative to the initial point (i.e. *TM_POS). So I subtract this value from the possamples (*CONTROL_POS_SAMPLE). The same is done for the lookat point, i.e. camera.target. Now, instead of the expected animation, the camera stands right above the objects and as I move through the animation, the camera gets lower (closer to the objects). I was ignoring the rotation of the camera, so that may be the reason.
Somewhere I read that the rotation is written in form of quaternions, where the first 3 values are the vector, and the last is the angle: x,z,y,w (note that Max swaps Y and Z). Also it says that the rotsamples are relative, so if I need rotsample 5, I multiply quaternions 05 together, and then I convert this to a matrix. All this is done using D3DUtil and D3DMath functions, so the possibility of incorrect quaternion multiplication, etc. is thrown away. The view matrix is multiplied by the matrix from the quaternion, then the resulting matrix is multiplied by the projection matrix. But now it gets even worse. The whole thing seems distorted.
Any ideas of what I might be doing wrong? I was also searching for a source code of something similar, but without any luck so far. If anyone knows where I can find one, that would be of great help too.
