Transform vector World to Tangent Space

I’m having issues finding how to do this kind of transform in c++ like the way it’s done in the material editor.

if anybody knows knows thanks for the help in advance.

Need more information, are you talking about transforming for an object in the world or for something in a custom shader?

To transform a Direction:


To Transform a Location:


well i’m trying to make a dynamic texture,which can have a world vector input into it and it applies the vector in the uv space based on the world