I'm working on making a Breakout game in C++ / SFML / OpenGL for learning purposes. This is my first trek into modern opengl.
My problem is that I can't figure out how to make the paddle move (or the ball for that matter). Right now, I translate the entire view, causing the camera to move but the shapes stay in their original position. I've been following certain tutorials online (Arcsysnthesis and open.gl mainly), but I'm just not understanding something, so I was wondering if I could get feedback. I know I need to translate the position of the paddle, presently I'm using the MVP matrix setup.
In my Vertex shader I have
gl_Position = MVP * vec4(position, 1.0);
Where MVP is a uniform mat4 variable. I use glm::perspective and glm::lookAt functions to generate the P * V portion of the MVP. Lastly, when I gather keyboard input in my update() function I use glm::translate and generate a Model. I know the multiplication order needs to be P*V*M (from what I've gathered reading tutorials), and I use the result to modify the uniform variable in the vertex shader. The result is that the screen / camera translates positions, but the shapes obviously don't move. I think I understand why this is happening, but I cannot figure out how to only translate the shapes and essentially control their movement.
EDIT - The comment below is right - all I needed wast to change my update / render sequence because I was using the same transform on all my shapes!