Hey so I am learning OpenGL and to help with that I am making a 2d, top down racing game.
I am using Modern OpenGL 3.3 and GLFW3.
My game is one where the whole track is not visible and it is discovered as the car drives around the track. I am struggling how I can achieve a top down camera that follows the car as he goes off the screen.
Could someone please point me in the right direction.
I think I need to do something with a view matrix but am not sure how.
I have a projection matrix that looks like so:
glm::mat4 projection = glm::ortho(0.0f, static_cast<GLfloat>(car->position.x) , static_cast<GLfloat>(car->position.y), 0.0f, -1.0f, 1.0f);
Which is passed into a shader. I have tried messing around with that but no luck.
Any help would be awesome, thanks!