I came across this code snippet on a GitHub repository earlier, specifically related to three.js version r71.
mesh.position.set(100, 100, 100);
This method can also be applied for individual axis adjustments:
mesh.position.setX(200);
mesh.position.setZ(200);
For more information, you can refer to the official documentation here:
Here is a detailed explanation of how it works:
Since mesh.position is an instance of "Vector3", Vector3() provides setX(), setY(), and setZ() methods which allow for easy manipulation of object positions.
mesh.position = new THREE.Vector3(); // Here we create a new Vector3 for position
vector1 = new THREE.Vector3();
mesh.position.setX(100); // This sets the x-coordinate to 100
vector1.setX(100); // Same as above since both are Vector3 objects
camera1.position.setZ(100); // You can also adjust other coordinates similarly
light1.position.setY(100); // This method is applicable to any object's position