General Category > General Anim8or Forum
.an8 Format, jointangles, how are they stored?
SubDrag:
I'm trying to convert some animation data into .an8 format, for use by anim8or. My original data is stored in euler angles, where you rotation each joint by X, then Y, then Z.
Unfortunately, setting anim8or rotations for a joint angle to that, doesn't get the correct rotation. How are anim8or rotations stored for joint angles, and how do I convert it?
For example, euler angles of 0 X, 90 Y, 90 Z do not yield correct rotations in anim8or. Below yields the wrong ones.
jointangle { "11-13" "X"
track {
floatkey { 0 0 0 0 "C" }
floatkey { 15 0 0 0 "C" }
floatkey { 54 0 0 0 "C" }
floatkey { 67 0 0 0 "C" }
floatkey { 89 0 0 0 "C" }
}
}
jointangle { "11-13" "Y"
track {
floatkey { 0 90 0 0 "C" }
floatkey { 15 90 0 0 "C" }
floatkey { 54 90 0 0 "C" }
floatkey { 67 90 0 0 "C" }
floatkey { 89 90 0 0 "C" }
}
}
jointangle { "11-13" "Z"
track {
floatkey { 0 90 0 0 "C" }
floatkey { 15 90 0 0 "C" }
floatkey { 54 90 0 0 "C" }
floatkey { 67 90 0 0 "C" }
floatkey { 89 90 0 0 "C" }
}
}
My bone structure, is composed of 0 sized joints, and bones connecting each 0 length joint, and all rotations are around just joints.
Using these axes in my source data:
Raxx:
Hi SubDrag, are you sure the animation data is in euler angles and not quaternions? Anim8or stores animations in euler angles (XYZ). In the floatkey block, it's { <frame #> <euler angle> <knot values/types/misc> }
I tested the (0, 90, 90) rotation on a figure's bones, and in the object editor on a cylinder, and they both behave as expected. Can you attach an example animation dataset and the desired outcome?
Also, other programs sometimes flip or switch one or more Axis'. Make sure you're actually translating the right ones.
SubDrag:
It doesn't appear to be euler angles, at least, not the axes I'm using. Here is my sample file.
I am setting a "leaf" part, at a joint "bone" 14, to 90,90,0.0. In order to make it match what it should be, you would need to set -90,90,0. But there's not a simple pattern.
It should look like "expected.png". It results in anim8orresult.png. Also, weird, for that same part 14, is that (anim8or angles only) 90,90,90 is equal in anim8or to 0,0,90, which shouldn't be true if euler. If it were true euler, this would not be true.
Below are my tests of correct euler, vs anim8or.
Expected Anim8or needed to match
90,-90,0 90,90,0
-90,90,0 -90,-90,0
90,90,0 -90,90,0
-90,-90,0 90,-90,0
90,0,-90 90,0,-90
-90,0,90 90,0,90
90,0,90 -90,0,90
-90,0,-90 -90,0,-90
0,0,90 90,90,90 0,0,90
You can also see, that the FBX file (imported into a tool, such as XSI), with those rotations matches my picture...so anim8or isn't straight euler.
Anipov tool, open source, does not convert the rotations properly either to milkshape format, even when "fixed" in anim8or. So this doesn't seem well known unfortunately.
Claude:
This is bone 14 in figure mode and front view.
Y blue to the right same direction as the bone
X green to the bottom of the screen
Z pink toward the user
right handed
Is this what you are using?
Raxx:
Honestly, Anim8or's orientation system always drives me nuts when trying to implement code around it. My observations:
* Orientations in shape properties in the object editor are Pitch-Yaw-Roll. However, Edit->Rotate is different, doing Axis-Angle rotations (as far as I can tell). If you set Edit->Rotate->Custom... to (45, 45, 45), you get different results than if you individually did (45, 0, 0), (0, 45, 0), (0, 0, 45) or any combination of those (I've tried every 45/-45 combination, nothing matches (45, 45, 45). Shape PYR orientations are stored as Quaternions in the .an8 file. My assumption is that Anim8or converts PYR to Quaternions internally and uses Quaternions for transformations, then converts back to PYR for user reference.
* The figure editor uses PYR (stored as Quaternions). The sequence editor uses Axis-Angle (stored as angles). Again, I have no idea how to convert between these two.
I'm going to be diving into the figure/sequence editor parts of the .an8 file soon, since loading animations is my next goal for the 3D viewer and .an8 file converter. Hopefully I can figure it out then, but it'd be awesome if someone in the know could shed light on how Anim8or converts between PYR, Quaternions, and Axis-Angle values.
Navigation
[0] Message Index
[#] Next page
Go to full version