I wrote this to see if I really understood Shockwave's lovely twisting bar code, and I wrote it in yabasic just to prove it can still be done, and then I added copper bars because no demo is complete without copper bars is it?
Have fun!
Jim
'twisty fatty shrinky barry thing, with copper bars
'by Jim 18/10/2006
sw=640
sh=512
hsw=sw/2
open window sw,sh
'twisty barry thing stuff
ascale=3.14/180
w=100
inc=0
iinc=0.01
dim c(4,3)
c(0,0)=255:c(0,1)=0:c(0,2)=0
c(1,0)=0:c(1,1)=0:c(1,2)=255
c(2,0)=0:c(2,1)=255:c(2,2)=0
c(3,0)=255:c(3,1)=255:c(3,2)=0
c(4,0)=c(0,0):c(4,1)=c(0,1):c(4,2)=c(0,2)
'copper bar stuff
dim cuy(3)
dim cui(3)
dim rgb(3)
cuy(0)=0:cuy(1)=0:cuy(2)=0
cui(0)=.005:cui(1)=.007:cui(2)=.012
cuh=80
repeat
setdispbuf d
d=1-d
setdrawbuf d
clear window
copperbars()
a=0
inc=inc+iinc
for y=0 to sh-100*abs(inc)
x1 = w * (7+abs(inc))/7 * sin(a*ascale)
x2 = w * (7+abs(inc))/7 * cos(a*ascale)
x1=abs(x1):x2=abs(x2)
q=int(a/90)
if and(q,1)<>0 then
t = x1:x1 = x2:x2 = t
fi
ow = hsw-((x1+x2)/2)
setrgb 1,c(q+1,0),c(q+1,1),c(q+1,2)
line ow,y,ow+x1,y
setrgb 1,c(q,0),c(q,1),c(q,2)
line ow+x1,y,ow+x1+x2,y
a=a+inc
if a<0 a=a+360
if a>=360 a=a-360
next
if inc>2 or inc<-2 iinc=-iinc
until (peek("port1")<>0)
sub copperbars()
for y=0 to sh-1
rgb(0)=0
rgb(1)=0
rgb(2)=0
for c=0 to 2
if y>cuy(c) and y<cuy(c)+cuh then
rgb(c)=(cuh/2-abs(y-cuy(c)-(cuh/2)))*(255/cuh)
fi
cuy(c)=cuy(c)+cui(c)
if cuy(c)>=sh-cuh or cuy(c)<=0 then
cui(c)=-cui(c)
fi
next
if rgb(0)<>0 or rgb(1)<>0 or rgb(2)<>0 then
setrgb 1,rgb(0),rgb(1),rgb(2)
line 0,y,sw,y
fi
next
end sub
<edit>it was fast already, but I just stopped it drawing black where there are no copper bars