Applying transformations to the objects

Take a look at the following steps to understand the modifications that we need to carry out to incorporate transformations in our main code:

  1. To make changes to our main code, we'll begin by including the GLM header file in our code, so add the following highlighted include terms in your code:
#include <glm/glm.hpp>#include <glm/gtc/matrix_transform.hpp>#include <glm/gtc/type_ptr.hpp>
  1. The next thing that we are going to do is create the transformation matrix that we want to apply. To do this, go to the while loop, and somewhere in the loop between defining the shader and activating the texture we'll need to add the code described as follows:
    1. First of all, we're going to just create the transformation ...

Get Learn OpenGL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.