World velocity to local velocity

How to convert world or global velocity to the mesh local velocity?

A velocity being a vector, mutliplying it by the inverse of the world matrix of the transform node should do.

1 Like

I’m kinda lost.

Let’s say relative to the world, a direction vector2(0,0,1), but there is a cube rotated 180 degrees in the Y axis. So the direction relative to the cube would be (0,0,-1) right?

How to do that convertion? Could you give me a code example please?

UPDATE: Is this a solution?

It converts world cordinates to local coordinates. I suppose it works with directions too…? I’m gonna test it tomorrow.

yup exactly that

1 Like