Home » Archimedes archive » Archimedes World » AW-1994-04-Disc1.adf » Disk1Apr94 » !AWApr94/Goodies/Basic/Objects/Transforms/RotMag

!AWApr94/Goodies/Basic/Objects/Transforms/RotMag

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Archimedes World » AW-1994-04-Disc1.adf » Disk1Apr94
Filename: !AWApr94/Goodies/Basic/Objects/Transforms/RotMag
Read OK:
File size: 03CF bytes
Load address: 0000
Exec address: 0000
File contents
    1
    2LIBRARY "PathLib:OS_units.Transforms"
    3LIBRARY "PathLib:OS_units.Draw"
    4
    5
    6REM Create Transform
    7    PROCCreateTransforms
    8 
    9    
   10REM Creates a draw file consting of only a 40 byte header
   11    file%=FNDraw_CreateFile("NullFile",10000)
   12
   13REM Create a square
   14    PROCDraw_PathBegin(-1,0,0,2)
   15    PROCCreate_Squares    
   16    PROCDraw_PathEnd
   17
   18
   19REM Save this file to the Pipe filing system
   20    PROCDraw_SaveToPipeFS("RotMag",file%)
   21
   22END
   23
   24DEF PROCCreateTransforms
   25 REM Rotation (about origin) and Magnification
   26     PROCPath_CreateTransform(rotmag%)
   27     PROCPath_Rotation(rotmag%,PI/16)
   28     PROCPath_Magnify(rotmag%,1.2)    
   29 REM Translation
   30     PROCPath_CreateTransform(translate%)
   31     PROCPath_Translation(translate%,200,200)
   32ENDPROC
   33
   34DEF PROCCreate_Squares
   35 square%=file_pointer% : PROCDraw_Square(0,0,100) : old%=square%
   36 FOR i%=1 TO 5
   37  new%=FNDraw_AddPath(old%,rotmag%) : old%=new%
   38  NEXT
   39  PROCDraw_AlterPath(square%,translate%)
   40ENDPROC
   41
   42

$ț "PathLib:OS_units.Transforms"
ț "PathLib:OS_units.Draw"


� Create Transform
    �CreateTransforms
 
	    

;� Creates a draw file consting of only a 40 byte header
0    file%=�Draw_CreateFile("NullFile",10000)


� Create a square
!    �Draw_PathBegin(-1,0,0,2)
    �Create_Squares    
    �Draw_PathEnd


.� Save this file to the Pipe filing system
*    �Draw_SaveToPipeFS("RotMag",file%)

�

� �CreateTransforms
0 � Rotation (about origin) and Magnification
'     �Path_CreateTransform(rotmag%)
%     �Path_Rotation(rotmag%,�/16)
'     �Path_Magnify(rotmag%,1.2)    
 � Translation
*     �Path_CreateTransform(translate%)
.     �Path_Translation(translate%,200,200)
 �
