kcoley / gltf2usd

command-line utility for converting glTF 2.0 models to USD
MIT License
264 stars 38 forks source link

quaternion rotations are ignored on iOS/XCode #52

Closed kcoley closed 6 years ago

kcoley commented 6 years ago

Since iOS and XCode currently do not support quaternion xform rotations, add an option to convert quaternion rotations to baked linear Euler rotations:

https://github.com/kcoley/gltf2usd/issues/50

kcoley commented 6 years ago

I added a new flag called "--use-euler-rotation". Using this should get the rotations to work by converting the rotation quaternions to euler angles. Note that this won't be smooth for all animations.

wave-electron commented 6 years ago

@kcoley I was trying this out today, and basically if you rotate more than 180 degrees in one direction it jumps a little. Is that because of gimbal lock when using euler rotations? i'm assuming quaternion rotations don't suffer the issue.

kcoley commented 6 years ago

@wave-electron yes, I think it is gimbal lock related. I am currently using the USD apis to directly convert the quaternions to euler angles. I'm hoping an iOS update would support quaternions, but in the meantime, I may try to come up with a better algorithm to prevent the jumps.