Rotation World Space To Local Space

Yo @Deltakosh … or @sebavan . or anyone :slight_smile:

In unity… They have Local Euler Angles and World Euler Angles.

Do we have such a thing in Babylon.

Right now for positions… If i have to convert some position vector3 from World Space to Local Space… I wrote this handle little wrapper for transform coordinates…


        /** Inverse transforms position from world space to local space. (Using TransformCoordinates) */
        public  static InverseTransformPoint(owner: BABYLON.TransformNode | BABYLON.Camera, position:BABYLON.Vector3, compute:boolean = false):BABYLON.Vector3 {
            if (compute === true) owner.computeWorldMatrix();
            BABYLON.Utilities.TempMatrix.reset();
            owner.getWorldMatrix().invertToRef(BABYLON.Utilities.TempMatrix);
            return BABYLON.Vector3.TransformCoordinates(position, BABYLON.Utilities.TempMatrix);
        }

How would I do something like that for World Space to Local Space Rotations… Or is there even such a thing for babylon ???

Hey, there is BABYLON.Space.Local and BABYLON.Space.World

I haven’t really used them yet, so maybe someone else could help you out or you can read about it here:

https://doc.babylonjs.com/babylon101/position

https://doc.babylonjs.com/features/position,_rotation,_scaling

I saw that… but don’t see how you would transform rotation like transform coordinates