CHAPTER FIVE: USING PERSPECTIVE This section explains DeluxePaint's powerful Perspective feature. This feature lets you paint in three dimensions to give your pictures a true feeling of depth. Perspective is not an easy feature to master,so we strongly recommend that you become familiar with the material in the preceding chapters before you ventur into this area. We've worked hard to make this explanation straightforward,but due to the complexity of Perspective itself,the steps we list will assume that you understand other program features. THE THREE DIMENSIONAL MODEL When you use Perspective in DeluxePaint,you are actually working with a model that represents three dimensions using the two that are available on your screen. It will help you a good deal if you think of your computer screen as the front side of a box. Usually,when you paint with a brush in DeluxePaint,the mouse moves your brush in only two directions:horizontally and vertically. As you move and rotate your brush in Perspective,you add a third direction to the motion:backward and forward. To move the brush into the distance,you will move it on the Z axis of the coordinate system. We'll explain more about this later. For now,just remember that in it's default settings,the screen coordinates operate as shown in Figure 5.1;the X axis runs horizontally across the screen,the Y axis runs vertically,and the Z axis runs backwards into the screen. ROTATING A BRUSH IN 3D SPACE The key to working in Perspective is rotating the brush. In this brief section, we'll show you how to rotate your brush using the numeric keypad. Before you begin,you need a brush to rotate. Load the Dolphin Brush from the Art disk. Then choose Change Color>Use Brush Palette from the Picture menu. Now that you have your brush,you are ready to enter Perspective mode. Choose Perspective>Do from the Effect menu. When you enter Perspective,your screen contains a small cross-hair to indicate the Perspective Center(or line of view)and your brush is enclosed in a frame with a large cross-hair over it. In our example,you will also see three zeros on the right side of the Menu Bar;these indicate the current rotation angles of the brush. The numbers are all zeros because we haven't rotated the brush yet. The cross-hair on your brush is there to help you see the brush rotations and position the brush when it changes sizes. An important feature of the cross- hair is that it indicates the X and Y axes of the brush. The Z axes of the brush runs perpendicular to the other two axes,just like the screen's Z axes. Figure 5.3 shows the Brush axis system. To rotate the brush you use the numeric keyboard on your keyboard. Figure 5.4 shows how each of the keys rotates the brush. -1 +1 Reset X rotations 7 8 9 Y rotations 4 5 6 Z rotations 1 2 3 Reset all rotations 0 Plus center . Fill Screen - Figure 5.4 Brush rotations mapped to the keypad We'll try each of the rotations in the next few steps so you get a feel for 3D rotations. We'll start off with the simplest rotation,that is,a rotation on the Z axes with the brush in its normal 0,0,0 orientation. This is the simplest rotation,because no part of the brush moves off the plane of your computer screen. Hold down the 2 key on the keypad. The brush disappears and the frame rotates clockwise on its center(the position of the pointer). Notice that the third number along the right side of the menu bar increases as the rotation angles increase. Figure 5.5 illustrates rotation on the Z axis. Hold down the 1 key on the keypad until the numbers along the right side of the title bar show 0,0,0 as the brush rotation. When the brush is back to the 0,0,0 position,it reappears inside the frame. This is a handy visual cue that the brush is at it's original orientation. Later,when you begin moving the brush in three-dimensional space,you'll see that the same rule applies to movement--if the brush is back on it's original plane it reappears inside the frame. Rotating on the other axes works just like rotating on Z,but when you rotate on the other axes,the brush moves off the plane of the screen and into the third dimension. Let's see how this works by rotating on X. Move the brush to the lower left corner of the screen. Hold down the 7 key on the keypad. When the brush frame has rotated to about -45,release the 7 key and click the left mouse button to paint the brush. As you rotate the brush counter-clockwise on the X axis,it appears as though the top half of the brush is turning into the screen and the bottom half is turning outward. RESETTING THE BRSH ROTATION To return your brush to its original orientation,press 0 on the keypad. The last step introduced an important keystroke. Any time you need to reset the brush to its original orientation of 0,0,0 press the 0 key on the keypad. If you get lost in the world of 3D,you can always get back to the beginning with this simple keystroke. THE ANGLE STEP To rotate on the Y axis,you use the 4 and 5 keys on the keypad,but this time we'll use the Shift key to rotate by a larger increment. Move your brush to the lower right corner of the screen. Hold down the Shift key to rotate by a larger increment. Move your brush to the lower right corner of the screen. Hold down the Shift key and press the 4 key on the keypad. (Your brush instantly rotates -90 on the Y axis.) Click the left mouse button to paint the brush. Press 0 on the keypad to return the brush to its original orientation. When you use the Shift key with one of the keypad keys,the brush rotates by the Angle Step. The default Angle Step is 90,but you can change it to any angle you like in the Perspective requester. Figure 5.7 shows the Perspective requester. To display this requester choose Perspective>Settings from the Effect menu or click on the Grid tool with the right mouse button while you ae in Perspective mode. PERSPECTIVE X Y Z GRID: 32 32 32 FROM BRUSH ANGLE STEP: 90 TYPE: SCREEN BRUSH ANTI-ALIAS: NONE LOW HIGH DISPLAY: ANGLE POS CANCEL OK Figure 5.7 Perspective requester ROTATION AROUND THE HANDLE When you rotate a brush in Perspective,the rotation always occurs around the brush handle. In the preceding examples,you always held the brush from the center,so the rotations always occurred around the center of the brush. Let's look at the difference between rotation around the center and rotation around the corner of the brush. Click CLR to clear the screen. Position the brush near the middle of the screen. Hold down the Shift key and press the 2 key on the keypad to rotate 90 on the Z axis. Press Shift-Keypad 2 three more times to set the brush back to 0,0,0. You've seen this rotation before,but we had your repeat it to compare this with rotation around the corner. Keep the brush in the same location. Press Alt-x on the keyboard. This moves the bush so that it is held by the lower right corner. You can also do this by choosing Handle>Corner from the Brush menu. Press Shift-Keypad 2 to rotate the brush around the new handle position. Figure 5.8 illustrates the difference between rotation around the center and rotation about the corner. SCREEN VERSUS BRUSH COORDINATES So far in our discussion of brush rotations,we've always rotated the brush on one of the two possible coordinate systems. If you look back to Figure 5.7, you'll see that below Angle Step in the Perspective requester there is an item labeled Type with two buttons:Screen and Brush. We've been rotating in the Screen coordinate system.(If you are familiar with rotation systems,you recognize this system as Euler-pronounced "oiler"-angles.) In the next few paragraphs and steps,we'll demonstrate the difference between the two rotation systems. To begin this brief example,make sure your screen is clear;choose Handle>Center from the Brush menu;and press Keypad 0 to reset your brush to it's original orientation. To make his example clearer,it will help if the Angle Step is set to something other than 90. In the next step we'll have you change it to 45. Choose Perspective>Settings from the Effect menu(or click the Grid tool with the right mouse button.)In the Perspective requester,click in the right side of the Angle Step edit field,backspace to erase the 90 setting and type 45. Click OK to close the requester and use the new setting. Now let's try a rotation in the screen coordinate system: Position your brush in the lower left corner of the screen. Press Shift Keypad 2 to rotate 45 on the Z axis. Now press Shift Keypad 7 to rotate -45 on the X axis. Click the left mouse button to paint the brush down. Notice that when you rotate the brush on the X axis,the axis used was that of the Screen. The brush's X axis was tilted sideways,but the brush still rotated backward into the screen. Also notice that the rotation angles appear in the menu bar. Now we'll change the setting to Brush angles and do the same rotation to see the difference. Click the Grid tool with the right mouse button to display the Perspective requester. Click the button labeled Brush and click OK. Press Keypad 0 to reset your brush to its original orientation. Position the brush in the lower right corner of the screen. Press Shift-Keypad 2 to rotate 45 on the Z axis. Now press Shift-Keypad 7 to rotate -45 on the X axis. Click the left mouse button to paint the brush down. In the Brush coordinates system,rotations always take place about the brush axes,regardless of the current orientation of the brush. In this example,the X axis was positioned digonally after you rotated 45 on the Z axis;as a result,the brush rotated on the diagonal axis instead of rotating straight backward into the screen. You'll also notice that the angles shown in the Menu Bar are not the angles that you rotated. The Menu Bar always shows the rotation angles for the Screen coordinate system. This allows you to reproduce your brush rotation by switching to Screen angles and rotating the amounts indicated in the Menu Bar. DeluxePaint offers both Screen and Brush coordinate systems for rotation, because each of the systems has unique merits: THE SCREEN COORDINATES SYSTEM is ofter consistent with the notion of the three screen coordinates defining the 3D space. More importantly,the Screen coordinates system is reproducible:you can jot down the rotation numbers in the Menu Bar and reproduce the same brush orientation simply by rotating to the same angles. The results of multiple rotations are the same no matter what order you rotate in. THE BRUSH COORDINATES SYSTEM is usually easier to visualize if you are rotating at angles other than 90. So you can usually produce the desired brush orientation without much difficulty. Unfortunately,the cumulative effect of separate rotations on the brush axes are not reproducible unless you make the exact same rotations in the exact same order. You'll notice that the angles given in the Menu Bar when you rotate using the Brush coordinates are actually the angles for the Screen coordinates system;this is so you will be able to reproduce your brush rotation,though you will have to use Screen angles to do it. Now that you've seen how to rotate your brush in three dimensions,the next section will show you the ins and outs of moving a brush around in all three dimensions. MOVING IN 3D SPACE BEFORE YOU BEGIN THIS SECTION: Clear the screen. Choose Perspective>Reset from the Effect menu to reset all perspective settings,including Angle Type,to their defaults. Load the brush named Blockbrush on the Art disk. Choose Change Color>Use Brush Palette from the Picture menu. Make sure you are in Perspective mode. MOVING ON THE Z AXIS When your brush is in its original orientation(0,0,0),moving your mouse moves your brush along the X and Y axes. Try it right now: Move your mouse forward and watch how your brush moves up on the screen. Move your mouse backward and your brush moves down on the screen. Likewise,moving the mouse left or right moves the brush left or right. Because your mouse can move in only two dimensions(the third direction would require you to lift it off the desk),it can move your brush in only two directions. You can move your brush in the third dimension by using the keyboard. One method is to move the brush straight back along the Z axis only: Position your brush in the lower left corner of the screen,hold down the Shift key and press the quote key(")several times. Each time you press Shift-",the brush moves backward along the Z axis. It appears as though the brush is getting smaller,but in fact it is moving away from the front of the scree. To move the brush forward along the Z axis,you use the colon key(:). Hold down the Shift key and press the colon key(:)once. Notice that the " and : keys move the brush toward and away from the cross-hair in the middle of the screen. This cross-hair defines the Perspective Center, which is best thought of as the point of view. No matter where you place the brush on the screen,if you move the brush using the quote key,the brush will move into the distance and toward the Perspective Center. When you use Perspective,you'll often want to move your brush backwards and left and right along a plane. The effect is of a brush moving across the floor. DeluxePaint lets you do this by holding down the Ctrol key while in Perspective. Press Keypad-0 to reset your brush to its original orientation. Position the brush near the bottom of the screen,hold down the Ctrol key and move your mouse forward and backward. With the Ctrol key held down,when you move the mouse forward,the brush moves away along the Z axis. In this way,you can easily move in the X and Z axes instead of the usual X and Y axes. 3D COORDINATES DeluxePaint III lets you see the position of your brush in three dimensional space when you are in Perspective mode. This is useful if you need to align your brush precisely. Press the \ key and look at what happens to the angles in the right side of the Menu Bar. Now hold down the Ctrol key and move the mouse forward and backward. Pressing the \ key toggles the Display option in the Perspective requester between Angle and Pos(position)(see Figure 5.7). Press the \ key again to return to displaying angles in the Menu Bar. LAYING DOWN THE BRUSH TO MOVE IN 3D Another way to move into the distance is to lay the brush down and then move it on its own Y axis. Rotating the brush 90 on it's X axis makes the brush's Y axis act like the screen's Z axis. Figure 5.11 shows what happens to the different axes during perspective rotation. Let's try it once to see how it works. Press Keypad-0 to reset the brush to its original orientation and position the brush in the lower left corner of the screen. Press Shift Keypad-7 to flop the brush down into the screen. Now move the mouse around. You will quickly discover that moving the mouse forward and backward moves the brush into the screen and back out instead of up and down. This is because the mouse moves the brush on the plane defined by the brush's X and Y coordinates. Move the brush to any new position and press Shift Keypad-8 to turn it back up on end. Paint the brush down. Use the combination of Keypad-7 and Keypad-8 several times until you are comfortable with how these keys help you move in the third dimension. THE PERSPECTIVE PLANE You might have noticed that when you flopped the brush down by rotating on it's X axis,the brush moved on a plane below the perspective center. Remember that when the brush is in its original 0,0,0 orientation,it moves on a plane that is roughly the equivalent of the computer screen. When you rotate the brush,you change the orientation of the plane. The plane can be at almost any angle to perspective center. The easiest way to see this is to fill the perspective plane you've defined. Press Keypad-0 to reset your brush. Position the brush so that your cursor is at the bottom of the screen,press Shift Keypad-7 to rotate the brush on the X axis. Choose Perspective>FillScreen from the Effect menu and watch as DeluxePaint fills the perspective plane with a pattern of your brush. The results of this last step should look something like Figure 5.12. Figure 5.12 Perspective plan painted using Perspective>FillScreen As we said,you can set your perspective plane at almost any angle to the perspective center. In the next step,we'll draw a plane to the right of center with the brush rotated sideways. This will create a "wall" on the right. Press Keypad-0 to reset your brush to it's original orientation. Place the brush in the lower right corner of the screen. Press Shift-Keypad-4 to turn the brush into the screen. Choose Perspective>FillScreen from the Effect menu. Practice creating different planes. For example,position the brush above the perspective center to create a "ceiling" from your brush. THE PERSPECTIVE HORIZON The position of perspective center plays an important role in determining the angle of the plane to the viewer. It also determines the horizon point. The horizon point is the farthest edge of the plane when you rotate a bush to 90. To demonstrate how this works,we'll load a picture that has a horizon,and fill the plane out to the horizon. Load the picture Seascape from the Tutorial drawer on the Art disk and choose Change Color>Default Palette from the Picture menu. You might remember this picture from the Guided Tour. In the picture,the ocean stretches to a flat horizon on the right side. We'll set our perspective center in line with this horizon and then fill a perspective plane. Choose Perspective>Center from the Effect menu.(Your cursor changes to a large cross-hair.)Position the cross-hair so that it is half way across the screen and so the horizontal line of the cross-hair lines up with exactly the horizon in the picture. Click the left mouse button to place the perspective center. Now,load your Blockbrush brush;enter Perspective mode,Press Shift Keypad-7 to rotate your brush -90;and choose Perspective>FillScreen from the Effects menu to fill the perspective plane. When you are done,your screen should look like Figure 5.13. Notice that the horizon of your perspective plane exactly matches the horizon of the original picture. THE ANGLE OF THE PLANE In the example above,the perspective plane matches the horizon because you rotated the brush by 90. If you had rotated by more than 90 the plane would not reach the horizon,as though the plane sloped downward. If you had rotated by less than 90,the plane would extend above the horizon,as though it sloped upward like a mountain. It is difficult to see the differences unless you have an existing horizon to compare the plane with. Without an existing horizon,the sloping of the plane will appear to be only a difference in the distance between the position of the brush and perspective center when the brush was rotated. When you create a perspective plane,the position and angle of the plane are determined by three things: the position of Perspective Center; the position of the brush handle(cursor)when you rotate the brush; and the degree of rotation. In our examples above,we rotated the brush in 90 increments so the plane was always either parallel to our point of view or at a right angle. If you want to create a sloping surface,you do so by rotating the brush to an angle less than 90. Here's a quick example. Choose Perspective>Reset from the Effect menu. Position your brush so that the cursor is at the very bottom of the screen. Hold down the 7 key on the keypad until the brush has rotated -60 on the X axis. Move the mouse forward and backward to see how the brush moves on this new plane. You'll notice that the vanishing point of the brush is above the horizon in your picture,this is because the plane is not parallel to the point of view. It is as though you were looking at a gradual incline. This chapter explained almost every aspect of Perspective DeluxePaint. There are a couple of items we didn't cover here but did include in the tutorial on Perspective in Chapter Six. If you think you will be using DeluxePaint's perspective features,be sure to work through that tutorial. You'll learn some very important hints there.