What is the correct direction of rotation in three.js

1、Three.js uses the right handed system and this means counter clockwise is default rotation.

2、i add a cube, and then it display as follows.

3、if i do a rotation as follows

cube.rotation.y += Math.PI / 6;

it displays as follows, which also is my expect

4、but if i do the rations as follows

cube.rotation.set(Math.PI, 0, Math.PI, "XYZ");
cube.rotation.y += Math.PI / 6;

it seems the direction of rotation changes to be clockwise;

you can also check the sandbox by: 骰子 (forked) - CodeSandbox
why does it happen, how can I know the direction exactly

Doing complex multi-axis rotations with .rotation Eulers sooner or later breaks, it’s generally safe to use it only when rotating on a single axis or multi-axis but within -180 to 180 degrees interval - in other cases, consider quaternions (visualisation.)

2 Likes

Relevant: Gimbal lock - Wikipedia