To render a 3d scene you need to project the objects from 3d space to a 2d view. You have three separate matrices that are used to act as a camera to record a view of the scene.

  1. The Projection matrix

This makes sure objects that are further away appear smaller than objects that are close.

  1. The View matrix

This is transforming where the camera is in the world and the direction it is looking at.

  1. The Model matrix

To transform where an object is located. Every object in a 3d scene has it’s own model matrix. To draw the same mesh multiple times the vertices of the mesh get multiplied by the model matrix to translate / rotate the mesh.

Every draw call that is done needs it’s own MVP matrix, that is usually passed in a uniform.

There are ways to optimize this for instanced drawing, where you would upload a whole buffer of extra model matrices and multiply in the shader.