05 October 2008

Cubing the Square in Illustrator

Although Illustrator may never go out and mow your lawn or do your taxes, you can get it to do some of your work for you. For example, you can begin creating a graphic image by using the basic shapes created with the Circle tool, the Rectangle tool, the Star tool, and so on. These simple shapes may not be the final form of what you want, but a little manipulation (using only the Transform tools) can turn them into an astonishing variety of shapes. In the following steps, for example, you use rectangles and the Transform tools to create a cube:

1. Use the rectangle tool to draw a square.
If you want a perfect square, hold down the Shift key while you draw.

2. Select the square with the Selection tool. Click the square again and drag it. When you start dragging, hold down the Alt key (Windows) or Option (Mac).
Holding down the Alt key (Windows) or Option (Mac) while you drag makes a copy of whatever you currently have selected. This maneuver is one of the primary ways that Illustrator power-users avoid making extra work for themselves. The trick is to press the Alt key (Windows) or Option (Mac) after you start dragging and to keep holding it down until you release the mouse.

3. With the second box still selected, choose Object➪Transform➪Transform Again.
As if summoned from another dimension, a third box appears. The Transform Again command is another way that Illustrator powerusers avoid extra work. This command repeats the last transformation made on the currently selected object. Transformations don’t have to be made by using the Transform tools. Copying by using the Alt key (Windows) or Option (Mac) is considered a transformation, as is simply moving by dragging.

4. With the Direct Selection tool, click the right side of the first square and drag it up and to the left.
This action creates the shape.

5. Click the right side of the second square. Choose Object➪Transform➪Transform Again.
The side moves the same way that the first square moved. Now you have two sides of the cube, but one is facing the wrong way.

6. Click the left side of the second square with the Selection tool.

7. Choose the Reflect tool from the Toolbox. Hold down the Alt key (Windows) or Option (Mac) and click the selected side.
The Reflect dialog box opens.

8. Choose the Vertical axis option and click OK.
This flips the second side of the cube so that it’s the mirror image of the first.

9. Move the second side so that it touches the right side.

10. Select the third square with the Selection tool; then choose the Rotate tool, hold down the Alt key (Windows) or Option (Mac), and click the center of the square.

11. In the Rotate dialog box that appears, rotate the square 45 degrees by typing 45 into the Angle field and then click OK.

12. Position the square over the first two sides.

13. With the square still selected, click the Scale tool; then click in the center of the square to set the origin point.

14. Click and drag outside the square until it lines up with the tops of the other two sides of the cube.
There you have it! A stunning three-dimensional object that looks like it will pop right off the page.

Fill the three sides with appropriate colors, and you have a toy chest, a building block, or a really simple cube-puzzle in less time than it takes to tell about it.

04 October 2008

Creating Perspective Shadows in Illustrator

Perspective shadows are among the most popular artistic techniques ever. They almost magically add depth to any illustration. Although we use text in this example, the technique works with any object. Illustrator has a built-in drop shadow filter, but it’s rather limited compared with what you can do on your own with little trouble. To create drop shadows, follow these steps:

1. Create text or an object to which you want to apply a shadow.

2. Duplicate the text or object by copying it and choosing Edit➪Paste in Front.
This command places the copy directly in front of the previous object.

3. Keep the copy selected and click the Free Transform tool in the Toolbox.
A control box appears around the text.

4. Click the top center control handle, drag it beneath the bottom of the text, and don’t release the mouse button.

5. Still holding down the mouse button, press and hold the Ctrl key (Windows) or Ô (Mac) and drag to the left. Release your mouse. With the Selection tool, reposition the shadow so that it touches the bottom of the original word.
By holding the Ctrl key (Windows) or Ô (Mac) while you drag the center handles of the Free Transform box, you can skew the selection. That’s the secret of creating a perspective drop shadow.

Granted, the shadow as shown is rather sharp. You can soften it by using a gradient — provided that you’re putting the shadow on anything other than text. Unfortunately, gradients can’t fill text. If you use text for this technique, we have to stick an extra step in here: Convert your text to paths by choosing Type➪Create Outlines. Then, apply the gradient.

6. Set the Fill color to the default gradient (White, Black) by clicking this option in the Swatches palette.
Wait a minute — that doesn’t look quite right. You need to set the direction of the gradient.

