I’ve made a “ray casting engine” (wolfenstein 3D like) but the walls looks curved. i think it’s because i calculate the ray length using the Pythagorean Theorem, but the square root could be too approximate ? idk. But when i get close to a wall we can see it’s curved, like a wave (see screenshots)wave wall and sometime we can see a wave, but it’s really just a little or like that curved wall
here is the full code
and this shouldn’t be the fisheyes effect, I’ve already fixed it.
i tried to use trigonometric functions to find the ray length (as i have the angle and the start and end point of the ray) but i couldn’t get it to work, sometimes i got the walls always facing me, or extreme wall height. I just want the walls to be strait.
PurpleProg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.