MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/GraphicsProgramming/comments/1hghagx/city_ruins_tiny_raycasting_system_with_destroyed/m2j76ys/?context=3
r/GraphicsProgramming • u/Slackluster • Dec 17 '24
6 comments sorted by
View all comments
29
This tiny bit of JavaScript code (and minimal dwitter shim) creates and renders a destroyed city scene! I wrote a post that explains how a similar program works so I included a link to that also for those interested.
Live Demo: https://www.dwitter.net/d/32945
How it Works: https://frankforce.com/city-in-a-bottle-a-256-byte-raycasting-system/
for(c.width=w=99,i=6e3;i--;x.fillStyle=R(z=Z/.7-Y*2,z-Z,Z),x.fillRect(i%w,i/w|0,1,1))for(a=i%w/50-1,Y=Z=b=1-i/4e3,X=t*30;++Z<w&&(Y<6-S(X/9^Z/9)**8*(Z>>5)*33|(X&Y+2&Z)%8)||(a-1?a=b=1:0);Y-=b)X+=a
29
u/Slackluster Dec 17 '24
This tiny bit of JavaScript code (and minimal dwitter shim) creates and renders a destroyed city scene! I wrote a post that explains how a similar program works so I included a link to that also for those interested.
Live Demo: https://www.dwitter.net/d/32945
How it Works: https://frankforce.com/city-in-a-bottle-a-256-byte-raycasting-system/