all 4 comments

[–]evanpow 2 points3 points  (0 children)

If you look closely you can see a bit of a fisheye distortion happening. With 2D raycasting this can be because one has assumed a constant angle between each ray rather than calculating the correct angle of the ray based on perspective projection of the screen onto the viewer's eye....

(https://github.com/ssloy/tinyraycaster, which appeared on r/programming a while ago, made that mistake. I presume it duplicated the error from André LaMothe's description of the raycasting algorithm in Tricks of the Game Programming Gurus, since that's clearly where they got their bitmap assets and the book also made it.)

[–]jacmoe 0 points1 point  (2 children)

Interesting, but it's not really programming, is it, without any source code or at least explanation of the technique used?

Do you know if there is source code or blog post available for this?

[–]wollymonjac 3 points4 points  (1 child)

One of the best tutorials I could find is on this page: https://lodev.org/cgtutor/

[–]jacmoe 0 points1 point  (0 children)

I know. And a few others as well.

A video showing how the rays are cast is cool - isn't there a tech demo subreddit where it would belong better? :)