nickyc95 wrote:Hi there,
Over the past few weeks I have been learning modern OpenGL (programmable pipeline) however there doesn't seem to be much coverage on 2d games.
What I would like to know is,
1. Is it best to use an orthographic projection or a perspective projection?
2. If using an Ortho projection, should you use your screen height and width or some other values?
3. Should you edit positions using shaders / translation matrices or edit values inside VBO's?
4. When using a Ortho projection and loading models (3d) from file, how can you translate the position from -1,1 to use it?
I think that's all for now. If I think of anything else I'll post it below.
Thanks

I am not even close at being comfortable with OpenGL, but I'll give it a shot anyway. (plz don't hate on me ^^)
1: Orthographic projection would be the way to go, if you want the classic 2D look.
2: I always use screen width/height, because those values are sooo much easier to work with, because you know better where 100px X 100px is on the screen, than where 2.435? X 5.23? is on the screen.
Though, if you zoom in and out (if your game allows that), that's another story, but you can still somehow imagine where 100px X 100px would be if you zoomed in x2 (50px X 50px)
3: It depends on how fancy you wanna be, and if your game is going to go hard on the CPU/GPU.
4: I don't understand the question... Your model is at -1, 1, and you want to move it into view/into the game space/room?