Archive for October, 2005

This is the second in what will be an ongoing series of tutorials on vector graphics.

Please note that I am using PS CS2, which uses a hybrid system but the principles
can be used to create vector graphics in other vector drawing software.

If you haven’t already done so, open Photoshop and then open a shiny new blank image.

Make it about 500 pixels square and give it a white background. Call it anything you choose.

New Image window

Make black your foreground colour. It doesn’t matter what colour you choose for this exercise because all the outlines (vector paths) come out black anyway.

Colour tool in Photoshop

Select the Pen Tool from the tools palette.

Pen Tool

When you choose this tool, a number of additional options appear in the bar
at the top. Choose the option circled in red. This is the PATHS tool.

Path Tool

You draw lines and curves with this tool to make outline shapes also known as paths.

This is where it starts to get interesting, but you can’t run till you learn to walk so more exercises I’m afraid.

Click on the page and this time don’t let go. Instead move the mouse down the screen.

An additional line is extending up and down from your starting point. Neat eh? These are the direction handles.

Still not letting go of the right mouse button, circle your mouse around your starting point.
Notice that the mouse pointer is an arrow now, no longer a pen nib.

Pen nib is now a pointer

Okay you can let go now and select edit and clear from the menu at the top.

Click and let go once to create a new anchor point then move the mouse, click and hold. Don’t let go of the mouse button but move your mouse down the screen and watch what happens.

With secondanchor point and handles

You should have something that looks like the picture above. Still holding down that mouse button move your mouse in circles. When you are ready clear the screen and read on for a bit.

The closer your mouse is to the anchor point (short handles) the shallower the curve produced.

Short handles - shallow curve

Conversely the further your mouse is away from the anchor point (long handles) the deeper the curve.

Long handles -deep curve

At this point the middle ground is no handles to get a straight line as we’ve already seen.

But wait, there’s more:

The curve always points away from the handle you are dragging around the screen. For me, this is like driving by watching the road through your rear view mirror. I find it counter intuitive – but your mileage may differ. I think that may be why I had such a lot of trouble getting the hang of these suckers.

Not finished yet:

My expectation (based on my complete ignorance of the mathematics involved) was if you had two anchor points and moved the mouse down you would get a nice even parabola with its midpoint halfway between the two.

Given the same parameters these vector/ bezier thingies behave quite differently.

SIDEBAR
I think I’ve just had a “Eureka” moment. By the way you don’t have to read this part – but it might help you visualize what is happening. The answer my friends is we need to see in three dimensions. Simple eh?

I kept playing with the exercise above and instead of seeing a badly behaved line I realised that what I was looking at was a representation of a curve moving in three not two dimensions.

The curve was not flattening rather it’s just the same curve seen from different angles. Like taking a flexible ruler or plastic pipe between your palms (One end in one palm, the opposite end in the other palm). Hold it in front of you so that all you can see is a straight line put a little pressure on it so that it curves towards you than get someone else to push the middle of the ruler towards you 90 degrees and then back 180 degrees so that it spins between your hands. Try not to move your hands.

Swap places with your assistant and get them to hold the ruler as described, move around the ruler and view it from as many different angles as you can. Any of the shapes look familiar? Now I’m not sure if this is actually what is happening on the screen, but it sure looks like it to me. The viewing perspective changes, but the two points remain fixed.

When you move the handles around your view of the curve changes. The perspective moves up, down, sideways and forward and backward. If I’ve got this right and I’m not saying that I have, it’s a pretty neat trick. I will include a short video to illustrate this if you are interested.
END SIDEBAR

Okay, back to the tutorial.

The following pictures show how it works. Pull the handle straight down, the line curves up, push the handle straight up and the line curves down, move the handle right and the line curves left and finally move the handle left and the line curve right. In combination you can make just about any size or type of curve that your heart desires.

Illustration to show direction handle behaviour

Now what happens if you want to add another line – make another curve? Couldn’t be easier.

Instead of hitting Edit clear to begin again, you can:

Click on your starting anchor point to close the shape or

You can hold down the Control and windows keys and click on a blank bit of your image.

These controls close the path so that you can begin another path without deleting the old one.

Click, let go, move to the right, click again and pull the mouse down and to the right to make a nice even curve, let go, move the mouse to the right then click and let go again. You should have something like this:

Illustration continuous curve

Why is this so? After everything I’ve told you? It follows the new handle to the new point. It will draw continuous curves as long as you keep adding points.

But if you drag the handle down again at this point you get a complex curve.

Illustration S curve

To avoid this hold down the alt key and click on the anchor point to give you a corner anchor.
When you make your next anchor point instead of getting a curve it reverts to a line. Like this:

Illustration corner anchor

I have included some exercises you can do to help you practice what you have learned. (exercise one) (exercise two). They are gifs so choose Image Mode (from the menu at the top of the screen) will have to be changed back to RGB before you can add a layer and play with it.

Illustration change mode menu

Just a note about vector paths in PS they can’t be saved until you render them. So if you want to save anything that you draw at this point use the path selection tool located above the pen tool.

Path selection tool

Draw a box around your path or click on it to choose it, right click to bring up the menu and select stroke path.

Illustration Select path menu

Then you can save your work. You don’t have to do step this in Illustrator – one of the many differences.

That’s it for this week – next week we move on to the other pen tools, and start looking at shapes and how to use them.

You are currently browsing the Jools Pontificates blog archives for October, 2005.

    Archives