Ray casting

From DmWiki

Ray casting is an old algorithm in computer graphics that delivers a solution to the following questions : "Are two points in space mutually visible ?" and "What is the closest object to a given point ?"

The aproach to the algorithm is rather simple and builds the basis for various rendering techniques, like ray tracing.

- Create a ray starting at one point and pointing towards the other.
- Intersect the ray with every obejct in the scene.
- If an intersection with an object occurs, that is closer than the distance between the
the two points, the points can not see each other.

Or formulated to fit the second question :

- Create a ray starting at a point P, pointing into a desired direction.
- Intersect ray with each object.
- Save closest intersection and return.

Once an algorithm invented for visiblity determination ray casting has been one one of the most successful algorithms in computer graphics. Today ray casting is the basic building block for many modern rendering algorithms, like ray tracing or photon mapping. It's true success started when Monte Carlo integration became a wide spread tool in rendering, because now tracing rays through a scene became a tool for evaluating integrals (namly one integral, known as the rendering equation).

Since then, it's been widely used in the early "3D" (also called 2.5D or pseudo-3D) game engines, the most popular of which was the Wolfenstein3D engine.

TODO: add a graphical explanation


DevMaster navigation