vinhpt Posted October 30, 2017 Share Posted October 30, 2017 Hi all! Please tell me what is Difference between position, rotationQuaternion of mesh and bone. Because when I apply same position and rotationQuaternion animations to same hierarchy parent-child meshes vs bones I get difference results - (bone-animations result seem wrong). How to correct bone-animations? Thanks Quote Link to comment Share on other sites More sharing options...
Wingnut Posted October 30, 2017 Share Posted October 30, 2017 Hi vinhpt! Could you please show us the problem... using a BJS playground scene? Perhaps you could start... with https://www.babylonjs-playground.com/#E49AL#7 and do some adjusting? Feel free to make more SAVEs in that PG series, and paste the new URL's to this thread. ie. #8, #9, etc Or perhaps that demo will answer your questions? Wingnut guess: One or many of your bones... already have unnoticed transformations applied. Their rotationQuaternions are not 0,0,0,1 when animation starts. I am newbie for bones/skeleton stuff. Smarter people will likely comment, soon, but... everyone LOVES having a simple playground that shows the problem. thx. Quote Link to comment Share on other sites More sharing options...
vinhpt Posted October 30, 2017 Author Share Posted October 30, 2017 Hi! My .babylons files is quite big so the playground not allow to save. So please see the .babylons file in this post: - ken_box2.babylon (no bone and animation playing is correct). This can run auto direct on http://sandbox.babylonjs.com/ - ken_box.babylon (has bone but animation playing is wrong - compare bones positions with above meshes positions). Cannot run auto on sandbox so add this lines in function BABYLON.SceneLoader.Load scene.beginAnimation(_scene.skeletons[0].bones[0], 0, 300, false, 1); scene.beginAnimation(_scene.skeletons[0].bones[1], 0, 300, false, 1); scene.beginAnimation(_scene.skeletons[0].bones[2], 0, 300, false, 1); Both files have the same X, Y, Z and Animations (the only difference is replace meshes <-> bones) I want correct the has-bone file. Help me please! Thanks! ken_box.babylon ken_box2.babylon Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 30, 2017 Share Posted October 30, 2017 Hello, bones matrix must be a difference matrix. The final matrix used in shaders is the following one: final = meshMatrix * (bone1Matrix * weight1 + .. + boneXMatrix * weightX) Quote Link to comment Share on other sites More sharing options...
vinhpt Posted October 31, 2017 Author Share Posted October 31, 2017 Hi Deltakosh! Thanks for your reply but can you explain more in detail. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 31, 2017 Share Posted October 31, 2017 The bone matrices are not full matrices but just a representation of the difference between a state (the current mesh world matrix) and new state 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.