Hi... So, I tried to create a camera for my 2D game and came across this site... OpenGL Colony. I looked up the source code provided in the website to create a 3D camera and adapted a bit of it to create my own 2D camera. And it works perfectly. Only thing now is, I can't figure out how to fix an object's position relative to the camera. When I use the camera, the whole scene moves. The scene consists of three layers - background, midground, foreground. I want to move the camera in such a way that the background and foreground are stationary with respect to the camera's movement and the midground moves when the camera is moved. In other words, the foreground and background objects are bound to the camera whereas the midground is not. How would I go about doing that? I couldn't find much about it on the internet. Please help. Thank you.
Come on, guys! Please help!