Answer the question
In order to leave comments, you need to log in
Matrices and doing native matrix operations in OpenGL?
Good day!
Before clarifying the question, I obviously ask you not to be angry if you find something stupid, since I am only in the process of my learning.
Training takes place according to the book "OpenGL. Superbook".
Recently, I got acquainted with such a wonderful thing in OpenGL as matrices. Some basic functions were provided for working with matrices like glPushMatrix, glPopMatrix, glRotate, glTranslate and so on.
In the end, they said that you can not use push and pop, but create your own matrices in the form of 4 by 4 arrays or one-dimensional arrays of 16 elements and do your own transformations, which is much more practical.
Trying to understand the multiplication of matrices and so on, I asked myself:
"What is each element in the matrix responsible for?".
Little has been written about this on the internet. The book itself only tells that the first four elements are the x-axis, the second are y, the third are z, and the fourth are translation. The fact is that without understanding what each element of the matrix is responsible for, I cannot understand the essence of matrix multiplication, and even more so I do not understand how translation, rotation and scaling work.
I really hope for your help. Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Firstly, this "superbook" is outdated, like mammoth shit , in no case can you learn from it, it will teach bad ancient crutches that have not been used for a long time and are removed from the standard in modern versions! Throw/delete/burn it right now and forget everything you learned from it! In 2017, it has no value. Things are different now in OpenGL .
Secondly, these functions have long been officially declared obsolete and are categorically not recommended for use , as is the entire immediate-mode rendering. Instead of immediate-mode, Core Profile is now used with programming of individual stages of the graphics pipeline, and instead of these specific functions, it is recommended to use the GLM library.
Modern OpenGL starts at version 3.3. In fact, it is the basis to which various features are added.
I advise you to learn from the wonderful tutorials from Joey de Vries , he analyzes everything there in great detail and step by step. Very cool tutorial, highly recommend!
And, of course, the OpenGL Programming Guide (9th Edition) is the top book on OpenGL with the full stuffing of the latest version. But it is better to use it as a reference book, it will be quite problematic for a beginner to learn from it.
Matrix multiplication is not directly related to OpenGL.
This is a separate mathematical apparatus used in almost all areas.
To understand it, you need to study linear algebra, not OpenGL.
To understand how OpenGL uses matrices, you need to study analytic geometry.
And you can score and use without a deep understanding of the topic. I didn't have to study physics for several years to turn on the microwave.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question