Rotate Vector3
Hi guys !
I need your help for this math problem :
I have this 2 black vector (construct by 3 Vector3, p1, p2 and p3), and I need to find the p4 Vector3.
I have do this :
float angle = Vector3.Angle(p3 - p2, p2 - p1);
p4 = p1 + (p1 - p2); //blue vector
p4 = Quaternion.AngleAxis(angle, Vector3.forward) * p4;
But not work. What's wrong ?
Thanks in advance :).
dessin-sans-titre-2.jpg
(15.6 kB)
Comment
I think I have do some correction, but I'm not sure. Actually my code are :
float angle = Vector3.Angle(p2 - p3, p2 - p1); //for get the good angle
angle -= 180.0f; //for get the angle between the blue and the red vector
p4 = p1 + (p1 - p2);
p4 = Quaternion.AngleAxis(angle, Vector3.up) * p4; //change forward to up (because I work on x and z value)
Anyway, is not the complete solution, or it's totally wrong ...
Your answer
Follow this Question
Related Questions
Applying direction into transform position 0 Answers
Can someone explain the math behind finding the velocity relative to where I'm looking? 2 Answers
Predicting the hit point on X axis, based on vector direction 1 Answer
Find a point in space using Vector3 angles and Raycast 1 Answer
Dot product not working when Enemy change its direction 0 Answers