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

Isometric Conversion Woes

Started by Lance Mazon Sep 12, 2012 at 4:19 AM 3 replies 1.6k views
Original Post
Lance Mazon
Lance Mazon
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...
Ashaman73
Ashaman73
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.
yewbie
yewbie
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.
Lance Mazon
Lance Mazon

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
Lance Mazon
Lance Mazon
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...

Topic Locked

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

Sign in to reply to this topic.