Calculating InverseTransformPoint outside unity

Hi,

I need to calculate InverseTransformPoint of some points, but without using unity classes (multithreading issue). Do you know a code piece or a good straightforward reference that I can implement this function quickly?

In short:

 GameObject g= new GameObject(); var result = g.transform.InverseTransformPoint(new Vector(1,2,3)); // Now, imagine doing this outside Unity.

What I want is the code that does InverseTransformPoint.
Thank you.

You are trying to convert a world space into local space.

You need to define your local space matrix and multiply your point by that matrix.

Your local matrix is (if I remember right) the composite matrix of your new origin.