Jump to content

Finding the real world position of a vertex that is driven by a joint


JonVarner
 Share

Recommended Posts

Hey all, I am currently working on a project that has a mesh driven by joints. However, during the animation I need to be able to determine the actual real world position for one of the vertices. I have tried

.getVerticesData(BABYLON.VertexBuffer.PositionKind, true)

This gives me the position of the vertex(s)  at its starting point and not where it actually is as it deforms. I also tried

BABYLON.Vector3.TransformCoordinates(vertex, mesh.getWorldMatrix()

This of course gave me the real world coordinates of the vertex at its starting point. Again not quite what I was after.

So I guess I am hoping that someone can point me in the direction of finding the location of a vertex after it has been moved by a joint. Thanks.

 

Link to comment
Share on other sites

Hello! unfortunately (in your case) the bones are processed on GPU side to be fast!

So you cannot get the real world value of a vertex directly unless you turn off the GPU processing. It is possible but it will consume more CPU.

You can do it with mesh.computeBonesUsingShaders = false. In this case all the transformed values will be in  getVerticesData(BABYLON.VertexBuffer.PositionKind, true)

 

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