Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #5875

Re: Rotating a Colour-Filled Square

From Sebastian Barthel <naitsabes@freenet.de>
Newsgroups comp.sys.acorn.programmer
Subject Re: Rotating a Colour-Filled Square
Date 2019-11-15 22:31 +0000
Organization solani.org
Message-ID <qqn90i$q84$3@solani.org> (permalink)
References (4 earlier) <qqi40d$e0m$1@solani.org> <qqjgq3$dkd$1@solani.org> <5812df5497basura@invalid.addr.uk> <qqk9v8$ull$1@solani.org> <qqn8gi$q84$2@solani.org>

Show all headers | View raw


Am Fri, 15 Nov 2019 22:23:14 +0000 schrieb Sebastian Barthel:

> 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.


... need to enhance my usenet-posting skills ; errors by "line-
concatenation" removed ( ":" in the MOVE lines added )





 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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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