I've been trying my best on porting my 3D game from Java to C++, but to no avail. I use only LWJGL with OpenGL but I cannot find any other library in C++ that supports as much as LWJGL does for Java. Especially on the math part.
For instance. I'm trying to port this TransformationMatrix maker to C++.
public static Matrix4f createTransformMatrix(Vector3f translation, float rx, float ry, float rz, float scale){
Matrix4f newMatrix = new Matrix4f();
newMatrix.setIdentity();
Matrix4f.translate(translation, newMatrix, newMatrix);
Matrix4f.rotate((float) Math.toRadians(rx), new Vector3f(1,0,0), newMatrix, newMatrix);
Matrix4f.rotate((float) Math.toRadians(ry), new Vector3f(0,1,0), newMatrix, newMatrix);
Matrix4f.rotate((float) Math.toRadians(rz), new Vector3f(0,0,1), newMatrix, newMatrix);
Matrix4f.scale(new Vector3f(scale,scale,scale), newMatrix, newMatrix);
return newMatrix;
}
I've tried using Eigen and GLM, but none of them work the same like LWJGL. Now I wouldn't mind this, but the lack of actual 3D tutorials on OpenGL in C++ is just abysmal.
Any tips or help with even converting this piece of code would be greatly appreciated.
mat1 * mat2
, in java you had to do something likemat1.multiply(mat2)
or something. opengl-tutorial.org is a good modern opengl tutorial. \$\endgroup\$