A first-person engine in 265 lines of JS
It 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?<p>To illustrate the question, see <a href="https://en.wikipedia.org/wiki/File:Panotools5618.jpg" rel="nofollow">https://en.wikipedia.org/wiki/File:Panotools5618.jpg</a> – 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?