Command of the Week - Shaded Polygons (Week 49)
This series is called the command of the week, but it could also explain a feature. The explanations will tend to explain the technical parts of the command, and is intended to highlight the basics (and complexities) of the command, and information about how to use it, but won't be a detailed tutorial. It is up to you to use it creatively in your maps.
Week 49 - Shaded PolygonsYou may have noticed that even if you rotate an entity, it's fill is not rotated, but it always oriented on screen the same way as the orientation of the source image file. Except for the roofs of drawn houses in CD3 and Per3 drawings. These two products uses a special kind of entity, a shaded polygon to accomplish this. A shaded polygon actually does a whole bunch of different things, but for normal use, there are two features that we are particularly interested in, and that is the ability to rotate a fill, and the ability to apply light and shading to entities based on the direction they are facing in relation to the global sun.
Where to find it?Toolbar: Right Click [Image_9852] -> Shaded Polygon, Shaded Polygon (Angle By Edge), Change Shade Angle, Change Shade Pitch
Command Line: SHADEPOLY, SHADEPOLY2, SHADEANGLE, SHADEPITCH, EDITSHADING
How to use it?To use any of these commands, you first need to start by drawing yourself a nice polygon, preferably at an angle to properly observe the effects. For my example here, I have drawn two polygons right next to each other with the intention of drawing the roof of a house seen from above, like in a CD3 map. The first drawing doesn't look much as a roof at all, it looks very flat, and the roof tiles are angled very wrong. If your roof tiles look like that, you're going to need to have a serious talk with whoever built it.
Now, to turn this abomination into a proper roof, we can use the Shaded Polygon command on it. When it comes to roofs, using the Angle by Edge variant is the easiest, since you don't normally need the extra control the regular version gives you. Simply start the command, and then click on the side of the roof poly that represents the lower edge of the roof. You should see that the fill orients itself so that the bottom of the fill points toward the side of the polygon you chose (Marked with red circles in my example), and it gets lighted or shaded depending on if it is facing the sun or not.
PitchBy default, the Shaded Polygon (Angle By Edge) uses a roof Pitch of 45 degrees. If you wish to use a different value, simply type it in on the command line before clicking on the polygon edges. You can also change the pitch of the roof later with the Change Shade Pitch command, or through the more advanced EDITSHADING command.
AngleShaded Polygon (Angle By Edge) automatically sets the shade angle based on the edge you clicked on, this greatly simplifies the task of getting this value correct. If you used the regular Shaded Polygon command, you would have needed to provide the angle yourself instead. The angle can later be changed by using the Change Shade Angle command, or through the EDITSHADING dialog.
Note that the appropriate shading angle for a roof is the angle perpendicular to the angle of the lower edge, in the direction from the lower edge to the upper edge. While not hard to calculate, simply using the Angle by Edge version instead saves you from both knowing and calculating this, the only requirement is that when using Angle by Edge, you MUST click on edge that represents the lower end of the slope, while the regular Shaded Polygon work no matter where on the entity you select it.
Rotated fill without shadingThere are also times when you just want to rotate the fill, but you don't want shading. For example, you wish to rotate the floorboard fill of your floor to match the actual direction of the house, the way any sane carpenter would do it.
When you use Shaded Polygon (any version) on your floor, you'll notice that the shading causes it to change color no matter what pitch you use, but you really want to use the original non-shaded version of the fill. To do this, simply use Shaded Polygon on it first, getting the correct alignment. Then, run the EDITSHADING command, select your new shaded polygon, Do It, and the 'Roof shaded Polygon' dialog should show. A lot of the options in this dialog are needed for Perspective entities, but there is a couple of interesting options in here. First, we can see Angle and Pitch up at the top. These can be changed through other commands too, but this is also a nice place to change them. Then we have the "Shade Only Copy" and "Don't Rotate Fillstyle" options. If you want rotated fill styles without shading (like for our floor), then check the "Shade Only Copy" checkbox. To get the opposite result, shading only, but do not align the fillstyle, enable the "Don't Rotate Fillstyle" option.
NotesShaded Polygon works like most other commands, i.e. it lets you select multiple entities in one go, and then hit 'Do It' to run the command on all of them. When doing this, make sure that all entities selected should indeed have the same shading options. For example, in the roof in the top example, the left and right halves of the roof needs completely opposite settings for the shade angle, so you cannot do both with one command. Keep this in mind when doing your selections for this commands. The Angle By Edge version on the other hand only does one polygon at a time, but the command stays active so you can click on the entities one by one, but each is processed individually.
Also note that the Change Shade Angle, Change Shade Pitch and EDITSHADING only works on polygosn that have already been turned into a shaded polygon by either the use of Shaded Polygon or Shaded Polygon (Angle By Edge).