Japanese Pattern
#1
Oh hey! I bet Chris would like this:
Code:
' japanese pattern.bas SmallBASIC 0.12.11 (B+=MGA) 2018-05-08

sx = 300 : sy = 200 : sa = 0 : sz = 10
for sz = 5 to 10 step .1
 cls
 for y = -1 to 10
   if y mod 2 then xoff = sz * 10 else xoff = 0
   for x = -1 to 10
     jptile x * sz * 20 + xoff, y * sz * 10, sa
   next
 next
 showpage
 delay 300
next
pause
sub jptile(x, y, sa)
 jp2 x, y, sa
 jp2 x + 8 * sz, y + 15 *sz, sa - pi/2
end

sub jp2(x, y, a)
 jp x, y, a
 jp xa, ya, a + pi
end

sub jp(x,y,a)
 xa = x
 ya = y
 go xa, ya, 13 * sz, a + 0
 go xa, ya, 1 * sz, a + pi/2
 go xa, ya, 2 * sz, a + pi
 go xa, ya, 2 * sz, a + pi/2
 go xa, ya, 1 * sz, a + pi
 go xa, ya, 2 * sz, a - pi/2
 go xa, ya, 3 * sz, a + pi
 go xa, ya, 15 * sz, a + pi/2
 go xa, ya, 3 * sz, a + 0
 go xa, ya, 2 * sz, a - pi/2
 go xa, ya, 1 * sz, a + 0
 go xa, ya, 2 * sz, a + pi/2
 go xa, ya, 2 * sz, a + 0
 go xa, ya, 1 * sz, a + pi/2
end


sub go(x, y, sz, ra)
 xa = xa + sz * cos(ra)
 ya = ya + sz * sin(ra)
 line x, y, xa, ya
end



Ha! You know scrolling this up and down quickly creates an FX, let's see if I can code it.
B += x
Reply
#2
Eye Buzz! A little more subtle than scrolling the snapshot above back and forth in browser.
Code:
' japanese pattern.bas SmallBASIC 0.12.11 (B+=MGA) 2018-05-08
' mod 2018-06-01 fx

sx = 300 : sy = 200 : sa = 0 : sz = 10 : dir = 1
while 1
yo = yo - 5 * dir
if yo < 0 then yo = 0 : dir = dir *-1
if yo > 30 then yo = 30 : dir = dir * -1
cls
for y = -1 to 10
   if y mod 2 then xoff = sz * 10 else xoff = 0
   for x = -1 to 10
     jptile x * sz * 20 + xoff, y * sz * 10 + yo, sa
   next
next
showpage
delay 30
wend

sub jptile(x, y, sa)
jp2 x, y, sa
jp2 x + 8 * sz, y + 15 *sz, sa - pi/2
end

sub jp2(x, y, a)
jp x, y, a
jp xa, ya, a + pi
end

sub jp(x,y,a)
xa = x
ya = y
go xa, ya, 13 * sz, a + 0
go xa, ya, 1 * sz, a + pi/2
go xa, ya, 2 * sz, a + pi
go xa, ya, 2 * sz, a + pi/2
go xa, ya, 1 * sz, a + pi
go xa, ya, 2 * sz, a - pi/2
go xa, ya, 3 * sz, a + pi
go xa, ya, 15 * sz, a + pi/2
go xa, ya, 3 * sz, a + 0
go xa, ya, 2 * sz, a - pi/2
go xa, ya, 1 * sz, a + 0
go xa, ya, 2 * sz, a + pi/2
go xa, ya, 2 * sz, a + 0
go xa, ya, 1 * sz, a + pi/2
end


sub go(x, y, sz, ra)
xa = xa + sz * cos(ra)
ya = ya + sz * sin(ra)
line x, y, xa, ya
end
B += x
Reply
#3
Here it is in JB with thicker lines, color and even at angles:



Edit: removed a repeated B&W image
B += x
Reply
#4
Cool. Even though the last two images were monochromatic, I could have sworn, that I saw flashes of colour... Nicely done! (the designs not the flashy-colour-thingy...) lol

J
May your journey be free of incident.

Live long and prosper.
Reply