It's all ok when i want to draw one object, for example a cube. I create vertices for cube, i create the buffer, i create the MVP matrix and send it to shader and it works nice.
But, what to do when i want to draw 2 or more objects, for example both cube and a triangle? I believe that View and Projection matrices should be same both for triangle and cube, i only need different Model matrix, right? So that means that i will have two MVPs?
//Example (using GLM):
glm::mat4 MVPC = Projection * View * ModelCube;
glm::mat4 MVPT = Projection * View * ModelTriangle;
So what do i do with those two now? This is the vertex shader that works good for cube
//vertex shader
#version 330 core
layout(location = 0) in vec3 verticesCube;
uniform mat4 MVPC;
void main(){
gl_Position = MVPC * vec4(verticesCube,1);
}
And what should i do with MVPT (triangle) in shader, i tried messing around with different things, but i can't get it to work, i can't display both the cube and the triangle at the same time.