Vector methods mutate the source vector (ex. vector.add(vector2) will change the original vector.)
You can use clone() to preserve the original vector.
const vectorA = new THREE.Vector3(1.0, 2.0, 3.0);
const vectorB = vectorA.clone().applyMatrix4(matrix); // vectorA will remain untouched
No this is not i am looking for. Actually i am taking some points and applying the matrix4 to place them properly in the model. Now my task is to again save them back to the db but for this i have to remove the applied matrix effects.
Is there any way to redo the matrix effect ?
An example
This is my vector point
{x: -1973.239999999998, y: 1731.13836, z: 15}
See this thread as to whether it is something you should be aiming for performance-wise (instead of just saving the original coordinates to point.userData.)
Three does have a Matrix4.invert() method (in earlier builds it’s Matrix4.toInverse.)