Better Raycaster Engine - Raycaster Engine V.6

I need help, I kinda got rid of the fisheye effect, but it only works when my character is looking in a 0 degree direction, as soon as i look at a different angle it does something fishy (no puns intended)
Screenshot 2023-03-08 10.43.27
without the fisheye
Screenshot 2023-03-08 10.43.13
when I look away
Screenshot 2023-03-08 10.43.47
any ideas?

1 Like

If the fish eye effect is removed at only one angle, that means your not rotating the camera direction and just only changing the ray cast direction. Meaning you are only looking at a fixed direction for the correct distance while the ray casts are getting the distorted distance data. (This means the camera and ray casts need to be rotated together)

trigonometry - Raycasting "fisheye effect" question - Game Development Stack Exchange

image

4 Likes