Matrix TransformCoordinates - reverse proces

Hi

I’m using this at the moment:

var transformMatrix = someTransformMatrix;
var pointA = new Vector(1,2,3);

var point B = Vector3.TransformCoordinates(pointA, transformMatrix);

Now is there a way to reverse this process, by just having pointB to get pointA Vector? Like a “MagicalReversingMethod” on Vector3 that will reverse it?

var transformMatrix = someTransformMatrix;
var pointA = new Vector(1,2,3);

var point B = Vector3.TransformCoordinates(pointA, transformMatrix);

var pointAclone = Vector3.MagicalReversingMethod(pointB, transformMatrix);

///pointA === pointAclone

I really cant find this “MagicalReversingMethod” that will reverse that process. Is there anything like that?

Regards
Peter

You can invert a known matrix using Matrix | Babylon.js Documentation

Or are you asking something more complicated?

1 Like

Yup as @JohnK mentionned,

var point B = Vector3.TransformCoordinates(pointA, transformMatrix);

var pointAclone = Vector3.TransformCoordinates(pointB, transformMatrix.invert());
1 Like

Seb and John have already answered it, but I just wanted to leave a very nice video that explain the notion of inverse matrices in a very intuitive way: Inverse matrices, column space and null space | Chapter 7, Essence of linear algebra - YouTube

It’s not needed to use the function, but just a bonus to see how things work under the hood. :smiley:

3 Likes

@JohnK This is maybe it but how to use it?

@sebavan This is what I was searching for. Mentioning something from the docs is not always clear enough to explain how to use it.

So as a joint effort thank you guys so much for the help with this :slight_smile:

Regards
Peter

1 Like