- 已知两边求夹角
float angle = Quaternion.LookRotation(vector, Vector3.up).eulerAngles;
- 已知斜边与夹角求临边
vector.x = vector.x * Mathf.Cos(Mathf.Deg2Rad * angle);
- 向量以Y轴为中心旋转angle
Vector3 vector = Quaternion.AngleAxis(angle, Vector3.up) * Vector3.forward;
2023-12-12 13:08:10
float angle = Quaternion.LookRotation(vector, Vector3.up).eulerAngles;
vector.x = vector.x * Mathf.Cos(Mathf.Deg2Rad * angle);
Vector3 vector = Quaternion.AngleAxis(angle, Vector3.up) * Vector3.forward;
下一篇:Python基本图形绘制