How to calculate direction vector(v) with up to three points on a plane

63 Views Asked by At

3 points on a plane acquired empirically:

Point $P: (65.143, 407.19, 1.000)$
Point $Q: (624.608, 359.191,1.000)$
Point $R: (69.766, 82.885, 1.000)$

In the following equation that solves for an intersect point between a ray(line) and a plane, how do I calculate $\vec v$, the direction vector, from the three planar points from above?

$$t = \frac{-(n\cdot p + d)}{v\cdot n}$$

Vector/Line the above equation uses:

$$p = po + t\vec v$$

Vector plane equation used above: $$\vec n \cdot \vec p + d = 0$$ $$\vec n \cdot (\vec po + t\vec v)+ d = 0$$ $$(\vec po\cdot \vec n)+(t\vec v\cdot\vec n)= -d $$ $$ t\vec v \cdot \vec n=-(\vec po \cdot \vec n +d)$$

$$t = \frac{=-(\vec po \cdot \vec n +d)}{\vec n\cdot v}$$

Solving for t denominator:

float denom = n.dot(v);
v(l,m,n) = ?