Skip to main content
GameDev.net gamedev.net
🔒 Locked

Loading ASE file rotations

Started by Yhoko Oct 16, 2006 at 7:37 AM 1 replies 1.1k views
Original Post
Yhoko
Yhoko
Good evening, I tried loading an ASE file but the rotation doesn't really work. The test file is nothing but a turning cube at position 0,0,0. What happens is that the cube rotates just as expected - but in 2 or 3 frames the rotation is corrupted. The first thing I did was checking the ASE file, but take a look for yourself:
Quote:
*CONTROL_ROT_TRACK { *CONTROL_ROT_SAMPLE 00160 0.0000 0.0000 -1.0000 0.0628 *CONTROL_ROT_SAMPLE 00320 0.0000 0.0000 -1.0000 0.0628 *CONTROL_ROT_SAMPLE 00480 0.0000 0.0000 -1.0000 0.0628 [...] *CONTROL_ROT_SAMPLE 10400 0.0000 0.0000 -1.0000 0.0628 *CONTROL_ROT_SAMPLE 10560 0.0000 0.0000 -1.0000 0.0628 *CONTROL_ROT_SAMPLE 10720 0.0000 0.0000 1.0000 6.2204 *CONTROL_ROT_SAMPLE 10880 0.0000 0.0000 -1.0000 0.0628 *CONTROL_ROT_SAMPLE 11040 0.0000 0.0000 -1.0000 0.0628 [...]
See this? Exactly 66 frames are stored with equal rotations and then there's 1 that doesn't fit the row (the last 33 frames match the others). First I thought this is just a angle correction; since you're adding up all past rotations the angle would go beyond PI*2 at this point, thus the rotation is inverted to go back to 0 or something. Wrong! The 66 Frames before make up a total of 4.1448 which is way lower than PI*2. So what the hell is going in here, does anyone have experience with this? Side note: Correcting the two values by hand does perfectly fix the rotation. Thanks for help, Yhoko
Yhoko
Yhoko
Additional note:

When you compare the broken line to the line before you'll notice that:
Quote:
*CONTROL_ROT_SAMPLE 10560 0.0000 0.0000 -1.0000 0.0628
*CONTROL_ROT_SAMPLE 10720 0.0000 0.0000 1.0000 6.2204


0.0628 + 6.2204 = 6.2832 which would explain my first thought. But since you have to add up *all previous rotations* and not just the last line, this wouldn't make any sense. Might this be a bug in the 3ds ASE exporter?
Yhoko
Yhoko
Nevermind, the ASE is correct. The problem was in my quaternion code.

Can be closed.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.