I have all the basic rendering already set up, with translation, scaling etc. What matrix(s) and/or vector(s) do I need to multiply/add with my existing code to rotate an object.
Preferably around a point given by a vector2fa, also only in degrees because quaternions aren't implemented and its only 2D not 3D.
Snippet of the vertex shader:
gl_Position = transformation * vec4(position, 1.0) + translation
Where transformation is done in java as (Note not actual code as * is replaced with .mul()):
Matrix4f transformation = ortho * scale
And translation is given by a method:
Vector4f translation = new Vector4f(x , y , 0f, 0f).mul(gc.getOrtho());
All the code listed before works as expected. It is just lacking the rotation feature mentioned at the top.
How can I add rotation to my code?