Posted May 05, 2023 by SOMEWARE
After poking at the code a bit more and looking at 3DSage's source code a little closer I was able to get rid of the fisheye warping on the floor and ceiling!
I just had to change this:
textureX = playerX + math.cos(rayAngle)*(windowHeight/2)*textureSize/distY
textureY = playerY + math.sin(rayAngle)*(windowHeight/2)*textureSize/distY
into this:
textureX = playerX + math.cos(rayAngle)*(windowHeight/2)*textureSize/distY/math.cos(lineCorrection)
textureY = playerY + math.sin(rayAngle)*(windowHeight/2)*textureSize/distY/math.cos(lineCorrection)
New code has been uploaded in place of the old. Everything else remains the same.