I am working in new 3d editor for printing systems based on the threeJs editor but there is a needed to change default coordinate system from y-up to z-up. By searching in communities found some snippet code to implement that:
camera.up.set(0, 0, 1);
and rotate grid 90 ْ :
grid.rotateX(Math.PI / 2);
That’s work but occurs other problems:
Cannot drag 360 ْ up-down it’s limited to 180 ْ
Grid does not move in the same direction as the mouse drag for example you drag from left to right but grid revolves in up-down by some angle
It is a property of the Object3d and as such for the camera, and had helped me resolving a camera rotation issue (deprecating, now apparently ‘object.rotation.order’) . But you’re right, it is only for applying rotations using Euler, it doesn’t really effect the coordinate system when setting positions. My bad.
Depends on what you need the rotated axes for - for 3D printing it should be as simple as rotating the entire scene 90 degrees around the X or Z axis before exporting the model for printing.
Instead of trying to force threejs to be z-up…
(Which is a nightmare since SOO many components assume Y-up, like orbitcontrols, environment maps, etc.)
Just put all your Z-up world underneath a new Group() that rotates -PI*.5 on x.
let zUpRoot = new THREE.Group();
zUpRoot.rotation.x = -Math.PI*.5;
scene.add(zUpRoot);
zUpRoot.add( yourZUpScene );
If you try to force three to be z-up, it’s possible, but you will end up repairing things every time you encounter a new component that assumes y-up. So… it is possible, but you may end up cursing yourself for your decision.