12.07.2015 Views

williams-et-al-1983-apple-ii-computer-graphics

williams-et-al-1983-apple-ii-computer-graphics

williams-et-al-1983-apple-ii-computer-graphics

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 10-SHAPING UP 101A closed dot at the beginning of a vector ind icates that the point is to beplotted, and an open dot indicates that the point is to be left <strong>al</strong>one(skipped), and the arrow points the direction to the next point. It is vit<strong>al</strong> toremember that the plotting or skipping comes before the moving. We willuse "P" to represent a dot which is to be plotted, and "S" to representone which is skipped. Also, "U" means that we move up, "R" right, "D"down, and "L" left. It requires both a plot/skip and a move command torepresent each vector. For example, SD represents a vector which skipsthe current point and moves down. With that in mind l<strong>et</strong>'s attempt tomake sense out of Figure 1©-1 B.Starting at the beginning, the bottom block, we will trace the path of thevectors to its terminus. The fi rst vector ind icates that the point is to beplotted, and then we are to move up (PU). The second vector leaves thedot <strong>al</strong>one and moves right (SR). The third vector plots and moves up (PU),while the fourth, fifth, and sixth skip and move left (SL), skip and move up(SU), and plot and move right (PR), respectively. You end up with this listof vectors:PUSRPUSLSUPRThe last vector plots before it moves, and the direction of movement isunimportant. Right was chosen arbitrarily-the important characteristic ofthat vector was the plot to turn on the last point.The <strong>computer</strong> generates the shape on the screen by following this seriesof instructions: plot-up, skip-right, plot-up, skip-left, skip-up, and plot-right.You need to encode those vectors for the machine using binary codes fo reach instruction as shown in Figure 1©-2.Plot 1Skip lilUp lillilRight !illDown lfl"lLeft 11Figure 10-2. Vector codes.To encode the first vector (PU), you would use 1 for Plot and (/)(/) for Upto g<strong>et</strong> 1 ©©. The second vector (SR) yields ©©1 , and the th ird (PU) gives you1 (/)(/) again. Take a piece of paper and write down the six vectors and theirrelated codes. You should end up with:PU lfl"llilSR : lillill

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!