What is the term 't' in Ray definition? Ray Tracing

480 views Asked by At

If the definition of a Ray is given by Ray = origin + t(direction) then what is the term t suppose to represent? Can't find any tutorials that describe this clearly. Stab at the dark I think it's probably distance but as I understand, if this was to be used in ray tracing does this mean t is effectively the distance between the origin of the ray and the plane that I'm checking whether it intersects with?

2

There are 2 answers

0
Nik Ved On

Assuming that direction is normalized then yes, t means distance from the origin. In the definition t might be anything but greater than 0 (otherwise it is a line). So, if you have an intersection, then there exists t' s.t. a point p = origin + t' * direction belongs to your plane.

2
jon hanson On

That equation is the parametric equation for a straight line. I.e. a line can be described by a point that lies on the line and a vector that points in the same direction as the line.

Conceptually speaking, by plugging into the equation every possible value for t parameter from -oo to +oo you get a set of points which comprises the line in its entirety. Given such a description of a line, you can specify any point on the line with a single value of t - the value that, when plugged into the equation, gives you that point.

The parameter itself is meaningless. In the context of a ray-tracing it could be interpreted as time, however unless your renderer is actually attempting to model the propagation of light over time, this is not a useful distinction.