[SOLVED][LWJGL-3.1.2][OpenGL 3.2 Core] Vertices won't draw :(

I have recently started programming in java again after about a year doing other stuff.
Now I wanted to refurbish an old engine I had laying around.

I upgraded it from OpenGL 1.1/Immediate mode, to OpenGL 3.2 Core.
But for some reason it won’t display the vertices(I am completely new to Modern OpenGL).

If someone could take a look and help, I would greatly appreciate it :slight_smile:

Affected source code:
Gist: View on Github Gist
Source Code: Download (OneDrive)

Edit:
I have also tested with a simple Triangle, and still nothing…
Reference I used: https://github.com/SilverTiger/lwjgl3-tutorial/wiki/Rendering

EDIT 2:
I figured it out…
I set the perspective matrix zNear to negative value :emo: , while it should be above 0
This:

matrixPerspective = Matrix4f.perspective(45, ratio, -1f, 1024f);

should be something like this:

matrixPerspective = Matrix4f.perspective(45, ratio, 0.1f, 1024f)

If you are new to modern OpenGL and knows Java. I recommend you to looking for ThinMatrix on Youtube.

These tutorials are old for the LWJGL concepts (it uses LWJGL 2). But for the OpenGL stuff it’s really nice, he talks straightforward about different concepts in a game development using Java and OpenGL

I started 3 months ago using the BennyBox game engine tutorials series… and now I’m adding more things from these series from ThinMatrix.

I hope I have helped you…

I figured it out myself, it seems to be a problem with the matrices.
If I don’t multiply MVP in shader, the cube appears.
I will twiddle around a little more, Thank you for the youtube tuts, may come in handy :slight_smile:

EDIT:
I figured it out…
I set the perspective matrix zNear to negative value :emo: , while it should be above 0
This:

matrixPerspective = Matrix4f.perspective(45, ratio, -1f, 1024f);

should be something like this:

matrixPerspective = Matrix4f.perspective(45, ratio, 0.1f, 1024f)