如何使物体旋转度数?统一

问题描述

运行此命令时: Debug.Log(playerCenter.transform.rotation); 它给出的结果具有四个值。这些值中的每一个都在-1和1之间。如何获取以度为单位的x y和z值。

第四个值是什么?

解决方法

您尝试过playerCenter.transform.rotation.eulerAngle吗?或playerCenter.transform.eulerAngle。同样关于第四个值,您是否引用Quaternion的第四个参数?例如Quaternion (float x,float y,float z,float w)

,

尝试使用transform.eulerAngles,transform.rotation返回已标准化的四元数。四元数也返回4个值。 first value you得到的是围绕另一个矢量(其他3个值)的旋转。 As this stackoverflow post perfectly says observation full.mol.code2 Copies pair smiles 1 1 130124051501260617102804 18 Pair1.Acids OC(C1=COC(CCl)=N1)=O 2 1 130124051501260617102804 18 Pair2.Acids (C1=CC=C(CCl)C=C1)=O 3 1 130124051501260617102804 18 Pair3.Acids O=C(O)C1=C(C)OC=C1 4 2 130324051501260817042803 18 Pair1.Acids OC(C1=CSC(CCl)=N1)=O 5 2 130324051501260817042803 18 Pair2.Acids OC(C1=CSC(CCl)=N1)=O 6 2 130324051501260817042803 18 Pair3.Acids OC([C@H](C)Br)=O.[R]