Rotation of a scene in OpenGL (QT)

So, we already know how to initialize an OpenGL window in QT. (/podklyuchenie-opengl-v-qt/) Now let's learn how to rotate the scene. In short, to rotate the scene in OpenGL, you need to call the function void glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z). The angle parameter sets the rotation angle from the current position; x, y, z describe the rotation vector, in other words, they determine the direction of rotation. You can also change the position of the vector's origin.

Connecting OpenGL in QT

Let's consider an example of connecting the OpenGL graphics library to a QT project. I will try to provide the most accessible information for a quick start. Here we will only consider the example of connection and rendering of a simple scene. In the following notes, we will add camera rotation and so on.