Share your repls and programming experiences

← Back to all posts
Raycasting Engine
byonano (1)

It has taken me a month to understand and 3d line equations and how to calculate the distance to a point from a 3d line. (I'm a highschool student) So there is a bug where if a point returns true at a certain phi/theta angle, it will also be true at that angle's opposite. Ex: if a point is returning true at a 90 degrees phi angle, it will also return true at 270 degrees. I'll try my best to fix this but I'm still struggling to understand how this is happening with my equations. Although I think it has to do with me calculating a, b, and c wrong. Also, if you run it with fovPHI and fovTHETA at 360, you will see the issue that I described above better.

Anyways, WASD to move. Click on the window for it to have your controls. Lowering the res will help it run faster. There is a green point that is further away, see if you can get to it.

Commentshotnewtop
HappyFakeboulde (213)

syntax error line 80
(you didn't properly close the parentheses on line 79

byonano (1)

@HappyFakeboulde Thanks! I was experimenting with it while you were viewing the project.