Jump to content
  • Advertisement
Sign in to follow this  
dave

Can anyone help with this?

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!