Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Isometric drawing troubles.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 SkyAphid   Members   -  Reputation: 101

Like
0Likes
Like

Posted 31 May 2012 - 07:22 AM

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, 31 May 2012 - 07:23 AM.


Sponsor:

#2 monachus   Members   -  Reputation: 166

Like
0Likes
Like

Posted 01 June 2012 - 01:16 AM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS