Polpatch Posted October 15, 2015 Share Posted October 15, 2015 Hi People,I have imported a rigged model (dude model https://github.com/BabylonJS/MeshesLibrary/tree/master/Dude) in my project, the method scene.beginAnimation() works so i suppose that the skeleton is already attached to the mesh. I want to rotate a bone of this skeleton but i can't reach this goalThe code that i used is the following:engine.runRenderLoop(function () { var bone = scene.getSkeletonByName("Skeleton0").bones[20]; //I've tried different bones var boneMat = bone.getWorldMatrix(); BABYLON.Matrix.RotationXToRef(0.1, boneMat); bone.updateMatrix(boneMat); scene.render();}I have no result, do you have some hint? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 15, 2015 Share Posted October 15, 2015 Hello could you please provide a playground demo? Quote Link to comment Share on other sites More sharing options...
adam Posted October 15, 2015 Share Posted October 15, 2015 Here is a possessed dude that can help you: http://www.babylonjs-playground.com/#WBIXK#1 Polpatch 1 Quote Link to comment Share on other sites More sharing options...
Polpatch Posted October 15, 2015 Author Share Posted October 15, 2015 mmm.. i don't know how to modify the method engine.runRenderLoop() of babylonjs playground, I suppose it's called in an unreachable area. I can upload my entire code.http://pastebin.com/wf4QvDja Quote Link to comment Share on other sites More sharing options...
Polpatch Posted October 15, 2015 Author Share Posted October 15, 2015 Here is a possessed dude that can help you:http://www.babylonjs-playground.com/#WBIXK#1maybe i can find here the answer... i'll try it later Quote Link to comment Share on other sites More sharing options...
Polpatch Posted October 16, 2015 Author Share Posted October 16, 2015 Here is a possessed dude that can help you: http://www.babylonjs-playground.com/#WBIXK#1 k, I did it Thanks to you i understand the potentialof registerBeforeRender() method ahahaI have also changed the way of give the rotation to the bone, his rotation is clean as you can see:) http://www.babylonjs-playground.com/#WBIXK#5 I believed that the method .updateMatrix() would serve to update the value of the matrix, but clearly I was wrong. Thanks again guys... you're saving my life ahahha GameMonetize 1 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.