This is a ray cast algorithm that uses ray marching. It repeatedly calculates the distance to the nearest obstacle then takes a step of that length. When the distance to the nearest obstacle is 0 it has hit its target! The code includes signed distance functions for circles, axis-aligned rectangles, and capsules.
-
Notifications
You must be signed in to change notification settings - Fork 0
leifekstromclark/ray-marching-and-signed-distance
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Ray marching algorithm for ray casts. Implemented in Pygame.