Perspective


Perspective is the art (some would say science) of making a two-dimensional image look like a three dimensional object. In general, the rules of perspective are pretty simple - the further away something is from you, the smaller it appears. Therefore, when you draw an object (say a box) on a sheet of paper or a computer screen, the "back" of the object is smaller than the "front" and the lines connecting the front and back are diagonals.  If you extend the diagonal lines off to both the right and left sides of the object, they should meet at the apparent "horizon" of the image - the point where they meet is the "vanishing point." 


SimCity 2000 uses "isomorphic" perspective, meaning that all objects are the same size, no matter how far away they are. That way, the tiles at the front of your city and the tiles at the back of your city can be drawn the same size in the SC2K view screen, and as long as the viewing area is not too large, it will still look realistic. Does this mean we can throw away the rules of perspective? Not entirely. The sides of your buildings still have to be drawn on a "diagonal," just without a "vanishing point. In other words, all the opposite sides of your building are exactly parallel to each other instead of meeting at a point. This makes our life as SCURKers much easier and, given the small scale involved, the lack of true perspective is virtually unnoticeable.
 

The big question is "How do I draw the diagonals?" - this is not so simple when you have to draw them using big, blocky pixels. The standard view in SC2K is from the corner at a 45-degree angle, just like the hypothetical boxes above. The diagonal lines are pretty simple - two pixels over, one pixel up, two over, etc. - I call this a 2x1 line:
<2x1 line
If you want your building at a different angle, you'll need a different diagonal. As I've said before, just one pixel makes a big difference! Here are some buildings drawn with different diagonals:
 
  <3x1 line <4x1 line <8x1 line
 
Notice that each line requires a different diagonal line for the adjacent side of the building. Look at the difference between the "normal" 2x1 line building and the 8x1 line building. The 2x1 building uses the same 2x1 lines on all four sides, because you are viewing the building at a 45 degree angle. The 8x1 building is at about 20 degrees, so the front wall is an 8x1 line but the side wall is a 1x2 line - one over and two up! The two pieces of "rooftop" below illustrate the crucial difference:
Clearly, the second "rooftop" is at the wrong angle. This may seem pretty obvious, but it took me some trial-and-error before I figured it out. You can't just <Copy>, <Flip Selection>, and <Paste> when you are drawing a building that is not at the "normal" 45 degrees. How do I figure out what kind of line to use on the adjacent walls? I do it by eye...I take a guess. Usually a 1x2 line works pretty well, though. You'll notice that all my "non-standard" buildings up above use 1x2 lines.

Whatever lines you use, You must still make opposing sides parallel to each other. That is, unless your building doesn't have square angles - then the lines are up to you. My 4x1 line building above is an example of this, it has a kind of "W" shaped front. "Flat" buildings - ones that are at a 0 degree angle to the horizon - are also a special case. For these you will have to make the side walls angle in towards each other so that they meet at an imaginary "vanishing point" on your apparent horizon, just like in normal (non-isomorphic) perspective. The line you use on the sides is very critical - too much or too little of an angle and it will look like the "flat" roof is sloping up or down! (Unless that is your intent). Again I usually use a 1x2 line, but I do it by eye:

Of course, these diagonals are merely the beginning if you are going to draw any more complex shapes like arches, rooftop triangles, circles, cones, or domes. As a matter of fact, I'm going to handle those in a whole different section, Shapes.  For now, just think of the possibilities that varying the "standard" 2x1 line, 45 degree angle opens up for you:
 
If you look at the red roof on the middle building, you'll see that I *still* don't have the perspective exactly right. Well, nobody said it was easy.... ;-)
 
 


 
saci@voicenet.com