I've just started making a 'raycast' engine, a pseudo 3D FPS engine similar to Wolfenstein/Doom. I haven't done much reading so my implementation is likely very naive.
My current working prototype has a 'fisheye' distortion [2nd image] which makes sense because the middle of the wall is closer than the far edges, but this is not how Doom looks.
What's the right way to do this? an orthogonal projection seems wrong because you would lose the foreshortening.