2
votes

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
t is for time. If direction is a unit vector then t is distance, but more generally it is the amount of direction travelled along the ray.jozxyqk

2 Answers

2
votes

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.

1
votes

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.