General Category > General Anim8or Forum
.an8 Format, jointangles, how are they stored?
SubDrag:
Sorry I was gone for a week, thanks for the reply! I'm trying to go from FBX format into anim8or format. It seems like XYZ euler angles in FBX. I sort of deduced similar to what you had, but I'm getting lost in getting from my euler, adjusted to the relative to parent bone. Not sure if you have done something similar and have at least pseudocode on how to do the conversion? I can't figure out the math to go from my euler, such as 15, 30, 45, to an euler relative to parent bone. Please help! Maybe assuming have parent's bone quaternion, and your XYZ euler relative to parent, how to go to anim8or XYZ.
I was able to get the skeleton fine translated, it's just the keyframe angles themselves that won't translate. I made a 0 sized node, which matched the way I had the FBX, in between bones, and those were used for rotations. I believe the issue is just translating rotations properly.
Here's my attempt at least...
FBX: http://goldeneyevault.com/priv/an8conversionattempt/animation.fbx
An8 (skeleton nodes):
FBX: http://goldeneyevault.com/priv/an8conversionattempt/animation.an8
SubDrag:
Perhaps someone can help, I feel like sort of closer, perhaps the piece I am missing is still, how anim8or stores its angles.
I have a quaternion at a bone (absolute quaternion, basically, I trawled the hierarchy), that I'm doing rotation in anim8or of:
x 0.52576530 float
y 0.084034257 float
z 0.40772036 float
w 0.74180400 float
Off of this bone, in FBX format, a rotation (Euler XYZ of 58.675510 y=33.600880 z=38.327244), yields in anim8or 30 60 90, which matches and works great. However, converting to anim8or also always yields a second solution for anim8or, in this case, -150 120 -140. I cannot figure out why in anim8or, that set of angles yields a different rotation visually. The quaternions should be identical (or 360 degrees off). Maybe someone can explain why those two rotations do not yield identical results about that bone, that would be very helpful!
I've attached the sample an8, go to sequence mode, then use this part:
Steve:
Quaternions encode more than Euler angles. There are two unit queternions for a given Euler orientation. If you interpolate between q1 and q2 using the shortest path it traces a great circle path on the unit sphere. For example a path from New York to London across the Atlantic Ocean. If you substitute q2' (the alternate quaternion for q2) the shortest path in quaternion space is the long way around the sphere over the Pacific Ocean. So one way to think of it is that queternions encode a directional bias as well as an orientation.
When I return home in mid July I'll post a detailed description of what is happening but it's too difficult to do with a tablet.
Deepthought:
maybe could you put something on how anim8or handles quaternions? maybe like a short example on drawing the bones in opengl
Steve:
Yes, I'll post the code to convert to and from Euler angles, interpolate quaternion angles, etc.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version