Updated Renderer


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.

Get 3DSage's Raycaster in LOVE2D 11.4 + SOURCE

Leave a comment

Log in with itch.io to leave a comment.