Museum of modern art

Post Reply
Henko
Posts: 814
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Museum of modern art

Post by Henko »

The byte magazine of december 1986 was about computer graphics. It contained an article about cellular automata. The technique is interesting. If you google on "Byte magazine", you will find a website where nearly all Byte magazines may be downloaded. They fit nicely in "iBooks".

I used the technique in a stand-alone program, of which a will post a second version soon. I also made a little function wich does generate interesting patterns, based on the technique. This function may be called from an app as kind of a gadget. You have to use an additional button in the calling program. Placement and size are free, because upon terminating the function, the original background of the screen is restored.
E4796158-7D13-436F-9681-5F74EEC3216F.png
E4796158-7D13-436F-9681-5F74EEC3216F.png (357.21 KiB) Viewed 2964 times
The code:

Code: Select all

' test program to show "museum" gadget
'
graphics ! graphics clear .8,.8,.8
button "mus" text "Museum visit" at 600,40 size 120,30
draw color 0,0,1 ! draw size 2
for s=20 to 500 step 20
  draw line s,20 to s,500 ! draw line 20,s to 500,s
  next s
draw text "To stop, touch the button again" at 20,550
do ! slowdown ! until button_pressed("mus")
art(100,100,300,200,1,"mus")
end

' museum of modern art, free tour along the paintings
' graphics mode assumed
' x,y,w,h are position and size of the paintings
' p is admiration time in seconds for each painting
' button$ is the name of the button in the calling app
'    that is used to activate the function
' press the button again to stop and to restore 
'    the original background of the app
'
def art(x,y,w,h,p,button$)
refresh off ! draw color .5,.5,.5
w-=odd(w) ! t=6 ! npx=w/2-t ! npy=h/2-t
xs=x+t/3-1 ! ys=y+t/3-1 ! toggle=0
dim va(npx+2),vb(npx+2),r(11)
sprite "bg" scan x-t/2,y-t/2,w,h
draw size t ! draw rect x,y to x+w-t-1,y+h-t ! randomize
do
  for i=1 to 10 ! r(i)=rnd(4) ! next i
  for i=1 to npx ! va(i)=rnd(4) ! next i
  for k=0 to npy ! yy=ys+2*k+2
    for i=1 to npx
      if toggle=0 then ! s=r(va(i-1)+va(i)+va(i+1)) ! vb(i)=s
        else ! s=r(vb(i-1)+vb(i)+vb(i+1)) ! va(i)=s
        end if
      if s=0 then fill color 0,0,0 ! if s=1 then fill color 1,0,0
      if s=2 then fill color 0,1,0 ! if s=3 then fill color 0,0,1
      xx=xs+2*i ! fill rect xx,yy to xx+1,yy+1
      next i ! toggle=1-toggle
    next k ! refresh ! pause p
  until button_pressed(button$)
refresh on
sprite "bg" at x-t/2,y-t/2 ! sprite "bg" stamp
end def

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Museum of modern art

Post by rbytes »

Henko, your modern art is so distinctive that it should be shown in a gallery. I found a virtual gallery that is now showcasing your work. You can download it at this link, then run the .sb file.

https://www.dropbox.com/sh/lu1f75zfcub7 ... AYvua?dl=0

Controlling it can be fun. The gallery will show a new piece of digital art by famed artist Henko every 3 seconds. Press with one finger to rapidly change the art. Press with 2 fingers to replace the digital art with a more traditional painting. Sadly, the woman fascinated by the digital art will vanish. But you can press 3 fingers to bring it - and her - back. Press with 4 fingers to exit.

The control is a bit iffy, because It is difficult to make multiple fingers touch the screen precisely at the same time. And if some fingers don't make contact, the touch number will be incorrect and the wrong (or no) action will happen. Pressing and holding for a beat seems to work best.
Attachments
066B2234-89CE-48E4-BB3B-A97569794584.png
066B2234-89CE-48E4-BB3B-A97569794584.png (3.21 MiB) Viewed 2951 times
The only thing that gets me down is gravity...

Post Reply