Sign in to follow this  
Lance Mazon

Isometric Conversion Woes

Recommended Posts

I just added to my game engine the ability to handle isometric tiles. Here's a sample of my placeholder tiles:
[img]http://2.bp.blogspot.com/-I-DVQt758Hk/UFAIWRIQRjI/AAAAAAAAAHU/MjPCDrySqe4/s1600/cube_textures.gif[/img]

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
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 [i]cubes, [/i]which are subdivided by planes. Therefore you can take a [url="http://en.wikipedia.org/wiki/Binary_space_partitioning"]binary space partition [/url]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
[quote name='Ashaman73' timestamp='1347429188' post='4979188']
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 [i]cubes, [/i]which are subdivided by planes. Therefore you can take a [url="http://en.wikipedia.org/wiki/Binary_space_partitioning"]binary space partition[/url]algorithm to render your scene, which results in the simplified order you have mentioned.
[/quote]

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

[quote name='yewbie' timestamp='1347461774' post='4979323']
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.
[/quote]

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this