Transform BabylonVector3 with BabylonMatrix


#1

Hi All,

Can someone please help me in implementing Transform functionality on BabylonMatrix?

For a given Vector3 and a Matrix, the method should apply Rotation, Scale and Translation and return the new Vector.

The functionality is there in SharpDx.Vector3 struct. I tried to understand it but confusing.
I then constructed SharpDx.Matrix from BabylonMatrix and performed the Transform using SharpDx.Vector but the results are not coming properly. Either my BabylonMatrix->SharpDx.Matrix mapping is wrong or Babylon uses a different algorithm for Transform.

Please help me. I am blocked for days.
Thanks in advance for your help.


#2

Well this is done by Vector3.TransformCoordinates (unless I misunderstood the question):
https://doc.babylonjs.com/api/classes/babylon.vector3#transformcoordinates