Jump to content
  • Advertisement
Sign in to follow this  
Lance Mazon

Isometric Conversion Woes

This topic is 2108 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

I just added to my game engine the ability to handle isometric tiles. Here's a sample of my placeholder tiles:
cube_textures.gif

It's all working great, except, I have stored the tiles in a Dictionary(so that I can quickly update a particular tile as needed) and now need to render each tile sprite in a particular order, or the screen is a mess. Tiles must be rendered in order with those tiles with a higher x/y value being rendered first, so those on the left side and bottom of the screen are the only ones showing their sides. Am I going about this right? Or is there a much better way? Thank you in advance.

Lance...

Share this post


Link to post
Share on other sites
Advertisement
You are right here as long as you don't use some kind of zbuffering.

The problem of determing the visiblity is, that you need to render the hidden parts first. A iso map could be seen as a map of cubes, which are subdivided by planes. Therefore you can take a binary space partition algorithm to render your scene, which results in the simplified order you have mentioned.

Share this post


Link to post
Share on other sites
Since you are using C# and I am hoping XNA?
When you do your spriteBatch.Draw (For each tile) base the final argument (LayerDepth) on the Y value of your isometric tile.

Share this post


Link to post
Share on other sites

You are right here as long as you don't use some kind of zbuffering.

The problem of determing the visiblity is, that you need to render the hidden parts first. A iso map could be seen as a map of cubes, which are subdivided by planes. Therefore you can take a binary space partitionalgorithm to render your scene, which results in the simplified order you have mentioned.


Thanks... I'll check out the link. =D


Since you are using C# and I am hoping XNA?
When you do your spriteBatch.Draw (For each tile) base the final argument (LayerDepth) on the Y value of your isometric tile.


Using OpenGL, though I do plan on adding an abstraction layer soon so I can use whatever. I think it's important to get a working game first though. =D


On a related note, I've been referencing NUnit for a while with the intention of using it, and finally got around to implementing a few tests of my tile, and tilemanager classes. It's already uncovered a couple issues. Thank you NUnit! =D

Share this post


Link to post
Share on other sites
Got it working. NUnit to the rescue. I had a couple silly errors in my code. I was thinking about it correctly, as mentioned. =D Thanks for the help.

Lance...

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!