I have a triangle in 3D space defined by its 3 vertices, p0, p1, and p2.
I wish to calculate a plane in this 3D space which lies along both p0 and p1 and faces a third point, p2.
This plane is to be defined by a position and normalised direction/
In addition to lying along p0 and p1, and facing p2, the plane should also be perpendicular to the plane created by p0, p1, and p2
I’ve struggled with this for quite a while and any help anyone can offer is greatly appreciated.
Your question is ill-posed. For any plane that lies on p0 and p1 there will be some point on that plane that “faces” point p2. So all that’s left to compute is some plane along p0 and p1.
EDIT: see comments
here is an example of my comment explanation
octave:14> p0
p0 =
0 0 0
octave:15> p1
p1 =
0 0 5
octave:16> p2
p2 =
5 0 0
octave:17> cross(p1-p0, cross(p1-p0,p2-p0))
ans =
-125 0 0
You’ll notice that the sign is wrong, play with the order of parameters in the cross product to get it facing the right way. Also don’t forget to normalize…but it wont affect the direction. Also check to make sure the norm after each cross product isn’t near 0, otherwise there is no unique answer.. (triangle forms a line)