Skip to main content
GameDev.net gamedev.net
🔒 Locked

Isometric drawing troubles.

Started by SkyAphid May 31, 2012 at 1:22 PM 0 replies 1.1k views
Original Post
SkyAphid
SkyAphid
So, I'm working on this project, and it's isometric 2D. So naturally, I render the terrain like this:

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(Display.getWidth()/2, Display.getHeight()/2, 0);
glScalef(1, 0.5f, 1);
glRotatef(45, 0, 0, 1);
glTranslate(-camX, -camY, 0);
//Render Tilemap


Problem is, the rotation and scaling happens to the currently a white 16x16 quad player. So, I figured I'd push the matrix before transformation and pop it afterwards, but now the player is no where to be seen, but the screen still stays where he should be; which means he's just being drawn at the wrong place.

So, I need to draw him in the right place, but I don't know how to go about it. I'm still new to OpenGL, so I don't know if there's a way to use the difference in the Matrices to convert the coordinates somehow so that his "Drawing Coordinates" are as they would be if he was still being rendered isometrically.

Thanks.
monachus
monachus
Try glLoadIdentity after the matrix push. Maybe you are compounding matrix operations.
Showing us more code would help, I think

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.