(LWJGL)glThis glThat

I sort of zoomed a bit far in learning lwjgl. I don’t fully understand how matrixes work and what the glMatrix modes do. Can you either explain in depth about it, or link me to a really good learning resource?

(OMG, the icecream man is near my house. currently)

You should google.

But to start, R4king ported the Arcsynthesis OGL tutorials to LWJGL: https://github.com/ra4king/LWJGL-OpenGL-Tutorials/

I’ve been trying, but OpenGL for c++ seems a lot different than lwjgl. I started reading the OpenGL superbible.

Try with something simpler first then.

Things on OpenGL tutorials like this

// 1rst attribute buffer : vertices
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
glVertexAttribPointer(
   0,                  // attribute 0. No particular reason for 0, but must match the layout in the shader.
   3,                  // size
   GL_FLOAT,           // type
   GL_FALSE,           // normalized?
   0,                  // stride
   (void*)0            // array buffer offset
);
 
// Draw the triangle !
glDrawArrays(GL_TRIANGLES, 0, 3); // Starting from vertex 0; 3 vertices total -> 1 triangle
 
glDisableVertexAttribArray(0);

Seem a lot different than this

glVertex2f(x, y);[

Is it all the same? Oskar taught differently ???

That’s because it is different: you’ve been using Immediate mode, that other stuff is vertex arrays, which is recommended over immediate mode.

Technically those are VBOs, not vertex arrays.

Sorry @BurntPizza, I don’t like calling you up on this but the last thing we want is to confuse a beginner with (very, very slightly) wrong terminology.

A little too late for that :stuck_out_tongue:

If all you know is immediate mode (glBegin/glEnd) then I suggest you start wiping your brain clear of everything you’ve learned so far. Take a few minutes :slight_smile:

Then I recommend these tutorials: www.arcsynthesis.org/gltut
The C++ code with those tutorials have been ported to Java+LWJGL here: https://github.com/ra4king/LWJGL-OpenGL-Tutorials

No please, correct me, I don’t want to confuse anyone either.