Closed TheoW03 closed 1 year ago
The axis must be a (normalize) unit vector, as mentioned by the JavaDoc of this method: https://javadoc.io/doc/org.joml/joml/latest/org/joml/Matrix4f.html#rotate(float,float,float,float)
The axis described by the three components needs to be a unit vector.
Your axis vector (1, 0, 1)
is not a unit vector.
This is in order to save one additional Math.sqrt() and division which would otherwise be necessary in order to normalize the axis. So, in this case, the caller must ensure that the axis is normalized.
And in addition, your angle 45
(which supposedly is meant to be 45 degrees) is not interpreted as degress. All angle parameters in all JOML methods are always in radians not degrees. See also: https://github.com/JOML-CI/JOML/wiki/Common-Pitfalls#angles-are-always-in-radians
Additionally additionally, calling identity()
on a newly instantiated matrix is unnecessary, as newly constructed matrix objects are always identity by default.
I dont know if this is a code or a math issue, but when I use a rotation matrix like this
it scales my render
(this is the shader code for it because I am sending it to the GPU, rot is the Rotation matrix "m" in my java code)
I so far been only able to reproduce the bug when I do combinations of rotation angles.