Home » Archimedes archive » Archimedes World » AW-1994-01.adf » AWJan94 » !AWJan94/Goodies/Disc/Example_3/RotMagTran

!AWJan94/Goodies/Disc/Example_3/RotMagTran

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-01.adf » AWJan94
Filename: !AWJan94/Goodies/Disc/Example_3/RotMagTran
Read OK:
File size: 0525 bytes
Load address: 0000
Exec address: 0000
File contents
    1PROCList
    2LIBRARY "PathLib:OS_units.Paths"
    3LIBRARY "PathLib:OS_units.Transforms"
    4ORIGIN 640,512
    5square%=FNPath_CreateSquare(0,0,800)
    6PROCCreateTransform
    7PROCDrawObjects
    8END
    9
   10DEF PROCCreateTransform
   11 PROCPath_CreateTransform(rotmagtrans%)
   12 PROCPath_Rotation(rotmagtrans%,PI/16)
   13 PROCPath_Magnify(rotmagtrans%,.95)
   14 PROCPath_Translation(rotmagtrans%,20,20)
   15ENDPROC
   16
   17DEF PROCDrawObjects
   18 REPEAT
   19  SYS "Draw_Stroke",square%
   20  PROCPath_Transform(square%,rotmagtrans%)
   21  x$=GET$
   22 UNTIL FALSE
   23ENDPROC
   24
   25DEF PROCList
   26MODE MODE
   27COLOUR 2
   28PRINT "EXAMPLE 3: ROTATING, MAGNIFYING AND TRANSLATING A SQUARE" : PRINT
   29DATA LIBRARY "PathLib:OS_units.Paths"
   30DATA LIBRARY "PathLib:OS_units.Transforms"
   31DATA "ORIGIN 640,512"
   32DATA "square%=FNPath_CreateSquare(0,0,800)"
   33DATA "PROCCreateTransform"
   34DATA "PROCDrawObjects"
   35DATA "END"
   36DATA ""
   37DATA "DEF PROCCreateTransform"
   38DATA " PROCPath_CreateTransform(rotmagtrans%)"
   39DATA "  PROCPath_Rotation(rotmagtrans%,PI/16)"
   40DATA " PROCPath_Magnify(rotmagtrans%,1.05)"
   41DATA "  PROCPath_Translation(rotmagtrans%,20,20)"
   42DATA "ENDPROC"
   43DATA ""
   44DATA "DEF PROCDrawObjects"
   45DATA " REPEAT"
   46DATA "  SYS ""Draw_Stroke"",square%"
   47DATA "  PROCPath_Transform(square%,rotmagtrans%)"
   48DATA "  x$=GET$"
   49DATA " UNTIL FALSE"
   50DATA "ENDPROC"
   51COLOUR 1
   52FOR i%=1 TO  22 : READ x$ : PRINT x$ :NEXT
   53COLOUR 7
   54PRINT '"Press space bar! (ESC to finish)."
   55ENDPROC
   56
	�List
ț "PathLib:OS_units.Paths"
$ț "PathLib:OS_units.Transforms"
ȑ 640,512
'square%=�Path_CreateSquare(0,0,800)
�CreateTransform
�DrawObjects
�
	

