# Can anyone help with this?

This topic is 4972 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I need to code a ray-triangle intersection algorythm so i am first testing for intersection with a plane. I am looking at this . I can't for the life of me figure out where 't' comes into it about 6 lines down. There is also no explanation of what the expressions mean, so can anyone shed any light on this? ace

##### Share on other sites
The math is clear and understandable (although a little bit ugly because it's HTML). The t is the parameter of a parametric vector representation of a ray (assuming t>0).

Any linear algebra book should cover the notations. Also, any introductory physics book is going to define everything you see there in the first chapter. I won't go into the detail of explaining all of them myself (since you didn't mention which you didn't understand and there are a lot).

##### Share on other sites
Here it is cleaned up:

Quote:
 A ray is defined by: R0 = [X0, Y0, Z0] Rd = [Xd, Yd, Zd]so R(t) = R0 + t * Rd , t > 0

R0 is the endpoint of the ray, Rd is the direction of the ray. R(t) is a point on the ray.

This is called the parametric form. In the parametric form, an additional variable (the parameter) is introduced (t in this case) and the other variables become dependent on the parameter. The purpose is to simplify the equation by having a single independent variable. Here are examples of the explicit, implicit, and parametric forms for a 2D line:

explicit: y = mx + b
implicit: m = (y - y0)/(x - x0)
parametric: y = y0 + myt, x = x0 + mxt
parametric (using vectors): L = L0 + Mt

The parametric forms can be used to avoid problems with the explicit or implicit forms. For example, the explicit and implicit forms above can't represent the line x = C, and the implicit form also fails whenever x == x0. The parametric form does not have these problems.

##### Share on other sites
John pretty much covered it.

This form is similar to the equation of a line in 3-space, except if you restrict the parameter t to being >= 0, you allow the locus (path) of the line to only travel in one direction from the position vector RO, creating a ray rather than a line. Remember that there is no non-parametric equation of a line in 3-space.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 9
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
634136
• Total Posts
3015756
×