Jump to content
  • Advertisement
Sign in to follow this  
ofreyre

Tiles with different heights

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

Hi everyone. I have done a simple isometric engine. Now i want to add tiles with different heights. My main doubt is how to define and then detect the height of the ground in a certain x,y position. I was thinking about defining 8 different tile slopes, one for each direction (N,S,E,W,NE,NW,SE,SW), each slope type with its getZ(X,Y) that retrieves the height of the ground based on a plane segments. For any horizontal tile getZ(X,Y) will retrieve its height. The world space in my isometric engine is 3D (X,Y,Z), Z only adds pixels to y axis of the screen when rendered. Is this idea ok, any better idea? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
A trick I used was to use multiple isometric grids. The main grid was the visible grid that showed height. Each tile kept a variable defining its height. For instance, a height of 2 had a 16 pixel Y offset compared to a tile with a base height of 0.

The offset was used to calculate the second invisible isometric grid. This level does not show height, it is a regular flat isometric grid that aligns perfectly with the upper layer based on the Y offset. This enables things such as line of site and other useful isometric functionality.

This is just what I did.

Share this post


Link to post
Share on other sites
Thanks for your reply. I have implemented the method I describe above, and its working fine. I thik your idea is very interesting, so I am going to implement it and compere with mine. Thanks again.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!