Get the latest tech news
Amanatides and Woo's fast voxel traversal
A look at the inner workings of the famous fast voxel traversal algorithm.
The concept of Amanatides and Woo's algorithm is simple: We find at what time along the ray each axis crosses its next cell boundary. To initialize it, we get the offset between the grid pos and the entry point, add only the positive part of our step, and finally divide by the ray direction rd. Adding only the positive part of our step is important because each grid cells origin lies in its top left.
Or read this on Hacker News