Jump to content

Animation of rigged Mesh at runtime


Polpatch
 Share

Recommended Posts

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 goal

The 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?

Link to comment
Share on other sites

Here is a possessed dude that can help you:

 

http://www.babylonjs-playground.com/#WBIXK#1

 k, I did it :D

Thanks to you i understand the potentialof registerBeforeRender() method ahaha

I 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 :D ahahha

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...