Rotate camera direction along axis

Hello, I have this simple code which gets the camera direction, and I was wondering how I could turn it left by 90 degrees. I tried direction.applyAxisAngle( new THREE.Vector3( -1, 0, 1 ), Math.PI / 2 ); but that only seemed to work at times, I also tinkered with the vector values but nothing achieved quite what I needed. The Y coordinate is completely useless to me as I only need to the rotated direction along the X and Z axis.

applyAxisAngle() is expecting the axis of rotation, so try (0,1,0) to rotate around the y-axis.

1 Like

Thank you, that solved the issue, my geometry skills were not sufficient enough to try rotating the Y axis.