7. To set the gradient’s direction, choose the Gradient tool, click at the bottom of the shadow, and then drag to where the shadow meets the text.
Finally, the shadow is all set!

Haunted by a Ghost(ing)
Many magazines use the ghosting technique to solve the age-old problem of keeping text legible when it overlaps a graphic. If the graphic image is complex or highly detailed, it can distract attention from the text and make the text hard to read. A ghost is a subtle fade that wafts over part of the image, keeping the text readable without losing the visual interest of the graphic. Ready to ghost part of a graphic? That’s the spirit! Here goes:

1. Open the graphic in Illustrator.

2. Using the Rectangle tool, drag a rectangle over the part of the image that you want to fade and then fill the rectangle with White.

3. Choose Window➪Transparency. Using the Opacity slider in the upperright corner of the Transparency palette, set the Opacity to 70%.
You may need to set a higher or lower opacity, depending on what you’re ghosting.

03 October 2008

Getting Animated in Illustrator

Writing about animation is a little bit like dancing about architecture. Animation makes a lot more sense if you can see it happening. Fortunately, animating from Illustrator is so straightforward and clear that you don’t have to see anything actually move until you put it in motion.

The basic principle in creating Illustrator animations is almost embarrassingly simple. Ever have one of those flipbooks of drawings that you can riffle to make the pictures move? Same thing. Whenever you export an Illustrator file in the Flash format, you can export each layer as a separate frame in a movie. What you wind up with is a stack of layered images. When the frames play, the effect is as though you were clicking through the layers (showing the next one and hiding the previous one) really fast. Play begins at the bottom layer and goes upward in order to the top layer.

For a simple (but entertaining) example of this effect, the following steps demonstrate how to animate text to make it look as though it’s typing itself:

1. Create a new document in Illustrator.

2. Type some spontaneous foolishness.
For this example, we use Say what? so it will seem to be saying itself.

3. Highlight each letter with the Type tool and give each one a different Fill color.
All our letters are gray here because we are very boring people (in fact, this whole book is printed in full color, but we just couldn’t bring ourselves to use any color that wasn’t a shade of gray). But feel free to make every letter a different, vivid color.

4. In the Layers palette, duplicate the layer by dragging it on top of the Create New Layer button.
The Create New Layer button is the second button from the right at the bottom of the Layers palette. We duplicated the layer eight times, once for each letter, plus one extra. The idea is to keep duplicating layers until you create one more layer than the number of letters you have.

5. Hide all layers except for the second layer from the top by clicking the View button.
The View button (the eyeball icon) sits to the left of the layer name in the Layers palette.

6. Highlight the last letter in the text and press the Delete key.
In our case, we deleted the question mark.

7. Hide all layers except for the third layer from the top and delete the last two characters.
We got rid of the question mark and the letter t.

8. Hide all layers except for the fourth layer from the top and delete the last three letters.
We exterminated the question mark, the letter t, and the last letter a.

9. Keep going down through the layers in this way, deleting one more letter each time until only one letter remains in the second layer from the bottom and the bottom layer is blank.

10. Show all the layers.
Hidden layers won’t export to the Flash file.

11. Choose File➪Export, and after the Export dialog box appears, select the Flash (SWF) format.
When you name your file, make sure that its name ends with the .SWF extension. Flash files have a hard time playing when they don’t have that extension (even on a Mac).

12. Click Export.
The Flash (SWF) Format Options dialog box appears.

13. In the Export As box at the top of this dialog box, choose AI Layers to SWF Frames.
Because this animation has few frames, use a slow frame rate, such as 3 frames per second (fps). For a more dynamic animation, create more layers and use a faster frame rate. Select the Generate HTML check box.

Otherwise, leave the remaining settings as they are. You can now integrate your SWF more easily by generating a file that includes HTML code. This will allow your SWF file to be viewed at the correct original size in the browser; otherwise, your file will fill the browser window. It also eliminates the need for further editing of code to integrate your file into your Web site.

14. Click OK.

15. Test your animation by opening it in your Web browser.
If the animation doesn’t play, you may not have the necessary Flash plug-in installed. Go to www.adobe.com to find instructions on downloading and installing the plug-in for your browser.