May 2019
Intermediate to advanced
542 pages
13h 37m
English
In OpenGL, the projection matrix defines how our 3D model is projected to a 2D screen. This is represented by a 4x4 matrix of numbers that can be used to calculate vertex positions. Before we can do any drawing, we need to define this matrix.
In Qt, we can use the QMatrix4x4 object to represent it:
self.view_matrix = qtg.QMatrix4x4()
A QMatrix4x4 object is very simply a table of numbers arranged in four rows and four columns. However, it has several methods that allow us to manipulate those numbers in such a way that they represent 3D transformations, such as our projection.
OpenGL can use two kinds of projections—orthographic, meaning that points at all depths are rendered the same, or perspective, meaning ...
Read now
Unlock full access