Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.acorn.programmer > #5874
| From | Sebastian Barthel <naitsabes@freenet.de> |
|---|---|
| Newsgroups | comp.sys.acorn.programmer |
| Subject | Re: Rotating a Colour-Filled Square |
| Date | 2019-11-15 22:23 +0000 |
| Organization | solani.org |
| Message-ID | <qqn8gi$q84$2@solani.org> (permalink) |
| References | (3 earlier) <58125f40fdbasura@invalid.addr.uk> <qqi40d$e0m$1@solani.org> <qqjgq3$dkd$1@solani.org> <5812df5497basura@invalid.addr.uk> <qqk9v8$ull$1@solani.org> |
Am Thu, 14 Nov 2019 19:29:44 +0000 schrieb Sebastian Barthel: > Am Thu, 14 Nov 2019 16:24:43 +0000 schrieb Richard Ashbery: > >> In article <qqjgq3$dkd$1@solani.org>, Sebastian Barthel >> <naitsabes@freenet.de> wrote: >>> Am Wed, 13 Nov 2019 23:35:41 +0000 schrieb Sebastian Barthel: >> >>> > Am Wed, 13 Nov 2019 17:05:44 +0000 schrieb Richard Ashbery: >>> > >>> >> ... but what I'm really after is a method to overlay the existing >>> >> square with other successively smaller squares in alternating >>> >> colours. > >> This is turning out to be a rather nice little animation. Keep up the >> good work. I think it needs more squares (bearing in mind the overlap >> issue blanking out the colour) and a larger colour range but is pretty >> good as it is. An intesting effect is the rotation speed variation - >> probably due to the # of sine/cosine calculations required. And - to complete it a little bit more - here is the variant with TRIANGLEs as proposed by druck. This allows to overlap the layers, wich means: more layers and/or greater values for the rotation difference between them. Works fine, and - I didn't measure it, but - feels a bit faster than the normal FILLs. Mark: this time the squares are filled in their full area and they are plotted from the bottom to the top of the square stack. One can ask: Why isn't there a TRIANGLE command or TRIANGLE FILL in the BASIC ? The functions exists. With this a RECTANGLE FILL ROTATE command is also a possibility. OK, questions, questions, now for the program ... REM BBC BASIC Code , rotating squares - filled with fancy colours REM uses triangles to fill the squares, allows overlapping ON ERROR REPORT : PRINT " ERROR IN ";ERL : END DIM STB(720) : REM STB sinustable R=0 FOR I%=0 TO 719 : STB(I%)=SIN(R) : R=R+(4*PI /720) : NEXT I% MODE 1280,1024,16 MODE 1280,1024,8 SCREENBANK%=2 ORIGIN 1024,1024 WHILE R<>-1 FOR R=0 TO 360 STEP 3 WAIT SYS "OS_Byte",113,SCREENBANK% SCREENBANK% = SCREENBANK% MOD 2 +1 SYS "OS_Byte",112,SCREENBANK% CLG ANGLESIN=R ANGLECOS=R+90 FOR F=900 TO 50 STEP -85 GCOL ( F MOD 32 ) X0=STB(ANGLESIN)*F : Y0=STB(ANGLECOS)*F X1=STB(ANGLESIN+90)*F : Y1=STB(ANGLECOS+90)*F X2=STB(ANGLESIN+180)*F : Y2=STB(ANGLECOS+180)*F X3=STB(ANGLESIN+270)*F : Y3=STB(ANGLECOS+270)*F MOVE X0,Y0 MOVE X2,Y2 SYS "OS_Plot",85,X1,Y1 MOVE X0,Y0 MOVE X2,Y2 SYS "OS_Plot",85,X3,Y3 ANGLESIN=ANGLESIN+( STB(ANGLESIN)*14 ) ANGLECOS=ANGLESIN+90 NEXT F NEXT R ENDWHILE END
Back to comp.sys.acorn.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-12 14:05 +0000
Re: Rotating a Colour-Filled Square Sebastian Barthel <naitsabes@freenet.de> - 2019-11-12 23:04 +0000
Re: Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-14 16:24 +0000
Re: Rotating a Colour-Filled Square Sebastian Barthel <naitsabes@freenet.de> - 2019-11-14 19:29 +0000
Re: Rotating a Colour-Filled Square Sebastian Barthel <naitsabes@freenet.de> - 2019-11-15 21:26 +0000
Re: Rotating a Colour-Filled Square Sebastian Barthel <naitsabes@freenet.de> - 2019-11-15 22:23 +0000
Re: Rotating a Colour-Filled Square Sebastian Barthel <naitsabes@freenet.de> - 2019-11-15 22:31 +0000
Re: Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-16 14:05 +0000
Re: Rotating a Colour-Filled Square Sebastian Barthel <naitsabes@freenet.de> - 2019-11-16 19:47 +0000
Re: Rotating a Colour-Filled Square druck <news@druck.org.uk> - 2019-11-18 20:02 +0000
Re: Rotating a Colour-Filled Square Steve Fryatt <news@stevefryatt.org.uk> - 2019-11-16 00:39 +0000
Re: Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-16 12:21 +0000
Re: Rotating a Colour-Filled Square Steve Fryatt <news@stevefryatt.org.uk> - 2019-11-17 10:04 +0000
Re: Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-17 13:50 +0000
Re: Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-17 14:19 +0000
Re: Rotating a Colour-Filled Square Steve Fryatt <news@stevefryatt.org.uk> - 2019-11-17 14:21 +0000
Re: Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-17 15:34 +0000
Re: Rotating a Colour-Filled Square Steve Fryatt <news@stevefryatt.org.uk> - 2019-11-17 16:25 +0000
Re: Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-18 16:17 +0000
Re: Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-18 16:55 +0000
Re: Rotating a Colour-Filled Square druck <news@druck.org.uk> - 2019-11-16 11:48 +0000
Re: Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-16 14:21 +0000
Re: Rotating a Colour-Filled Square druck <news@druck.org.uk> - 2019-11-18 20:04 +0000
Re: Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-19 14:48 +0000
Re: Rotating a Colour-Filled Square druck <news@druck.org.uk> - 2019-11-19 20:26 +0000
Re: Rotating a Colour-Filled Square Brian Jordan <brian.jordan9@btinternet.com> - 2019-11-19 20:39 +0000
Re: Rotating a Colour-Filled Square Dave <dave@triffid.co.uk> - 2019-11-20 07:50 +0000
Re: Rotating a Colour-Filled Square Alan Adams <alan@adamshome.org.uk> - 2019-11-20 11:26 +0000
Re: Rotating a Colour-Filled Square Sebastian Barthel <naitsabes@freenet.de> - 2019-11-16 19:27 +0000
Re: Rotating a Colour-Filled Square Steve Fryatt <news@stevefryatt.org.uk> - 2019-11-16 23:37 +0000
Re: Rotating a Colour-Filled Square druck <news@druck.org.uk> - 2019-11-14 20:47 +0000
Re: Rotating a Colour-Filled Square druck <news@druck.org.uk> - 2019-11-14 20:44 +0000
Re: Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-15 13:35 +0000
Re: Rotating a Colour-Filled Square Steve Fryatt <news@stevefryatt.org.uk> - 2019-11-16 00:32 +0000
Re: Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-13 12:54 +0000
Re: Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-13 17:05 +0000
Re: Rotating a Colour-Filled Square Sebastian Barthel <naitsabes@freenet.de> - 2019-11-13 23:35 +0000
Re: Rotating a Colour-Filled Square Sebastian Barthel <naitsabes@freenet.de> - 2019-11-14 12:20 +0000
Re: Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-14 14:09 +0000
Re: Rotating a Colour-Filled Square Richard Ashbery <basura@invalid.addr.uk> - 2019-11-14 15:21 +0000
Re: Rotating a Colour-Filled Square news@sprow.co.uk - 2019-11-14 05:00 -0800
csiph-web