Given three points non-collinear P
, Q
, R
in 3D, I need a generic method to generate x'
, y'
, z'
unit vectors that behave like origin of local coordinate system.
x'
and y'
vectos should be on the plane that is defined by P
Q
and R
.
The part that I could not figure out was:
After calculating the centroid C
, I can pick x'
as normalize(vec(PQ) + vec(PC))
but could not figure out how to generate y'
and z'
.
The method should be generic. I know this is possible without rotations etc. but how?
I'm going to write a program in Java, so I'd appreciate answers with step-by-step.