arkivo.art

Genuary 2023 Day 8 - Signed Distance Functions

Carson

-- genuary #8 2023 -- signed distance functions -- by carson kompon -- huge thanks to piter pasma's explanation video on sdfs function dist(x,y) return sqrt((x*x+y*y)) end function sdf_circle(x,y,cx,cy,r) x-=cx y-=cy return dist(x,y) - r end function sdf(x,y) dd = 1.5 circle1 = sdf_circle(x,y,cos(t()/16+.5)/dd,sin(t()/16+.5)/dd,.2+sin(t()/16)/20) circle1 = abs(circle1)-.1 circle2sub = sdf_circle(x,y,cos(t()/16)/dd-.15,sin(t()/16)/dd,.2+sin(t()/16+.5)/20) circle2norm = sdf_circle(x,y,cos(t()/16)/dd,sin(t()/16)/dd,.3+sin(t()/16+.5)/20) circle2 = max(-circle2sub,circle2norm) waves = -y+.3+sin(t()+x)/64 waves = waves/2 return min(min(circle1, circle2), waves) end pal({[0]=0,128,133,141,133,0,0,0,12,140,1,129,130,132,9,10},1) ::_:: x=rnd(2)-1 y=rnd(2)-1 d=sdf(x,y) c=0 if(d<-.02)c=d*16 if(d>.02)c=1+(1+y*2+t()/4)%4 circfill((x+1)*64,(y+1)*64,1,c) goto _

Blockchain tezos
Smart Contract KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton
Platform HEN
Token ID 805737
Minted at 08 Jan 2023, 17:14 UTC

Metadata URI Metadata URI
Artifact URI Artifact URI

creativecoding , generative , animated , sdf , opensource , genuary , pico8 , pico-8 , genuary8

JavaScript true
Networked false

Timestamp (UTC) 2024-08-17T05:18:05.582Z
Snapshot version 1
External network calls 0
Download Snapshot Download
Snapshot Image