Advertisement Jump to content
Sign in to follow this  
SkyAphid

OpenGL Isometric drawing troubles.

This topic is 2424 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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. Edited by SkyAphid

Share this post


Link to post
Share on other sites
Advertisement
Try glLoadIdentity after the matrix push. Maybe you are compounding matrix operations.
Showing us more code would help, I think

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!