Jump to content

  • Log In with Google      Sign In   
  • Create Account


Isometric tilemap rendering


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.

  • This topic is locked This topic is locked
1 reply to this topic

#1 Lucky808   Members   -  Reputation: 139

Like
0Likes
Like

Posted 27 February 2013 - 04:18 PM

Hi all,

 

Has anyone read the book "Learning IOS Game Programming"? I'm current using the rendering method (for Orthogonal maps) taught in the book in my new game. I've successfully converted some of the code to work with Isometric tilemap. However, I hit a road block when it comes to rendering objects on the map in the right order. I'm using 3 map layers. (1.ground, 2.grass, 3.wall and trees). I render the first 2 layers, then the player object, then the 3rd layer. However I could not get it to render objects in correct orders. i.e. a player standing in front of a tree should show up as such, meaning the tree should be rendered 1st then the player.

I've implemented a depth buffer and set up the following:

 

 

        glOrthof(0.0f, rect.size.width0.0f, rect.size.height0.0f100.0f);

 

 

        glEnable(GL_DEPTH_TEST);

        glDepthMask(GL_TRUE);

        glDepthFunc(GL_LEQUAL);

        glDepthRangef(0.0f1.0f);

 

        glClearDepthf(1.0f);

        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

 

But objects are still not being rendered in the correct order. If someone who is familiar with the rendering method in that book can you please point me to the right direction.

Any input will be appreciated!

 

Thanks in advance.



Sponsor:

#2 frob   Moderators   -  Reputation: 20250

Like
0Likes
Like

Posted 27 February 2013 - 05:06 PM

Please do not cross post.


Check out my personal indie blog at bryanwagstaff.com.




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