It runs really slow for me, like 1 FPS. Firefox 29 on Linux.
A first-person engine in 265 lines of JS
21–30 of 99 posts
Re: A first-person engine in 265 lines of JS
#22It runs really slow for me, like 1 FPS. Firefox 29 on Linux.
Re: A first-person engine in 265 lines of JS
#23Re: A first-person engine in 265 lines of JS
#24It runs really slow for me, like 1 FPS. Firefox 29 on Linux.
Interesting. Does FF 29 on linux perhaps have purely software graphics? It runs much faster than 1 fps on iphones and most androids, 60 fps on modern desktops in safari/chrome, and 30 fps on FF / osx.
Re: A first-person engine in 265 lines of JS
#25Heh, reminds me of kkrieger - a first person shooter in 100KB for a scene demo. https://www.scene.org/file.php?file=%2Fparties%2F2004%2Fbrea...
( Thread: https://news.ycombinator.com/item?id=7739599 )
Re: A first-person engine in 265 lines of JS
#26My raycast engine in Javascript needs a few more lines and works a little bit different, but gives also impressive results I think :) . http://simulationcorner.net/index.php?page=comanche
Re: A first-person engine in 265 lines of JS
#27Re: A first-person engine in 265 lines of JS
#28To illustrate the question, see https://en.wikipedia.org/wiki/File:Panotools5618.jpg – why do we see the world as in the bottom image instead of in the top one? After all, our eye really is at different distances from different parts of a straight wall, so it sounds logical that we would see the fisheye effect describe in the article. Is the rectilinearity of the image we see caused by the shape of the lens in our eye, or by post-processing in our brain?
Re: A first-person engine in 265 lines of JS
#29It runs really slow for me, like 1 FPS. Firefox 29 on Linux.
What graphics card/driver combination do you have? It runs decently for me with Firefox 29 on Linux, intel graphics (Sandy Bridge).
Note that it is using canvas 2d rather than canvas 3d (aka WebGL[1]).
But if you take ray casting to extreme, you end up with Ray Tracing[2], which is kinda expensive. Which is why we had such an effusive conversation a few months ago about hardware accelerated RayTracing[3].
A sample ray traced scene from AlteredQualia[4] (2nd largest[5] contributor to the famous Three.js Library): http://alteredqualia.com/three/examples/raytracer_sandbox_re...
[1] https://developer.mozilla.org/en-US/docs/Web/WebGL/Getting_s...
[2] http://en.wikipedia.org/wiki/Ray_tracing_%28graphics%29
[3] https://news.ycombinator.com/item?id=7425303
Re: A first-person engine in 265 lines of JS
#30It is very interesting to me that you need to multiply the distance-to-wall by the cosine of the angle to transform the image from fisheye to normal. It makes me wonder, why is it that our eye in real life sees straight lines as straight, the way this demo renders the image? To illustrate the question, see https://en.wikipedia.org/wiki/File:Panotools5618.jpg – why do we see the world as in the bottom image instead of…