Log In  

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

ok here's this. i want the edges to be clearer cos right now the view is fisheye. and idk how i should add clarity to the walls to distinguish them from walls behind them. thanks!

arrow keys to move, c to switch to overhead view

P#125258 2023-02-03 21:51 ( Edited 2023-02-03 22:03)



Your raycaster has ... rounded edges to the walls. I'm not sure if that's a bug or a feature. :)

Is there a way to have the walls not bend ?

P#125273 2023-02-04 03:35

@dw817 idk. the rounded edges are what i want to fix. i'm thinking it has something to do with the way each ray calculates distance.

P#125283 2023-02-04 05:54

Pico-8 comes with a demo Raycaster written by @zep himself, @Ummmm_ok.

Cart #yiwuhedito-0 | 2023-02-04 | Code ▽ | Embed ▽ | No License

It might be worth investigating - seeing how he is getting sharp-angled walls and edges.

P#125284 2023-02-04 06:05 ( Edited 2023-02-04 06:05)

The fish-eye is caused because you're using the actual distance (ray length) from the camera to the wall to calculate the height of the wall. What you actually want is the perpenicular distance.

This might help: https://permadi.com/tutorial/raycast/rayc8.html

P#125297 2023-02-04 09:40

thanks @dw817 and @jasondelaat ! the article really helped and it's looking much better now :)

P#125340 2023-02-05 03:41

[Please log in to post a comment]