YogevSitton
YogevSitton

Reputation: 10108

Ray casting intersection with infinite plane with normal and offset

I have an Infinite Plane and I know its Normal and Offset. Now, I want to know if a Ray Casting ray is intersecting with this Infinite Plane.

How can I know that?

Upvotes: 2

Views: 1127

Answers (1)

MvG
MvG

Reputation: 60858

Let the ray be described as a+λ∙b, i.e. starting at point a and going in direction b. Let the plane be described as nx=d, i.e. the set of points x which have the same offset d, measured in direction of n.

Now simply plug one into the other:
n∙(a+λ∙b) = d
na+λ∙nb = d
λ∙nb = dna
λ = (dna)/(nb)

If the λ computed in this fashion is positive, then the ray will intersect the plane.

Upvotes: 3

Related Questions