home *** CD-ROM | disk | FTP | other *** search
RISC OS BBC BASIC V Source | 1992-09-28 | 2.2 KB | 72 lines |
- >MkRotRod
- auxillary library file for "MakeSpGen"
- creates rotating rod, with rod rotating on rod
- *********************************************************************
- These are constants
- _Define_Constants
- Y Usage$ = "[-Start <r>] [-Radius <r>] [-Delta <radians>] [-Colours <rrGGbb:rrGGbb>]"
- + Param$ = "Start,Radius,Delta,Colours"
- Start = 0.6
- Radius = 0.3
- Delta = 2*
- ! Colours$ = "ffFFff:ff22bb"
- Col%(1)
- *********************************************************************
- " Parse the command line
- _Params(b%)
- getr(Start, b%!0)
- getr(Radius, b%!4)
- getr(Delta, b%!8)
- getz(Colours$, b%!12)
- _Read_Colours(Colours$, Col%(), 2)
- *********************************************************************
- ! The mode has been set
- _Define_Palette
- 19, &0, 16, &00, &00, &00 :
- palette
- 19, &1, 16, &00, &ff, &00
- 19, &2, 16, &ee, &00, &00
- 19, &3, 16, &ff, &bb, &44
- 19, &4, 16, &ee, &ee, &00
- 19, &5, 16, &bb, &88, &55
- 19, &6, 16, &aa, &44, &bb
- 19, &7, 16, &44, &ff, &00
- 19, &8, 16, &66, &dd, &ff
- 19, &9, 16, &44, &33, &bb
- 19, &a, 16, &77, &77, &77
- 19, &b, 16, &bb, &ff, &dd
- 19, &c, 16, &11, &11, &dd
- 19, &d, 16, &ff, &99, &44
- 19, &e, 16, &ff, &ff, &ff
- 19, &f, 16, &ee, &ee, &ee
- *********************************************************************
- f = (0, 1]
- 6. xc, yc = OS co-ordinates of center
- _Draw_Frame(f, xc, yc)
- c, s, r
- "ColourTrans_SetGCOL", Col%(0),,, &100, 0
- c =
- (f*2*
- s =
- (f*2*
- line(xc+RMax*c, xc+RMax*s, xc-RMax*c, xc-RMax*s)
- "ColourTrans_SetGCOL", Col%(1),,, &100, 0
- xc += RMax * Start * c
- yc += RMax * Start * s
- c =
- ((1-f)*2*
- + Delta)
- s =
- ((1-f)*2*
- + Delta)
- r = RMax * Radius
- line(xc+r*c, xc+r*s, xc-r*c, xc-r*s)
- line(x1, y1, x2, y2)
- dx, dy
- dx= -X
- dy= -Y
-
- x1+dx, y1+dy
-
- x2-dx, y2-dy
-