News for hackers. Stuff that matters.
Re:Drawing isometric boxes in the correct order by fao_ on Thursday August 18, 2016 @06:04AM (#12311367)
Wouldn't a 'painter's algorithm'-style solution of:

  break all the shapes into boxes that can occupy only 1 space
  
  for height = 0 .. n:

    for <however many boxes can be displayed in a column>
  
      for <however many boxes can be displayed in a row>
  
        draw box, step to next box (x+1, y+1)
solve these problems? I'm not sure how fast it would be in practice.
Re:Drawing isometric boxes in the correct order by munchbunny on Thursday August 18, 2016 @06:37AM (#12311489)
The way you would do this in practice would be:

1. Start with the abstraction that every shape is actually a group of one or more sub-shapes. (Well-understood and pretty much universally applied abstraction.)

2. Pre-process all of your geometry so that you won't get cycles of occlusion, which is the corner case the author mentioned. If you do have a cycle, then subdivide and group as mentioned in #1.

3. Use some fast but crude algorithm to preemptively reject non-visible shapes.

4. Apply painter's algorithm. to "probably visible" shapes.