I want to rotate a point(Vector3(10, 0, 10)) around Z axis(0,0,1). Is there a function that does this directly?
I’ve found and tried rotateByQuaternionAroundPointToRef but didn’t manage to insert right values for rotations by 45 degrees.
Thanks in advance!
The values are the BJS values. Else you can use tools to convert them.
Else, in this case, you can use Math.PI which will always work.
A 45° rotation can be expressed with ‘Math.PI/4’
Edit: The BJS values for rotation are based on Math.PI. A revolution (360°) is equal to PI*2. So the range goes from 0 to ~6.283186 for a revolution. But the rotation can continue (i.e. for animations), so you can enter values that will make the object perform an (i believe unlimited) number of revolutions.
If you want to rotate the other way round, simply enter a negativ value (I.E.: -Math.PI/4)