Going back in time a little here but I feel like I would be remiss if I didn't do anything for this prompt. The amounts of cohesion, separation, and alignment that these little boids have all vary with time according to sine waves with the same frequency. High cohesion = low separation and alignment, and so forth. Maybe more interesting in a longer video but I needed to get it under 10 MB to upload it. :)
I combined #Genuary29 and #Genuary30 to make an SDF with the extremely useful new shader-blur filter that was added to #p5js last year. It reminds me of how I used to always thoroughly blend my pastel drawings. I love it so much. I spruced up one of my SDF sketches from the previous #Genuary using a few techniques I learned over the last year, and a couple things I figured out while working on it.
function c(x,y,a,u,v,d,k)
e=cos(a)
f=sin(a)/2
p=x-ed/2
q=y-fd/2
r=p+ed
s=q+fd
o=.2
if(u==0)o=1
for i=0,d,o do
U=ui
V=vi
line(p+U,q+V,r+U,s+V,k)
line(p+ei,q+fi,p+ud+ei,q+vd+fi,k)
end
end
::_::
?"^1^cf"
a=t()/8
srand(3)
for j=1,18do
b=a*rnd()r=rnd(48)
x=sin(b)*r+63
y=cos(b)*r+78
z=({{-sin(a),cos(a)/2,8},{0,-1,9},{0,-1,1,.25}})[j%3+1]
a+=z[4]or 0
c(x,y,a,z[1],z[2],20+sin(a+rnd())*12,z[3])
end
goto _
"Curse"
The Seer knelt by the flowers, withered echoes of life lost. Struggling against the cold wind, just like the Warrior before. The Old Gods do not forgive easily.
r,o,s=rnd,line,sin::_::?"^1^c7"
f=t()srand()for i=0,20do
x=r(24)+48y=r(16)+86a=r()d=.3+s(a+f+s(a*.7-f/6)^2/3)/19o(x,y,x,y,0)l=r{0,0,15}for j=0,l do
u=cos(d)v=s(d)x+=u3y+=v3d*=.94o(x,y)end
for j=7-l\2,7do
u*=.9v*=.9x+=u2y+=v2e=j%22-1o(x+(u-ve)2,y+(v+ue)*2)end
end
goto _
I haven't managed to get my head space into GPU. So here's some shading with CPU...
The object (here a sphere) is specified by an array of Locations and normal vectors. The angle between light direction and normal vector tells how bright a point is. Then it gets drawn.
Random walks were one of the things that first attracted me to generative art. Here's the output of a bounded random walk on a 64 x 64 grid, with the hue changing just a teeny bit on each step. This was what the grid looked like when it finally got completely filled after ~139,000 steps.
r=0
::_::
cls(15)
srand(r\32)
u,v=rnd(128),rnd(128)
for i=0,255do
y=i\168+4
x=i%168+4
if((rnd()<.1 or (rnd()<.5 and (x-u)^2+(y-v)^2<2000)) and r%32<16)then poke(i,@i+4*rnd{-1,1})end
a=@i/256-1/8
clip(x-4,y-4,8,8)
circfill(x+cos(a)*99,y+sin(a)*99,99,8)
end
r+=1
flip()
goto _
"The Proof"
Shame, the scholar is long gone. His four-color map concept was wrong. You conquered the world, and now one color is enough!
Wait! Was it a trick to start the conquest?
r=rnd
::_::?"^1^cf^!5f11●◆"
f=t().1
s=f%30
for y=0,162,15do
for x=y\15%216,127,34do
srand(y\30+f\30+x)
c=r{"⌂","へ","^. p\xa8 p\xa8 ","",' |j"'}
for i=0,35do
a=i/36
u=cos(a)
v=sin(a)/2
d=20-cos(a3)^23
pset(x+ud,y+vd-s,2)
if(i%9<1)?c,x+u9-4,y+v*9-4-s,r{1,5}
end
end
end
goto _
"Screensaver"
You sit, dazed, thinking about what you've done until a screensaver awakens you from your stupor. You still can't believe it. You pressed the key; you did it. All hell has broken loose.
Also: Monthly High-Resolution Render for Patrons of Level Square and up (25600x14400)
Octrose Pattern achieved by the Cut-and-Project Method:
An 8-D Lattice cut by a skew plane lying through it a 2-face gets projected onto the plane iff its dual 6-face intersects the plane. To check this I take all the 5-faces bounding the 6-face and check their signed distance to the plane.