jsantell/THREE.IK

SkinnedMesh gltf character distorted mesh

Closed this issue · 10 comments

arpu commented

trying to get a gltf avatar model with this greate THREE.IK

the bones looks like correct for me only the mesh is bind wrong

THREE.IK master and aframe 0.9 with THREE 101

https://efficient-tote.glitch.me/

@arpu thanks for reporting! Possibly related to #9 and handling the correct orientations of the bones -- do you know what software generated this model, or it's expected joint orientation?

arpu commented

i have created this model with mixamo and blender like described in this blog post
https://www.donmccurdy.com/2017/11/06/creating-animated-gltf-characters-with-mixamo-and-blender/

arpu commented

ok i have done some more testing with new blender 2.80 beta ( importing the fbx from mixamo and export it with gltf exporter) result looks similar
https://truthful-web.glitch.me

THREE.IK expects +Z to be facing the children joint; this is a potential solution to not requiring a specific orientation of skeleton, as all tools handle it differently

arpu commented

i have to less knowledge on this, for what is the best solution for this

@arpu

After doing the axis conversion to +Z Forward on your mesh, the bind matrices are fixed :)

https://dashing-floor.glitch.me/

There is now a utility in the AxisUtils.js file called setZForward. Using this function on the root bone will reset the bone quaternions / positions to follow a +Z Forward coordinate system. @jsantell I'd like your feedback on where you think this utility should go :)

This is the code I added to your project. I had to rebind two meshes because both of them are using the same skeleton.

setZForward(rootBone);
rigMesh.bind(rigMesh.skeleton)
rigMesh2.bind(rigMesh2.skeleton)
arpu commented

@sneha-belkhale this is awesome! thank you so much!

would be cool if you want to join my little discord server, for my freetime side project
https://discord.gg/cNfG834

Thanks to @sneha-belkhale, I think with #9, this should be solved, how does it look @arpu?

arpu commented

yeahh this works now fine