Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


sorting for rendering order

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

how can I sort sprites inside an isometric cube divided in 10 cubes per axis to render them correctly. Here''s a screenshot of it incorrectly rendered. (copy and paste link) http://www.geocities.com/pacoelflaco_2000/siteimages/spaceships.jpg Coordinate (1,1,1) is the axis where the 3 planes meet.

Share this post

Link to post
Share on other sites
1) Bottom to top
2 8
3 9 14
4 10 15 19
5 11 16 20 23
6 12 17 21 24 26
7 13 18 22 25 27 28

5 2
8 6 3
10 9 7 4

2c) Even this may look nice

3 2
6 5 4
10 9 8 7

It''s up to you.

Share this post

Link to post
Share on other sites
A simple way is to add each object''s x,y, and z coordinates together, assuming they are always greater than 0 ( a reasonable assumption for an isometric). Use this sum to sort each cell''s occupant list, from smallest to largest, then draw in this order. It''s the technique I use for Golem.

vertexnormal AT linuxmail DOT org

Check out Golem: Lands of Shadow, an isometrically rendered hack-and-slash inspired equally by Nethack and Diablo.

Share this post

Link to post
Share on other sites

  • 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!