Koroldev Posted November 15, 2016 Share Posted November 15, 2016 Hi all! Maybe my question is simple, but tell me please, how can I find out mesh.rotation(in world space), wich atached to bone? That one more mesh set in this rotation whitout using attachToBone. Because mesh, which attached to bone, rotation always equals 0, 0, 0 . Thank! Quote Link to comment Share on other sites More sharing options...
adam Posted November 15, 2016 Share Posted November 15, 2016 try mesh.rotationQuaternion Quote Link to comment Share on other sites More sharing options...
Koroldev Posted November 15, 2016 Author Share Posted November 15, 2016 Just now, adam said: try mesh.rotationQuaternion returns undefined Quote Link to comment Share on other sites More sharing options...
adam Posted November 15, 2016 Share Posted November 15, 2016 It sounds like your mesh is not rotated. Quote Link to comment Share on other sites More sharing options...
adam Posted November 15, 2016 Share Posted November 15, 2016 I think I'm starting to understand your issue. Try calling getRotation of the bone the mesh is attached to. bone.getRotation(meshOfTheSkeleton) https://github.com/BabylonJS/Babylon.js/blob/master/src/Bones/babylon.bone.ts#L554 Quote Link to comment Share on other sites More sharing options...
Koroldev Posted November 15, 2016 Author Share Posted November 15, 2016 3 minutes ago, adam said: bone.getRotation(meshOfTheSkeleton) But bone do not have function getRotation Quote Link to comment Share on other sites More sharing options...
adam Posted November 15, 2016 Share Posted November 15, 2016 Sorry, it's only available in preview release. https://github.com/BabylonJS/Babylon.js/tree/master/dist/preview release Quote Link to comment Share on other sites More sharing options...
adam Posted November 15, 2016 Share Posted November 15, 2016 Try this: var quat = BABYLON.Quaternion.FromRotationMatrix(mesh.getWorldMatrix()); var quat = BABYLON.Quaternion.Identity(); mesh.getWorldMatrix().decompose(BABYLON.Vector3.Zero(), quat, BABYLON.Vector3.Zero()); Koroldev 1 Quote Link to comment Share on other sites More sharing options...
Koroldev Posted November 15, 2016 Author Share Posted November 15, 2016 2 minutes ago, adam said: Sorry, it's only available in preview release. https://github.com/BabylonJS/Babylon.js/tree/master/dist/preview release It is the updated version of babylon and I just need to download this version, right? or what is it mean "preview release"? sorry because I am not strong in english Quote Link to comment Share on other sites More sharing options...
adam Posted November 15, 2016 Share Posted November 15, 2016 Yeah, you can just download the preview release. Koroldev and getzel 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.