LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Vifani83 on February 04, 2005, 08:41:22

Title: How read rotation from ASE file
Post by: Vifani83 on February 04, 2005, 08:41:22
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?
Title: How read rotation from ASE file
Post by: spasi on February 04, 2005, 10:09:16
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.
Title: How read rotation from ASE file
Post by: Vifani83 on February 04, 2005, 14:41:15
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 ?
Title: How read rotation from ASE file
Post by: Vifani83 on February 07, 2005, 00:54:44
Please, can anyone tell me exactly how compute this rotation?

I have a class for Quaternion and the SLERP method. Please, help me :(