Original Post
🔒 Locked
Ray Tracing
Advertisement
A ray is merely a line with a starting point. You can think of it as u + tp, where u is the starting location, and p is a vector describing the direction of the ray. t is a scalar. At t = 0, the function evaluates to u. At t = 1, it''s one step along the path of the line. So, to trace a ray:
For each object in the scene:
if ray does not intersect object, skip to the next object.
If it DOES intersect the object, find the t value.
The object with the lowest POSITIVE t value is the first object hit by the ray.
There you go...
For each object in the scene:
if ray does not intersect object, skip to the next object.
If it DOES intersect the object, find the t value.
The object with the lowest POSITIVE t value is the first object hit by the ray.
There you go...
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement