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.

106 APPLE II COMPUTER GRAPHICSlooks in those locations to find the starting address of the current shap<strong>et</strong>able, and if you fo rg<strong>et</strong> to load the proper address, there is no telling whatis going to pop up on the display. Since you are still in Monitor, typeE8 : 00 03This will put the address $0300 (remember lo-byte/hi-byte) in the properlocation. Fin<strong>al</strong>ly, key in and run the following program.1 REM SHAPE DEMO20 REM30 ROT = 0: REM SET ROTATION TO 040 s = 150 HGR : HCOLOR = 360 FOR I = 70 TO 190 STEP 3070 SCALE = S: REM SET SCALE TO S80 DRAW 1 AT I,3090 DRAW 2 AT I,100100 S = S + 1 : REM INCREMENT S110 NEXT I120 ENDListing 19-1.Line 30 s<strong>et</strong>s the rotation of the figure to 0 (no rotation) so it will bedrawn as it was designed, and line 50 s<strong>et</strong>s the Hi-Res <strong>graphics</strong> mode andthen s<strong>et</strong>s HCOLOR to 3 (white1). Line 70 s<strong>et</strong>s the sc<strong>al</strong>ing factor to thepresent v<strong>al</strong>ue of S; the sc<strong>al</strong>ing factor will increment from one through five.At SCALE = 1, the figure is the same size as it was designed, and at SCALE= 5, it is five times the origin<strong>al</strong>. The SCALE may be s<strong>et</strong> to any numberfrom zero to 255, but, as you will see, increasing the SCALE tends togreatly distort the shape. If you wish, you may s<strong>et</strong> SCALE = 0, but zerocorresponds to 256, and the shape will be enlarged beyond recognition.Line 80 DRAWs shape number 1 beginning at the coordinates given by1,30 and line 90 DRAWs shape 2 at I, 100. The coordinates denote theplacement of the point of origin for the shape-the place where the chainof vectors began.If everything was entered as specified, the program will draw five copiesof both shapes, and each copy will increase in size.Saving Shape TablesIf you have a disk drive, you may save the table by using BSAVE to sav<strong>et</strong>he range of memory which contains it. Remember to save the fi n<strong>al</strong> 00with the rest of the table, otherwise you will g<strong>et</strong> some unpredictable results

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

Saved successfully!

Ooh no, something went wrong!