For a bit of fun I decided to create a 2.5D raycasting engine, it works well, however when I attempt to remove the fisheye effect with Math.cos in this line of code:
dist * Math.cos(Math.toRadians((angleOfRay * angleBetweenRays) - (fov / 2.0)));
It causes a weird distortion in the height of the walls, it appears to slightly over compensate for the fisheye effect.
The entire class is accessible here: https://www.dropbox.com/s/nuhol52mm95lm7p/Source.txt
Screenshots:
If this error is totally unsolvable from the information provided, would anyone be able to show me any good raycasting tutorials besides this one http://www.permadi.com/tutorial/raycast/ ?