Jump to content

【Help】How to update Bone's WorldMatrix()?


BangTao
 Share

Recommended Posts

First,by this PG,I can use "BABYLON.Vector3.TransformCoordinatesToRef(tmpPos, mesh.getWorldMatrix(), sphere.position);" to get the rotated position of each vertex.

http://www.babylonjs-playground.com/#GAY2K#0

 

Then,here is the BJS's "Dude.babylon" file,and i don't know how to get the right WorldMatrix after it's changed(see console.log() message).Am i missed some steps?or...

http://www.babylonjs-playground.com/#1PN9TO#5

 

Thx!

Link to comment
Share on other sites

I think it should keep changing?just likehttp://www.babylonjs-playground.com/#GAY2K#1(Line 56-57),so i can compute and get the childrenMesh's vertex position.

skeletons[0].bones[0].getAbsoluteTransform().multiply(mesh.getWorldMatrix())

the output is always the same,seems i can't use this to get the vertex's position..

@adam

Link to comment
Share on other sites

I've tried many timers ....I failed....i can't get the vertex corresponding to the bone,and every bones's matrix is still unchange.....

I'm thinking that why we can see the animation,and erevy part is at the right place.but we just can't get the right position。

i'll keep investigation。

Any way,thx.

@Wingnut

@JohnK

@adam

@Deltakosh

This is the  most tough thing i've meet ever.No clue...

【---------------------------------------------------------------------------------------------------------------】

【....】

【Can i get the finall vertex's position at http://www.babylonjs-playground.com/#1PN9TO#7

【---------------------------------------------------------------------------------------------------------------】

And why i can't search anything about "getAbsolutePositionFromLocal" at PlayGround,it has an error//

Link to comment
Share on other sites

  • BangTao changed the title to 【Help】How to update Bone's WorldMatrix()?

 i know the third method,:).But i don't wanna attach mesh to bone...

I wanna compute and get the vertex...How to use transformMatrices(Maybe i can use this to calculate the position..)?the result of "console.log(skeletons[0])":

58de4b085b7a1_2PGN)JUZ85UXZ4FV8GA.png.8d2d2e9472548e3e7e097beaba8876d1.png

Now , i have the Initial status vertex's position information,i want to get the whole changed position at the "scene.registerBeforeRender(function(){...})".

 

 

 

Just found another thing,but  i don't know if it will help,which is convert skeletal animation to point caching...Anyone knows 3dsMax?

Link to comment
Share on other sites

I through in that last attachToBone example because it isn't entirely clear to me what you're trying to do.

Anyway, you need to get the vertex position relative to the bone it is being influenced by.  You should do this before your animation starts.  I'd use bone.getLocalPositionFromAbsolute using the world position of the vertex.  Then you can use the code in the example above to track the vertex.  It might not be perfect because vertices are often influenced by more than one bone.

Link to comment
Share on other sites

Sorry to butt-in, but BT... is this needed for an "inverse kinematic" situation?   An example would be... you need the fingertip of an avatar model... to land exactly on a button.

With IK, you could "pull" the verts on the fingertip... TO the button (and it would look natural because of reverse transformation calcs).  But I think you'd need to write your own IK stuff.

SOME of this issue... might be solvable... using the old "parent and position a tiny invisible box" solution.  But, even that tiny box... would need to be influenced by the same bones as the verts it surrounds.  (or else it won't move with the skin).  Up to 3 bone influencers on mobiles, and 4 otherwise.

BT... mad scientist.  :)  Love it. 

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...