Unity - 向量旋转

 rotVec3 = angleQuat * oriVec3

//将原始向量 绕Y轴 旋转90度

Vector3 originalVector = new Vector3(1, 0, 0); // 原始向量

Quaternion rotation = Quaternion.Euler(0, 90, 0); // 绕y轴旋转90度的Quaternion对象

Vector3 rotatedVector = rotation * originalVector; // 旋转后的向量

猜你喜欢

转载自blog.csdn.net/smile_otl/article/details/134246857