I'm Confused

Started by technik3k, November 04, 2015, 02:09:05

Previous topic - Next topic

technik3k

I am trying to learn how to learn to use openGL with lwjgl 3. I already know how to draw onto a window in 2D. I want to learn how to draw in 3D. I tried to draw in 3D (tried with JOML) but I am having trouble. I feel like I need more knowledge on this topic (the view and matrixes). Could any one help me, find a good tutorial that focuses on this topic, or something. ::) (I'm not very good with openGL and lwjgl 3  :-\)

Andrew_3ds

If you are trying to learn modern OpenGL (3.3+), I recommend thebennybox's youtube playlist, "3D Game Engine tutorial." It teachers a lot about the graphics and fundamentals of game engine rendering structure, and is how I learned a lot of my OpenGL knowledge. https://www.youtube.com/watch?v=ss3AnSxJ2X8&list=PLEETnX-uPtBXP_B2yupUKlflXBznWIlL5 Here is the link to the playlist. Another great source is a website called Learn OpenGL. It is also about modern OpenGL, but it explains everything in great detail and goes from just creating a window to some of the most complex aspects of 3D rendering. http://www.learnopengl.com/ Here is the URL to the website. While it is in C++, the LWJGL team made sure that all of the methods copy over exactly, so the tutorials shouldn't be too hard to follow along with.

Kai

A very good site, currently in the making, which will get you started with basic linear algebra (the vector and matrices stuff) is this: http://immersivemath.com/ila/index.html
It has some nice interactivity.
I'd recommend you start with that and forget about the mechanics of OpenGL for the time being.
You see, all that matrix and vector stuff you can do with for example JOML, and basically everything about OpenGL is about linear algebra.
Sure, there are some technical whizbangs in OpenGL, but basically it is just always linear algebra.

technik3k

Why can't I use things like GLfloat, GLunit, and GLchar and what's the difference between things like GLfloat and a normal float. :)
By the way thanks for the tutorials.

Kai

Adapting a C/C++ example works like this:
You identify calls to OpenGL functions being made there. Those always start with "gl..."
Then, you invoke the corresponding method in LWJGL's GLxx classes.
For this you can just "import static org.lwjgl.opengl.GLxx;" all relevant GLxx classes to avoid you having to search the OpenGL version where that particular function was introduced. Every IDE will provide you with auto-completion.
The signature of the LWJGL methods will then tell you which argument type you need to provide.
There are some special cases that cannot be mapped to Java directly, such as "out" parameters being "pointers" to some memory.
This is where ByteBuffer, FloatBuffer, IntBuffer, PointerBuffer, etc. come into play.