� �CreateTransform
( �Path_CreateTransform(rotmagtrans%)
& �Path_Rotation(rotmagtrans%,�/16)

$ �Path_Magnify(rotmagtrans%,.95)
* �Path_Translation(rotmagtrans%,20,20)
�

� �DrawObjects
 �
  ș "Draw_Stroke",square%
+  �Path_Transform(square%,rotmagtrans%)

  x$=�
 � �
�

� �List
� �
� 2
D� "EXAMPLE 3: ROTATING, MAGNIFYING AND TRANSLATING A SQUARE" : �
&� LIBRARY "PathLib:OS_units.Paths"
+� LIBRARY "PathLib:OS_units.Transforms"
� "ORIGIN 640,512"
 ,� "square%=FNPath_CreateSquare(0,0,800)"
!� "PROCCreateTransform"
"� "PROCDrawObjects"
#� "END"
$� ""
%� "DEF PROCCreateTransform"
&/� " PROCPath_CreateTransform(rotmagtrans%)"
'/� "  PROCPath_Rotation(rotmagtrans%,PI/16)"
(,� " PROCPath_Magnify(rotmagtrans%,1.05)"
)2� "  PROCPath_Translation(rotmagtrans%,20,20)"
*� "ENDPROC"
+� ""
,� "DEF PROCDrawObjects"
-� " REPEAT"
.%� "  SYS ""Draw_Stroke"",square%"
/2� "  PROCPath_Transform(square%,rotmagtrans%)"
0� "  x$=GET$"
1� " UNTIL FALSE"
2� "ENDPROC"
3� 1
4!� i%=1 �  22 : � x$ : � x$ :�
5� 7
6*� '"Press space bar! (ESC to finish)."
7�
8
�
00000000  0d 00 01 09 f2 4c 69 73  74 0d 00 02 1f c8 9b 20  |.....List...... |
00000010  22 50 61 74 68 4c 69 62  3a 4f 53 5f 75 6e 69 74  |"PathLib:OS_unit|
00000020  73 2e 50 61 74 68 73 22  0d 00 03 24 c8 9b 20 22  |s.Paths"...$.. "|
00000030  50 61 74 68 4c 69 62 3a  4f 53 5f 75 6e 69 74 73  |PathLib:OS_units|
00000040  2e 54 72 61 6e 73 66 6f  72 6d 73 22 0d 00 04 0e  |.Transforms"....|
00000050  c8 91 20 36 34 30 2c 35  31 32 0d 00 05 27 73 71  |.. 640,512...'sq|
00000060  75 61 72 65 25 3d a4 50  61 74 68 5f 43 72 65 61  |uare%=.Path_Crea|
00000070  74 65 53 71 75 61 72 65  28 30 2c 30 2c 38 30 30  |teSquare(0,0,800|
00000080  29 0d 00 06 14 f2 43 72  65 61 74 65 54 72 61 6e  |).....CreateTran|
00000090  73 66 6f 72 6d 0d 00 07  10 f2 44 72 61 77 4f 62  |sform.....DrawOb|
000000a0  6a 65 63 74 73 0d 00 08  05 e0 0d 00 09 04 0d 00  |jects...........|
000000b0  0a 16 dd 20 f2 43 72 65  61 74 65 54 72 61 6e 73  |... .CreateTrans|
000000c0  66 6f 72 6d 0d 00 0b 28  20 f2 50 61 74 68 5f 43  |form...( .Path_C|
000000d0  72 65 61 74 65 54 72 61  6e 73 66 6f 72 6d 28 72  |reateTransform(r|
000000e0  6f 74 6d 61 67 74 72 61  6e 73 25 29 0d 00 0c 26  |otmagtrans%)...&|
000000f0  20 f2 50 61 74 68 5f 52  6f 74 61 74 69 6f 6e 28  | .Path_Rotation(|
00000100  72 6f 74 6d 61 67 74 72  61 6e 73 25 2c af 2f 31  |rotmagtrans%,./1|
00000110  36 29 0d 00 0d 24 20 f2  50 61 74 68 5f 4d 61 67  |6)...$ .Path_Mag|
00000120  6e 69 66 79 28 72 6f 74  6d 61 67 74 72 61 6e 73  |nify(rotmagtrans|
00000130  25 2c 2e 39 35 29 0d 00  0e 2a 20 f2 50 61 74 68  |%,.95)...* .Path|
00000140  5f 54 72 61 6e 73 6c 61  74 69 6f 6e 28 72 6f 74  |_Translation(rot|
00000150  6d 61 67 74 72 61 6e 73  25 2c 32 30 2c 32 30 29  |magtrans%,20,20)|
00000160  0d 00 0f 05 e1 0d 00 10  04 0d 00 11 12 dd 20 f2  |.............. .|
00000170  44 72 61 77 4f 62 6a 65  63 74 73 0d 00 12 06 20  |DrawObjects.... |
00000180  f5 0d 00 13 1e 20 20 c8  99 20 22 44 72 61 77 5f  |.....  .. "Draw_|
00000190  53 74 72 6f 6b 65 22 2c  73 71 75 61 72 65 25 0d  |Stroke",square%.|
000001a0  00 14 2b 20 20 f2 50 61  74 68 5f 54 72 61 6e 73  |..+  .Path_Trans|
000001b0  66 6f 72 6d 28 73 71 75  61 72 65 25 2c 72 6f 74  |form(square%,rot|
000001c0  6d 61 67 74 72 61 6e 73  25 29 0d 00 15 0a 20 20  |magtrans%)....  |
000001d0  78 24 3d be 0d 00 16 08  20 fd 20 a3 0d 00 17 05  |x$=..... . .....|
000001e0  e1 0d 00 18 04 0d 00 19  0b dd 20 f2 4c 69 73 74  |.......... .List|
000001f0  0d 00 1a 07 eb 20 eb 0d  00 1b 07 fb 20 32 0d 00  |..... ...... 2..|
00000200  1c 44 f1 20 22 45 58 41  4d 50 4c 45 20 33 3a 20  |.D. "EXAMPLE 3: |
00000210  52 4f 54 41 54 49 4e 47  2c 20 4d 41 47 4e 49 46  |ROTATING, MAGNIF|
00000220  59 49 4e 47 20 41 4e 44  20 54 52 41 4e 53 4c 41  |YING AND TRANSLA|
00000230  54 49 4e 47 20 41 20 53  51 55 41 52 45 22 20 3a  |TING A SQUARE" :|
00000240  20 f1 0d 00 1d 26 dc 20  4c 49 42 52 41 52 59 20  | ....&. LIBRARY |
00000250  22 50 61 74 68 4c 69 62  3a 4f 53 5f 75 6e 69 74  |"PathLib:OS_unit|
00000260  73 2e 50 61 74 68 73 22  0d 00 1e 2b dc 20 4c 49  |s.Paths"...+. LI|
00000270  42 52 41 52 59 20 22 50  61 74 68 4c 69 62 3a 4f  |BRARY "PathLib:O|
00000280  53 5f 75 6e 69 74 73 2e  54 72 61 6e 73 66 6f 72  |S_units.Transfor|
00000290  6d 73 22 0d 00 1f 16 dc  20 22 4f 52 49 47 49 4e  |ms"..... "ORIGIN|
000002a0  20 36 34 30 2c 35 31 32  22 0d 00 20 2c dc 20 22  | 640,512".. ,. "|
000002b0  73 71 75 61 72 65 25 3d  46 4e 50 61 74 68 5f 43  |square%=FNPath_C|
000002c0  72 65 61 74 65 53 71 75  61 72 65 28 30 2c 30 2c  |reateSquare(0,0,|
000002d0  38 30 30 29 22 0d 00 21  1b dc 20 22 50 52 4f 43  |800)"..!.. "PROC|
000002e0  43 72 65 61 74 65 54 72  61 6e 73 66 6f 72 6d 22  |CreateTransform"|
000002f0  0d 00 22 17 dc 20 22 50  52 4f 43 44 72 61 77 4f  |..".. "PROCDrawO|
00000300  62 6a 65 63 74 73 22 0d  00 23 0b dc 20 22 45 4e  |bjects"..#.. "EN|
00000310  44 22 0d 00 24 08 dc 20  22 22 0d 00 25 1f dc 20  |D"..$.. ""..%.. |
00000320  22 44 45 46 20 50 52 4f  43 43 72 65 61 74 65 54  |"DEF PROCCreateT|
00000330  72 61 6e 73 66 6f 72 6d  22 0d 00 26 2f dc 20 22  |ransform"..&/. "|
00000340  20 50 52 4f 43 50 61 74  68 5f 43 72 65 61 74 65  | PROCPath_Create|
00000350  54 72 61 6e 73 66 6f 72  6d 28 72 6f 74 6d 61 67  |Transform(rotmag|
00000360  74 72 61 6e 73 25 29 22  0d 00 27 2f dc 20 22 20  |trans%)"..'/. " |
00000370  20 50 52 4f 43 50 61 74  68 5f 52 6f 74 61 74 69  | PROCPath_Rotati|
00000380  6f 6e 28 72 6f 74 6d 61  67 74 72 61 6e 73 25 2c  |on(rotmagtrans%,|
00000390  50 49 2f 31 36 29 22 0d  00 28 2c dc 20 22 20 50  |PI/16)"..(,. " P|
000003a0  52 4f 43 50 61 74 68 5f  4d 61 67 6e 69 66 79 28  |ROCPath_Magnify(|
000003b0  72 6f 74 6d 61 67 74 72  61 6e 73 25 2c 31 2e 30  |rotmagtrans%,1.0|
000003c0  35 29 22 0d 00 29 32 dc  20 22 20 20 50 52 4f 43  |5)"..)2. "  PROC|
000003d0  50 61 74 68 5f 54 72 61  6e 73 6c 61 74 69 6f 6e  |Path_Translation|
000003e0  28 72 6f 74 6d 61 67 74  72 61 6e 73 25 2c 32 30  |(rotmagtrans%,20|
000003f0  2c 32 30 29 22 0d 00 2a  0f dc 20 22 45 4e 44 50  |,20)"..*.. "ENDP|
00000400  52 4f 43 22 0d 00 2b 08  dc 20 22 22 0d 00 2c 1b  |ROC"..+.. ""..,.|
00000410  dc 20 22 44 45 46 20 50  52 4f 43 44 72 61 77 4f  |. "DEF PROCDrawO|
00000420  62 6a 65 63 74 73 22 0d  00 2d 0f dc 20 22 20 52  |bjects"..-.. " R|
00000430  45 50 45 41 54 22 0d 00  2e 25 dc 20 22 20 20 53  |EPEAT"...%. "  S|
00000440  59 53 20 22 22 44 72 61  77 5f 53 74 72 6f 6b 65  |YS ""Draw_Stroke|
00000450  22 22 2c 73 71 75 61 72  65 25 22 0d 00 2f 32 dc  |"",square%"../2.|
00000460  20 22 20 20 50 52 4f 43  50 61 74 68 5f 54 72 61  | "  PROCPath_Tra|
00000470  6e 73 66 6f 72 6d 28 73  71 75 61 72 65 25 2c 72  |nsform(square%,r|
00000480  6f 74 6d 61 67 74 72 61  6e 73 25 29 22 0d 00 30  |otmagtrans%)"..0|
00000490  11 dc 20 22 20 20 78 24  3d 47 45 54 24 22 0d 00  |.. "  x$=GET$"..|
000004a0  31 14 dc 20 22 20 55 4e  54 49 4c 20 46 41 4c 53  |1.. " UNTIL FALS|
000004b0  45 22 0d 00 32 0f dc 20  22 45 4e 44 50 52 4f 43  |E"..2.. "ENDPROC|
000004c0  22 0d 00 33 07 fb 20 31  0d 00 34 21 e3 20 69 25  |"..3.. 1..4!. i%|
000004d0  3d 31 20 b8 20 20 32 32  20 3a 20 f3 20 78 24 20  |=1 .  22 : . x$ |
000004e0  3a 20 f1 20 78 24 20 3a  ed 0d 00 35 07 fb 20 37  |: . x$ :...5.. 7|
000004f0  0d 00 36 2a f1 20 27 22  50 72 65 73 73 20 73 70  |..6*. '"Press sp|
00000500  61 63 65 20 62 61 72 21  20 28 45 53 43 20 74 6f  |ace bar! (ESC to|
00000510  20 66 69 6e 69 73 68 29  2e 22 0d 00 37 05 e1 0d  | finish)."..7...|
00000520  00 38 04 0d ff                                    |.8...|
00000525