!
"� �Create_Squares
#A square%=file_pointer% : �Draw_Square(0,0,100) : old%=square%
$ � i%=1 � 5
%2  new%=�Draw_AddPath(old%,rotmag%) : old%=new%
&  �
')  �Draw_AlterPath(square%,translate%)
(�
)
*
�
00000000  0d 00 01 04 0d 00 02 24  c8 9b 20 22 50 61 74 68  |.......$.. "Path|
00000010  4c 69 62 3a 4f 53 5f 75  6e 69 74 73 2e 54 72 61  |Lib:OS_units.Tra|
00000020  6e 73 66 6f 72 6d 73 22  0d 00 03 1e c8 9b 20 22  |nsforms"...... "|
00000030  50 61 74 68 4c 69 62 3a  4f 53 5f 75 6e 69 74 73  |PathLib:OS_units|
00000040  2e 44 72 61 77 22 0d 00  04 04 0d 00 05 04 0d 00  |.Draw"..........|
00000050  06 16 f4 20 43 72 65 61  74 65 20 54 72 61 6e 73  |... Create Trans|
00000060  66 6f 72 6d 0d 00 07 19  20 20 20 20 f2 43 72 65  |form....    .Cre|
00000070  61 74 65 54 72 61 6e 73  66 6f 72 6d 73 0d 00 08  |ateTransforms...|
00000080  05 20 0d 00 09 08 20 20  20 20 0d 00 0a 3b f4 20  |. ....    ...;. |
00000090  43 72 65 61 74 65 73 20  61 20 64 72 61 77 20 66  |Creates a draw f|
000000a0  69 6c 65 20 63 6f 6e 73  74 69 6e 67 20 6f 66 20  |ile consting of |
000000b0  6f 6e 6c 79 20 61 20 34  30 20 62 79 74 65 20 68  |only a 40 byte h|
000000c0  65 61 64 65 72 0d 00 0b  30 20 20 20 20 66 69 6c  |eader...0    fil|
000000d0  65 25 3d a4 44 72 61 77  5f 43 72 65 61 74 65 46  |e%=.Draw_CreateF|
000000e0  69 6c 65 28 22 4e 75 6c  6c 46 69 6c 65 22 2c 31  |ile("NullFile",1|
000000f0  30 30 30 30 29 0d 00 0c  04 0d 00 0d 15 f4 20 43  |0000)......... C|
00000100  72 65 61 74 65 20 61 20  73 71 75 61 72 65 0d 00  |reate a square..|
00000110  0e 21 20 20 20 20 f2 44  72 61 77 5f 50 61 74 68  |.!    .Draw_Path|
00000120  42 65 67 69 6e 28 2d 31  2c 30 2c 30 2c 32 29 0d  |Begin(-1,0,0,2).|
00000130  00 0f 1b 20 20 20 20 f2  43 72 65 61 74 65 5f 53  |...    .Create_S|
00000140  71 75 61 72 65 73 20 20  20 20 0d 00 10 15 20 20  |quares    ....  |
00000150  20 20 f2 44 72 61 77 5f  50 61 74 68 45 6e 64 0d  |  .Draw_PathEnd.|
00000160  00 11 04 0d 00 12 04 0d  00 13 2e f4 20 53 61 76  |............ Sav|
00000170  65 20 74 68 69 73 20 66  69 6c 65 20 74 6f 20 74  |e this file to t|
00000180  68 65 20 50 69 70 65 20  66 69 6c 69 6e 67 20 73  |he Pipe filing s|
00000190  79 73 74 65 6d 0d 00 14  2a 20 20 20 20 f2 44 72  |ystem...*    .Dr|
000001a0  61 77 5f 53 61 76 65 54  6f 50 69 70 65 46 53 28  |aw_SaveToPipeFS(|
000001b0  22 52 6f 74 4d 61 67 22  2c 66 69 6c 65 25 29 0d  |"RotMag",file%).|
000001c0  00 15 04 0d 00 16 05 e0  0d 00 17 04 0d 00 18 17  |................|
000001d0  dd 20 f2 43 72 65 61 74  65 54 72 61 6e 73 66 6f  |. .CreateTransfo|
000001e0  72 6d 73 0d 00 19 30 20  f4 20 52 6f 74 61 74 69  |rms...0 . Rotati|
000001f0  6f 6e 20 28 61 62 6f 75  74 20 6f 72 69 67 69 6e  |on (about origin|
00000200  29 20 61 6e 64 20 4d 61  67 6e 69 66 69 63 61 74  |) and Magnificat|
00000210  69 6f 6e 0d 00 1a 27 20  20 20 20 20 f2 50 61 74  |ion...'     .Pat|
00000220  68 5f 43 72 65 61 74 65  54 72 61 6e 73 66 6f 72  |h_CreateTransfor|
00000230  6d 28 72 6f 74 6d 61 67  25 29 0d 00 1b 25 20 20  |m(rotmag%)...%  |
00000240  20 20 20 f2 50 61 74 68  5f 52 6f 74 61 74 69 6f  |   .Path_Rotatio|
00000250  6e 28 72 6f 74 6d 61 67  25 2c af 2f 31 36 29 0d  |n(rotmag%,./16).|
00000260  00 1c 27 20 20 20 20 20  f2 50 61 74 68 5f 4d 61  |..'     .Path_Ma|
00000270  67 6e 69 66 79 28 72 6f  74 6d 61 67 25 2c 31 2e  |gnify(rotmag%,1.|
00000280  32 29 20 20 20 20 0d 00  1d 12 20 f4 20 54 72 61  |2)    .... . Tra|
00000290  6e 73 6c 61 74 69 6f 6e  0d 00 1e 2a 20 20 20 20  |nslation...*    |
000002a0  20 f2 50 61 74 68 5f 43  72 65 61 74 65 54 72 61  | .Path_CreateTra|
000002b0  6e 73 66 6f 72 6d 28 74  72 61 6e 73 6c 61 74 65  |nsform(translate|
000002c0  25 29 0d 00 1f 2e 20 20  20 20 20 f2 50 61 74 68  |%)....     .Path|
000002d0  5f 54 72 61 6e 73 6c 61  74 69 6f 6e 28 74 72 61  |_Translation(tra|
000002e0  6e 73 6c 61 74 65 25 2c  32 30 30 2c 32 30 30 29  |nslate%,200,200)|
000002f0  0d 00 20 05 e1 0d 00 21  04 0d 00 22 15 dd 20 f2  |.. ....!...".. .|
00000300  43 72 65 61 74 65 5f 53  71 75 61 72 65 73 0d 00  |Create_Squares..|
00000310  23 41 20 73 71 75 61 72  65 25 3d 66 69 6c 65 5f  |#A square%=file_|
00000320  70 6f 69 6e 74 65 72 25  20 3a 20 f2 44 72 61 77  |pointer% : .Draw|
00000330  5f 53 71 75 61 72 65 28  30 2c 30 2c 31 30 30 29  |_Square(0,0,100)|
00000340  20 3a 20 6f 6c 64 25 3d  73 71 75 61 72 65 25 0d  | : old%=square%.|
00000350  00 24 0f 20 e3 20 69 25  3d 31 20 b8 20 35 0d 00  |.$. . i%=1 . 5..|
00000360  25 32 20 20 6e 65 77 25  3d a4 44 72 61 77 5f 41  |%2  new%=.Draw_A|
00000370  64 64 50 61 74 68 28 6f  6c 64 25 2c 72 6f 74 6d  |ddPath(old%,rotm|
00000380  61 67 25 29 20 3a 20 6f  6c 64 25 3d 6e 65 77 25  |ag%) : old%=new%|
00000390  0d 00 26 07 20 20 ed 0d  00 27 29 20 20 f2 44 72  |..&.  ...')  .Dr|
000003a0  61 77 5f 41 6c 74 65 72  50 61 74 68 28 73 71 75  |aw_AlterPath(squ|
000003b0  61 72 65 25 2c 74 72 61  6e 73 6c 61 74 65 25 29  |are%,translate%)|
000003c0  0d 00 28 05 e1 0d 00 29  04 0d 00 2a 04 0d ff     |..(....)...*...|
000003cf