Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In the case of straight walls it is easy to sort them by depth. Consider just their bases which are straight line segments. Note that each line divides the plane in two parts, one of them is closer to the viewer and the other is farther. For any segment A, call the closer part A+ and the farther part A-. Now, for any two segments A and B, at least one of the propositions holds:</p> <ol> <li>A lies entirely in B+</li> <li>A lies entirely in B-</li> <li>B lies entirely in A-</li> <li>B lies entirely in A+</li> <li>One segment is parallel to the line of sight and the other is entirely to the left or entirely to the right of it</li> <li>A and B intersect</li> </ol> <p>In cases 1 and 3, B should be drawn before A (A may occlude B, but B may not occlude A); in cases (2) and (4) A before B; in case 5, it doesn't matter; and 6 should not occur for normal walls.</p> <p>You can now do a topological sort of the walls, and draw them from furthest to closest.</p> <p>As for roofs, this is not possible for concave buildings, since a part of the roof can be obscured by a wall which obscures another part of that same roof. Imagine a low U-shaped building, visible from its side, with a tall tower in the middle of the U. The tower will both obscure and be obscured by the U-roof, so in whatever order you draw them, the picture will be wrong.</p> <p>So you will have to subdivide concave roofs into convex polygons. Then it should be easy to sort them together with the walls, along the same principles.</p> <p>A totally another method is to use a Z-buffer, which frees you from thinking about the order. It is my impression that you can get Z-buffer on the lowest of the low-powered cell phone graphic cards these days.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload