문제

Given A: a point, B: A point known to exist on a plane P, C: the normal of plane P. Can I determine if A lies on P by the result of a dot product between (A - B) and C being zero? (or within a certain level of precision, I'll probably use 0.0001f)

I might just be missing some obvious mathematical flaw but this seems to be much simpler and faster than transforming the point to a triangle's coordinate space a.la the answer to Check if a point is inside a plane segment

So secondly I guess; if this is a valid check, would it be computationally faster than using matrix transformations if all I want is to see if the point is on the plane? (and not whether it lies within a polygon on said plane, I'll probably keep using matrix transforms for that)

도움이 되었습니까?

해결책

You are correct that B lies on the plane through A and with normal P if and only if dotProduct(A-B,P) = 0.

To estimate speed for this sort of thing, you can pretty much just count the multiplications. This formula just has three multiplications, so its going to be faster than pretty much anything to do with matrices.

다른 팁

The above answers are closer to the proof, but not sufficient. It should be intuitive that using just two vectors is insufficient because for one, point P can be above the plane and a vertical line drawn from it to the plane would still generate a zero dot product with any single vector lying on the plane, just as it would for a point P on the plane. The necessary and sufficient condition is that if two vectors can be found on the plane then the actual plane is represented unambiguously by the cross product of the two vectors i.e. w=uxv. By definition, w is the area vector, which is always perpendicular to the plane.

Then, for the point P in question, constructing a third vector s from either u or v should be tested against w by the dot product, s.t.

w.s=|w||s|cos(90)=0 implies that the point P lies on the plane described by w, which is in turn described by vectors u and v.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top