Live data from Hacker News

Show HN: A simple infinite world in WebGL

erkaman.github.io

1–10 of 61 posts

Re: Show HN: A simple infinite world in WebGL

#2
In this demo, I implemented an infinitely continuing, vaporwave-like world in WebGL. If you can't run it for some reason, a recorded gif of the demo can be found here: https://github.com/Erkaman/wireframe-world.

As for the implementation, it is not very difficult stuff; I divide up the world into chunks(just like in Minecraft), and as the camera traverses the world, the chunks that become out of range are thrown away and are no longer rendered. And in the far away horizon I keep adding new chunks, to give the illusion that the world is infinite.

So it is not very complicated stuff; the source code is only ~450LOC, which can be found here: https://github.com/Erkaman/wireframe-world/blob/gh-pages/wir.... It is relatively well-commented, so it should be easy to understand, I hope.

Re: Show HN: A simple infinite world in WebGL

#3
post #2

In this demo, I implemented an infinitely continuing, vaporwave-like world in WebGL. If you can't run it for some reason, a recorded gif of the demo can be found here: https://github.com/Erkaman/wireframe-world . As for the implementation, it is not very difficult stuff; I divide up the world into chunks(just like in Minecraft), and as the camera traverses the world, the chunks that become out of range are thrown awa…

It is really nice. Thanks for sharing.

Is there any particular reason you did this?

Re: Show HN: A simple infinite world in WebGL

#4
post #2

In this demo, I implemented an infinitely continuing, vaporwave-like world in WebGL. If you can't run it for some reason, a recorded gif of the demo can be found here: https://github.com/Erkaman/wireframe-world . As for the implementation, it is not very difficult stuff; I divide up the world into chunks(just like in Minecraft), and as the camera traverses the world, the chunks that become out of range are thrown awa…

>var f = 0.0015974 Where did this number come from? Is it arbitrary?

Re: Show HN: A simple infinite world in WebGL

#5
post #2

In this demo, I implemented an infinitely continuing, vaporwave-like world in WebGL. If you can't run it for some reason, a recorded gif of the demo can be found here: https://github.com/Erkaman/wireframe-world . As for the implementation, it is not very difficult stuff; I divide up the world into chunks(just like in Minecraft), and as the camera traverses the world, the chunks that become out of range are thrown awa…

It starts visually glitching out after 10 seconds or so, for me. Doesn't really ruin the experience, but as it appears to get more pronounced with time, I don't think we'll reach infinity. :)

Re: Show HN: A simple infinite world in WebGL

#6
post #2

In this demo, I implemented an infinitely continuing, vaporwave-like world in WebGL. If you can't run it for some reason, a recorded gif of the demo can be found here: https://github.com/Erkaman/wireframe-world . As for the implementation, it is not very difficult stuff; I divide up the world into chunks(just like in Minecraft), and as the camera traverses the world, the chunks that become out of range are thrown awa…

"If you can't run it for some reason, a recorded gif of the demo can be found here"

WebGL in a nutshell.

Re: Show HN: A simple infinite world in WebGL

#7
post #2

In this demo, I implemented an infinitely continuing, vaporwave-like world in WebGL. If you can't run it for some reason, a recorded gif of the demo can be found here: https://github.com/Erkaman/wireframe-world . As for the implementation, it is not very difficult stuff; I divide up the world into chunks(just like in Minecraft), and as the camera traverses the world, the chunks that become out of range are thrown awa…

The .js file is over 10,000 lines of code. How did it get so bloated from your 450 lines of code?

Re: Show HN: A simple infinite world in WebGL

#8
post #2

In this demo, I implemented an infinitely continuing, vaporwave-like world in WebGL. If you can't run it for some reason, a recorded gif of the demo can be found here: https://github.com/Erkaman/wireframe-world . As for the implementation, it is not very difficult stuff; I divide up the world into chunks(just like in Minecraft), and as the camera traverses the world, the chunks that become out of range are thrown awa…

The .js file is over 10,000 lines of code. How did it get so bloated from your 450 lines of code?

Node

Re: Show HN: A simple infinite world in WebGL

#9
post #2

In this demo, I implemented an infinitely continuing, vaporwave-like world in WebGL. If you can't run it for some reason, a recorded gif of the demo can be found here: https://github.com/Erkaman/wireframe-world . As for the implementation, it is not very difficult stuff; I divide up the world into chunks(just like in Minecraft), and as the camera traverses the world, the chunks that become out of range are thrown awa…

The .js file is over 10,000 lines of code. How did it get so bloated from your 450 lines of code?

It's probably a bundled JS file containing all of his dependencies.

Re: Show HN: A simple infinite world in WebGL

#10
post #2

In this demo, I implemented an infinitely continuing, vaporwave-like world in WebGL. If you can't run it for some reason, a recorded gif of the demo can be found here: https://github.com/Erkaman/wireframe-world . As for the implementation, it is not very difficult stuff; I divide up the world into chunks(just like in Minecraft), and as the camera traverses the world, the chunks that become out of range are thrown awa…

The .js file is over 10,000 lines of code. How did it get so bloated from your 450 lines of code?

It includes imported libraries, primarily regl[1] which is 8228 lines long.

[1]: https://github.com/mikolalysenko/regl/blob/gh-pages/dist/reg...

Post reply on HN