BBC BASIC for Windows
« Some RISC OS graphical ditties converted to BB4W »

Welcome Guest. Please Login or Register.
Apr 6th, 2018, 12:00am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1 2  Notify Send Topic Print
 veryhotthread  Author  Topic: Some RISC OS graphical ditties converted to BB4W  (Read 623 times)
dfeugey
Guest
xx Re: Some RISC OS graphical ditties converted to BB
« Reply #21 on: Nov 28th, 2015, 12:41pm »

Cool...
User IP Logged

David Williams
Developer

member is offline

Avatar

meh


PM

Gender: Male
Posts: 452
xx Re: Some RISC OS graphical ditties converted to BB
« Reply #22 on: Nov 28th, 2015, 8:39pm »

on Nov 28th, 2015, 12:41pm, dfeugey wrote:
Cool...


I think it's time for an ARM BBC BASIC 'mega demo'. smiley Ideally not touching assembly language (in order to keep it purely BASIC). Anyway, if one were to go ahead with it, I think the Raspberry Pi 2 would have to be the minimum requirement (the new Titanium sounds very nice, but I can't afford one!).

Perhaps a future Raspberry Pi 3 will feature an ARM Cortex-A15? That'd be nice, wouldn't it? smiley

(Someone ought to suggest it to Eben.)

Some new additions to my website: http://www.proggies.uk

I intend to upload my old and more recent BB4W efforts over the next week or two.


David.
--
« Last Edit: Nov 29th, 2015, 02:24am by David Williams » User IP Logged

dfeugey
Guest
xx Re: Some RISC OS graphical ditties converted to BB
« Reply #23 on: Nov 29th, 2015, 06:47am »

Yep, there is some room for a BBC Basic scene, because of the very fast two offers available (BBCBasic4Win and BBC Basic for RISC OS) and of the presence of interesting computers. On my todo list, I plan to recompile Brandy, with all the latest modifications, and perhaps even CGI management.
User IP Logged

DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: Some RISC OS graphical ditties converted to BB
« Reply #24 on: Dec 4th, 2015, 08:17am »

Hi Folks,

Not really a reply, and not converted from RISC OS, but it seems to fit with the ongoing theme.

Here's a small ditty based on spirograph. Feel free to fiddle with it to your heart's content!

Code:
      REM Spirograph simulation (epicycles). A smaller wheel (r2) rolls around inside a bigger one (r1)
      MODE 21
      ORIGIN 800,600
      r1=500  :REM Radius of fixed circle
      *REFRESH OFF
      FOR denom%=3 TO 10
        da2=denom%  :REM Angle change in inner wheel between each plotted point, in degrees. You can use it like a speed control
        CLS
        FOR num%=1 TO denom%-1
          r2=r1*num%/denom%
          FOR pen=0.1 TO 0.9 STEP 0.01 :REM Distance of pen between centre and edge of smaller wheel
            REM CLS:REM If you unREM this line you can see each individual pattern!
            IF num% MOD 2=0 THEN p=1-pen ELSE p=pen
            PROCDrawIt(0,r1,r2,p,da2,denom%,num%)
            *REFRESH
          NEXT pen
        NEXT num%
      NEXT denom%
      *REFRESH ON
      END
      :
      DEFPROCDrawIt(startangle,r1,r2,pen,da2,denom%,col%)
      LOCAL da1,count%
      da1=da2*r2/r1  :REM angle change around fixed circle for each "step" of moving wheel
      GCOL col%
      count%=0
      MOVE (r1-r2)*COSRAD(startangle+da1*count%)+pen*r2*COSRAD(startangle-da2*count%),(r1-r2)*SINRAD(startangle+da1*count%)+pen*r2*SINRAD(startangle-da2*count%)
      REPEAT
        count%+=1
        DRAW (r1-r2)*COSRAD(startangle+da1*count%)+pen*r2*COSRAD(startangle-da2*count%),(r1-r2)*SINRAD(startangle+da1*count%)+pen*r2*SINRAD(startangle-da2*count%)
      UNTIL count%*da2>=360*denom%
      ENDPROC
 


Best wishes,

