Setup 3D OpenGL environment in LWJGL3.

Started by mcmacker4, May 07, 2015, 21:16:27

Previous topic - Next topic

mcmacker4

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.

Kai

You might consider using a linear algebra library, such as JOML, which allows you to compute the matrices.
It features functions to compute yourself the perspective and orthogonal projection matrices and view matrices that you know from GLU.
You just need to use glLoadMatrix 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.