Original Post
Hey all, I started writing the tile engine for a game I'm getting going on, and have already run into something that's stumping me. At first I had the tiles (as well as the tile menu) rendered with an orthographic projection in a rectangular window (1024x768) but then decided a perspective projection would have to work after deciding to make the game 3D. Long story short, my square tiles have become rectangular, but only if the window is rectangular. Observe:
The tile menu, which is used for painting the map, is rendered with the following ortho setup... bear in mind this is what everything was rendered with until I broke it: void glOrtho(-right, right, -top, top, -1.0f, 1.0f); Where right and top describe the size of the window. The big tiles are now rendered with the following setup: void gluPerspective(45.0f, w/h, 1.0f, 1000.0f); Where w and h represent the width and height of the window, respectively. I've tried playing with the field of view in gluPerspective as well as the aspect ratio, but to no avail. I'm using SDL with OpenGL under Mac OS X (latest). Can anyone help me?
The tile menu, which is used for painting the map, is rendered with the following ortho setup... bear in mind this is what everything was rendered with until I broke it: void glOrtho(-right, right, -top, top, -1.0f, 1.0f); Where right and top describe the size of the window. The big tiles are now rendered with the following setup: void gluPerspective(45.0f, w/h, 1.0f, 1000.0f); Where w and h represent the width and height of the window, respectively. I've tried playing with the field of view in gluPerspective as well as the aspect ratio, but to no avail. I'm using SDL with OpenGL under Mac OS X (latest). Can anyone help me?