RISC World

ArtWorks Made Easy


8: Object Distortion

ArtWorks provides two special tools for the controlled distortion of objects. These are the envelope too l and the perspective tool. They are invaluable in creating many kinds of special effect.

You may be familiar with object distortion from other software packages. One of the first such facilities for the Acorn 32-bit machines was included in 4Mation's Poster, followed by ICS' DrawBender and RISC Developments' TypeStudio. All of these employed a user-defined shape often called, for obvious reasons, a mould which effectively 'stamped its shape on to the object being processed.

The two facilities in ArtWorks work in a broadly similar way, but are, as we have come to expect with ArtWorks, more sophisticated and more versatile. Moreover, like blends (which we met in Chapter 5) they are dynamic. This means that at any stage in the life of the drawing you can instantly undo the effect of the tool, restoring the object to its pristine, undistorted form. You can also save the definition of the envelope or perspective and apply it to other objects. This is useful if you wish to build up a collection of objects that have received consistent treatment.

Envelopes and blends can be applied to path objects, i.e. lines or shapes, lines of text, tokenised objects such as rectangles and ellipses and groups made up of these elements. You cannot use these tools on sprites. (Some pixel graphics applications provide similar facilities which work on sprites.)

The Envelope and Perspective tools

To use either facility, first select the object(s) or group to which it is to be applied. Incidentally, if you wish to distort a collection of objects, simply select them all, there is no need to group them first, the enveloping/perspectivising process will perform the grouping itself. Then click on the appropriate tool. The info bar will change to the form shown below and a bounding box, which is the 'mould' will appear around the selected object(s).

The appearance of this bounding box varies somewhat. The perspective bounding box is red with a control point at each corner, which the user can drag about. The envelope bounding box is similarly red with control points, but at first appears red and yellow because there are also overlying Bezier control handles on each side. As well as dragging the comers, you can make each side into a curve. Examples of each are shown below.

The envelope tool allows its contents to be warped or twisted in an almost infinite number of ways. Dragging the corners of the box not only changes its shape but also that of its contents. Moreover, since the Bezier control handles on each side allow you to make that side into a gentle or a tortuous curve, clearly you are limited only by your imagination! Perhaps the easiest way to think of the capabilities is to imagine that the group of objects being distorted has been painted on a very flexible fabric which can then be stretched or distorted in three dimensions. The facility is especially valuable if you wish to portray text on a flag or banner that is billowing in the wind or to make text fill an irregular shape.

Using perspective

Perspective, as all artists know, is the effect that makes objects appear smaller when they are further away. An inevitable consequence of light travelling in straight lines, it causes the familiar illusion that a straight road or railway track becomes narrower as it recedes into the distance.

The perspective tool differs from the envelope tool in three important respects. Firstly, there are no Bezier control handles, these are not needed since perspective does not give rise to curved distortion. Secondly, as you distort the box, you will see a 'vanishing point' cross- hairs target appear on the screen. This too can be dragged around as an alternative to dragging the comers of the box, although for many effects, you will need to drag both. The vanishing point represents that point on the horizon at which parallel lines appear to converge. If you are applying perspective to a picture of a building or car or a group of people, as seen from a normal human viewpoint, you should position the vanishing point at the supposed viewer's eye level.

The following illustration shows three shopfronts both before and after treatment with the perspective tool. This type of operation can produce the illusion that you are actually standing in the street looking at the shops instead of the 'flat' drawing without perspective applied.

Thirdly, the perspective tool introduces a new element to the distortion; it causes foreshortening, i.e. the aspect ratio of objects changes so that those closer to the vanishing point appear narrower. In the illustration above, for example, the original three shops are the same width, but after treatment with the perspective tool, each shop is narrower than the the one to its left, but only slightly shorter. Photographers will be familiar with this phenomenon which causes distant objects viewed through a telephoto lens to appear unnaturally foreshortened.

If you are drawing a complex perspective scene, it may contain numerous objects that have been subjected to the perspective tool. You should manipulate these so that all the vanishing point targets are coincident; in this way the whole scene will have consistent perspective.

One word of warning about the perspective tool. Don't expect miracles from it! If the row of shops had contained representations of three-dimensional details such as bay windows, recessed doorways, overhanging awnings and items of hardware standing in front of the shops these could not be properly adjusted as it would be emphatically a two- dimensional image containing no depth information. Consequently, what the perspective tool would produce is would be a correctly rendered two- dimensional image with perspective. The processed version would look quite realistic at first glance, since most of its detail lies within the plane of the image, but on closer examination all the three-dimensional details such as bay windows and awnings would be squashed flat and so no longer look realistic. The only way to produce images of three-dimensional objects with correct perspective is to use a three- dimensional graphics package which contains a complete mathematical model of the subject. That is a highly specialised task beyond the scope of ArtWorks.

For many special effects in graphic design and for producing perspective images of flat surfaces such as walls and floors, however, the perspective tool is ideal.

Common features

Two features of the envelope and perspective tools are worthy of special note. Firstly, a special grid is provided, quite independent of the normal drawing grid. This is represented on the info bar by the icon containing a dot pattern. Clicking on this turns on a dot pattern inside the bounding box. Initially this dot pattern is a regular matrix. In the perspective tool it is a pattern of dots and bars. As you distort the bounding box, however, the dots move to reflect the distortion. In the perspective tool the spacing of the bars illustrates the degree of foreshortening. Click on the icon again to remove the grid.

The 'moulds' used in the envelope and perspective tools are in fact normal shapes and can be imported into the routines. They must be four-sided shapes. For the perspective mould the sides must be straight; for the envelope mould, they may be straight or curved. Rectangles or ellipses formed using the rectangle or ellipse tool must be converted to shapes first using the Make shapes menu option (in the Lines/shapes menu).

To import a shape first cut it or copy it to the clipboard (see Chapter 6 for more on the clipboard). Next, select the enveloped or perspectivised object and click on the envelope or perspective tool, as appropriate. Next, click on the pull-object-off-clipboard icon (on the info bar). The object will become the new mould and will shape the original contents of the envelope or perspective. The following picture gives an example.

Similarly, clicking on the copy-object-to-clipboard icon will copy the mould to the clipboard; this has no effect on the current perspective or envelope object. Once on the clipboard, you can drag the mould into a drawing where it becomes an ordinary shape. Or you can drag it into other perspective or envelope objects, to create collections of objects that have received consistent treatment.

Envelopes and perspectives are, like blends, dynamic. That is to say, the original objects) in its undistorted form is stored together with details of the mould that caused the distortion. This means that at any stage you may modify the envelope or perspective or remove it altogether and edit the objects that have been distorted, even if they are text objects. Clearly, if you have a mould which took much work to create, you should copy it to the clipboard before removing it. Then you can edit your original and reapply the mould, copying it back from the clipboard.

Where the demands of graphic design are such that four sides to an envelope are inadequate, consider splitting the design into sections and giving each section its own envelope. The finished envelope objects can then be brought together and grouped.