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 Answers
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.
t
is for time. Ifdirection
is a unit vector thent
is distance, but more generally it is the amount ofdirection
travelled along the ray. – jozxyqk