Question by
Ambrose998800 · May 10, 2016 at 11:01 AM ·
vector3plane
Unity simple algebra fail?
Math says, if you align a plane made by two vectors coplanar to another plane made by two vectors, their normals must be parallel too.
Why does that not work in Unity?
Debug.DrawRay(OrientationPoint.transform.position, OrientationPoint.transform.forward, Color.blue);
Debug.DrawRay(OrientationPoint.transform.position, -OrientationPoint.transform.right, Color.red);
Debug.DrawRay(Hand.transform.position, Hand.transform.up, Color.green);
Debug.DrawRay(Hand.transform.position, Hand.transform.right, Color.red);
Hand.transform.up = OrientationPoint.transform.forward;
Hand.transform.right = -OrientationPoint.transform.right;
So, vector_red_1 is parallel to vector_red_2 -> correct!
Vector_green is not parallel to vector_blue -> incorrect!

How can I make the palm shows towards the sky?
(Note: if I have a normal vector to the palm and align it to a vector towards the sky it doesn't work either)
unitymathfail.jpg
(177.3 kB)
Comment
Best Answer
Answer by YoungDeveloper · May 10, 2016 at 11:53 AM
transform.up is local up and not world space vector. Use Vector3.up if you want always up - world space. By image i understand that hand transform is simply rotated, thats why it produces what it produces.
Got it! The relative vector hint did it! Thanks a lot!
Your answer