0 reply
0 recast
0 reaction
8 replies
6 recasts
72 reactions
2 replies
0 recast
6 reactions
1 reply
1 recast
5 reactions
... turns out raytracing is ALSO easy when you use JS and SDFs and it looks a little something like this:
A=([x,y,z],[a,b,c],t=1)=>[x+a*t,y+b*t,z+c*t]; // 3D vector addmul
IX=(SDF,ro,rd,t=0,h)=>{for(;t<MAXD&&(h=fudge*SDF(A(ro,rd,t)))>SURFD;t+=h);return t} // raytrace intersect func
but feel free to write your own 1 reply
2 recasts
5 reactions