Sign in to follow this  

how to calcualte t.

This topic is 4589 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

a ray intersect a plane how to know if the ray reach the plane? if I know p0 and p1 of ray . get the equation: p0+ td=p1 d is direction ,but is not necessary unit vector p1-p0=td; then how to get t? I know cannot do this: t=(p1-p0)/d I must calculate length of the p1-p0 and d first?

Share this post


Link to post
Share on other sites
Google is your friend.

Quote:

Subject 5.05: How do I find the intersection of a line and a plane?

If the plane is defined as:

a*x + b*y + c*z + d = 0

and the line is defined as:

x = x1 + (x2 - x1)*t = x1 + i*t
y = y1 + (y2 - y1)*t = y1 + j*t
z = z1 + (z2 - z1)*t = z1 + k*t

Then just substitute these into the plane equation. You end up
with:

t = - (a*x1 + b*y1 + c*z1 + d)/(a*i + b*j + c*k)

When the denominator is zero, the line is contained in the plane
if the numerator is also zero (the point at t=0 satisfies the
plane equation), otherwise the line is parallel to the plane.



Share this post


Link to post
Share on other sites

I just need to know if the ray reach the plane.no the intersect point.

simple question :

give p1=p0+td; p1 p0 and t is known, how to get d?

Share this post


Link to post
Share on other sites
Quote:
Original post by derek7

I just need to know if the ray reach the plane.no the intersect point.

simple question :

give p1=p0+td; p1 p0 and t is known, how to get d?


Just rearrange the equation: d = (p1-p0)/t.

Share this post


Link to post
Share on other sites
Quote:
sorry the question is
given p1=p0+td; p1 p0 and d is konwn, how to get t?

must calculate the ||p1-p0|| and ||d|| ?
I think I understand what you're asking. If so, the answer is:

t = dot(p1-p0, d)/dot(d, d)

If p1 is known to be on the ray, then dot(p1-p0, d) = |p1-p0|*|d|. The denominator dot(d, d) is |d|2. Divide through and you get |p1-p0|/|d|. So you are correct that it involves the lengths of those two vectors, but fortunately no square roots are required.

Share this post


Link to post
Share on other sites

This topic is 4589 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this