D
User IP Logged

David Williams
Developer

member is offline

Avatar

meh


PM

Gender: Male
Posts: 452
xx Re: Some RISC OS graphical ditties converted to BB
« Reply #25 on: Dec 4th, 2015, 7:08pm »

Very nice, David.

Here's one inspired by a GIF animation I came across today whilst searching for something related:

http://www.i.imgur.com/Rnk6JvK.gif

(And here's what I was actually looking for: https://upload.wikimedia.org/wikipedia/commons/1/1a/Fourier_series_square_wave_circles_animation.gif)

Code:
      REM>CIRCWAVES
      REM Idea borrowed from an animated GIF found on Imgur via Reddit.com:
      REM http://www.i.imgur.com/Rnk6JvK.gif
      REM This BB4W version uses native graphics commands

      *FLOAT 64
      MODE 8
      OFF

      COLOUR 1, 64, 64, 64
      COLOUR 2, 255, 255, 255

      gap% = 2*32
      radius% = 2*32

      maxX% = (2*@vdu%!208 DIV gap%) + 1
      maxY% = (2*@vdu%!212 DIV gap%) + 1

      TIME = 0

      *REFRESH OFF

      REPEAT
        CLS
  
        REM Draw the circles first:
        GCOL 1
        FOR Y% = 0 TO maxY%
          cy% = gap%*Y%
          FOR X% = 0 TO maxX%
            cx% = gap%*X%
            CIRCLE cx%, cy%, radius%
          NEXT X%
        NEXT Y%
  
        REM Now draw the moving points:
        GCOL 2
        T% = TIME * 2
        I% = 0
        FOR Y% = 0 TO maxY%
          cy% = gap%*Y%
          FOR X% = 0 TO maxX%
            cx% = gap%*X%
            px% = cx% + radius%*COSRAD(T% + I%)
            py% = cy% + radius%*SINRAD(T% + I%)
            CIRCLE FILL px%, py%, 8
            I% += 15
          NEXT X%
        NEXT Y%
  
        *REFRESH
      UNTIL FALSE
 




EDIT: Which inevitably leads to something like this:

Code:
      REM>CIRCWAVES2

      *FLOAT 64
      MODE 8
      OFF

      FOR I% = 1 TO 15
        COLOUR I%, I%*255/16, I%*255/8, I%*255/4
      NEXT I%

      gap% = 2*16
      radius% = 2*16

      maxX% = (2*@vdu%!208 DIV gap%) + 1
      maxY% = (2*@vdu%!212 DIV gap%) + 1

      arraySz% = maxX% * maxY%

      DIM grid%( arraySz%-1, 2 )

      TIME = 0

      *REFRESH OFF

      REPEAT
        CLS
  
        I% = 0
        T% = TIME
        FOR Y% = 0 TO maxY%-1
          cy% = gap%*Y%
          FOR X% = 0 TO maxX%-1
            cx% = gap%*X%
            A% = T% + 8*I%
            grid%(I%,0) = cx% + radius%*COSRADA%
            grid%(I%,1) = cy% + radius%*SINRADA%
            grid%(I%,2) = I% MOD 15
            I% += 1
          NEXT X%
        NEXT Y%
  
        FOR Y% = 0 TO maxY%-2
          FOR X% = 0 TO maxX%-2
            I% = Y%*maxX% + X%
            GCOL grid%(I%,2)
            MOVE grid%(I%,0), grid%(I%,1)
            MOVE grid%(I%+1,0), grid%(I%+1,1)
            PLOT 85, grid%(I%+maxX%,0), grid%(I%+maxX%,1)
            PLOT 85, grid%(I%+maxX%+1,0), grid%(I%+maxX%+1,1)
          NEXT X%
        NEXT Y%
  
        *REFRESH
      UNTIL FALSE
 
« Last Edit: Dec 4th, 2015, 7:48pm by David Williams » User IP Logged

dfeugey
Guest
xx Re: Some RISC OS graphical ditties converted to BB
« Reply #26 on: Dec 7th, 2015, 05:30am »

A full pack of screensavers smiley
User IP Logged

Pages: 1 2  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls