curved-ruler

@curved_ruler@mastodon.gamedev.place
713 Followers
561 Following
4.1K Posts
Spirit of the Land. Computering around.
Webhttps://curved-ruler.codeberg.page
@bleeptrack decoding is another vibe
I Dont Know Tell You GIF - Tenor GIF Keyboard - Bring Personality To Your Conversations | Say more with Tenor

I Dont Know Tell You GIF - Tenor GIF Keyboard - Bring Personality To Your Conversations | Say more with Tenor

Tenor
let d = 0;
let p = {x:x, y:y, z:z};
for(let i=0; i<10; i+=1)
{
p.y-=clamp(p.y,0.0,0.3);
p.x-=0.05; p.z-=0.05;
p.x=Math.abs(p.x); p.y=Math.abs(p.y); p.z=Math.abs(p.z);
mmul1(p, rotate2D(0.6));
mmul2(p, rotate2D(1.4));
p.x*=1.1; p.y*=1.1; p.z*=1.1;
d=length(p)-0.05;
d*=0.39;
}
return d;
let clamp = (x,a,b) => (x>a ? x<b ? x : b : a);
let length = (p) => (Math.sqrt(p.x*p.x+p.y*p.y+p.z*p.z));
let rotate2D = (r) => ([Math.cos(r), Math.sin(r), -Math.sin(r), Math.cos(r)]);
let mmul1 = (p,m) => {let a = p.y*m[0]+p.x*m[1]; let b = p.y*m[2]+p.x*m[3]; p.y=a;p.x=b; };
let mmul2 = (p,m) => {let a = p.z*m[0]+p.x*m[1]; let b = p.z*m[2]+p.x*m[3]; p.z=a;p.x=b; };
tk87
@rh2 thanks its just a slight modification of the eq in the first toot and playing with scale
arcane die
×