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

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.


Share this post

Link to post
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)


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.