Creating
Basic Grapics With Postscript (2 of 2)
In this second part of the basic graphics tutorial, we will be discussing colors and filling paths. For this tutorial, a text editor will be used to write postscript (notepad is sufficient). GSview will also be used to view our files. Colors and Path Filling Now that we know how to create a path and stroke its edges with a line, lets take a look at some more interesting things. First, here the new commands we will be using and their functionality: We will be using the following procedures. Copy and paste them into your text editor. /m60 {60 mul} def %Convert m60->points (60/1 points) to use as an increment for movementNext, copy the following code into your document: %Outline for 3d H Save your file as h.ps and view it in GSView. 1.0 .5 0 setrgbcolorThe numbers represent the Red Green and Blue levels of the color, respectivly. 1.0 is equivalent to full color. 0 is equivalent to no color. Play with these settings and check them out in GSView. Now add the three dimensional depth: We will make the representaion of the depth gray in color, so use the following code: .5 setgrayThe number repersents the level of gray, 1 being black and 0 being white. We will create and fill multiple paths to display our 3d representation. Here is the first: newpathWhen writing this program I found it easiest to draw the representation on a grid on paper first. Then I coded it in postscript. Problems:
|
||||||||||||||||||
The
PostScript Tutorial Concieved and Created by Dann Ormond & Will Munn.
Inspired by Mike Grady PhD. Website Design by NiftySites.com. |