Log In  

Cart #zubyurwe-0 | 2023-02-03 | Code ▽ | Embed ▽ | No License
6

P#125212 2023-02-03 01:19

This is super cool! I love the way you can change the viewpoint and FOV. You can fix the fisheye by adding a line right before line 118 that says "walldist *= cos(a-p.a). The reason this works is because when a ray hits a wall its diagonal from the player pos which is much further than the actual distance from the player. AKA lines with more angle have too big of a distance, so what we really want is the cos of the angles distance becauee thats the actual distance from the player position, so when you multiply by the cos(angle-change in looking angle) it gives the correct distance. (It might seem like it looks weird at higher FOV now but thats how its supposed to look because you're starting to see behind your own head)

P#140940 2024-01-31 17:55

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 18:07:41 | 0.009s | Q:14