Hi guys,
I want to read the rotation keyframes from an ASE file.
I find the following informations:
*CONTROL_ROT_TRACK {
*CONTROL_ROT_SAMPLE 800 0.0000 0.0000 -1.0000 0.0817
*CONTROL_ROT_SAMPLE 1600 0.0000 0.0000 -1.0000 0.1948
*CONTROL_ROT_SAMPLE 2400 0.0000 0.0000 -1.0000 0.2325
*CONTROL_ROT_SAMPLE 3200 0.0000 0.0000 -1.0000 0.1948
*CONTROL_ROT_SAMPLE 4000 0.0000 0.0000 -1.0000 0.0817
}
The first number is the time in ticks at any keyframe, the other four elements are a quaternion. The animation in 3DStudio Max must rotate the object by 45 degreed around the z axis.
How I can use these informations for my engine?
Google for quaternion math and SLERP (spherical-linear interpolation). The idea is to represent rotations as quaternions, interpolate the quaternions between two keyframes and use the result to set the final modelview matrix, or bone rotation, or whatever.
Quote from: "spasi"Google for quaternion math and SLERP (spherical-linear interpolation). The idea is to represent rotations as quaternions, interpolate the quaternions between two keyframes and use the result to set the final modelview matrix, or bone rotation, or whatever.
The problem is that the dot product between the two quaterions is more than 1.0f. So I can't realize the SLERP. I think that the quaternions are in some unknow format.
Can anyone help me ?
Please, can anyone tell me exactly how compute this rotation?
I have a class for Quaternion and the SLERP method. Please, help me :(