We know that a model's transformation from 3D to 2D can be represented as PVM.
To deal with modelling, viewing and projection, we use three global variables in main.cpp : matModelRoot, matView, and matProj to repsent the modelling matrix, view matrix and the projection matrix repectively.
Add their declaration after the declaration of the shader variable in main.cpp, initialise matModelRoot and matView to identity matrix. Intialise the projection matrix to a default orthographic projection.
// main.cppstatic Shader shader;// add the following decalarationsglm::mat4 matModelRoot =glm::mat4(1.0);glm::mat4 matView =glm::mat4(1.0);glm::mat4 matProj =glm::ortho(-2.0f,2.0f,-2.0f,2.0f,-2.0f,2.0f);