Hi,
Some time ago I learned how to create basic 3D stuff in LWJGL2. I want to keep doing so and I would like to upgrade to LWJGL3, but there is one problem:
There is no LWJGL3 specific lwjgl_util.jar and the one that comes with LWJGL2 has an issue with LWJGL3 when using gluPerspective. It uses a function called glMultMatrix and this function was replaced in LWJGL3 by some others like glMultMatrixf and glMultMatrixi (i think).
So how do I create a 3D environment with LWJGL3?
Thanks.
You might consider using a linear algebra library, such as JOML (https://github.com/JOML-CI/Java-OpenGL-Math-Library), which allows you to compute the matrices.
It features functions to compute yourself the perspective (https://github.com/JOML-CI/Java-OpenGL-Math-Library/blob/master/src/com/joml/Matrix4f.java#L1633) and orthogonal (https://github.com/JOML-CI/Java-OpenGL-Math-Library/blob/master/src/com/joml/Matrix4f.java#L1415) projection matrices and view (https://github.com/JOML-CI/Java-OpenGL-Math-Library/blob/master/src/com/joml/Matrix4f.java#L1543) matrices that you know from GLU.
You just need to use glLoadMatrix (http://javadoc.lwjgl.org/org/lwjgl/opengl/GL11.html#glLoadMatrixf(java.nio.ByteBuffer)) in order to upload the computed matrix to the fixed-function pipeline in OpenGL.
One advantage of using a math library like JOML is however that you can also use programmable shaders with uniforms to store the matrix.
So should you decide to leave the fixed-function pipeline behind, you'd still be good to go with JOML.