unity3d中的旋转

入门小菜鸟,希望像做笔记记录自己学的东西,也希望能帮助到同样入门的人,更希望大佬们帮忙纠错啦~侵权立删。

目录

一、背景知识

二、unity3d中一些常用的旋转角表示方法及其含义

1、this.transform.rotation(属性变量)

2、this.transform.eulerAngles

3、this.transform.localEulerAngles

4、Quaternion.identity(值类型)

5、Quaternion.eulerAngles


一、背景知识

详见欧拉角,轴角,四元数与旋转矩阵详解_tt丫的博客-CSDN博客


二、unity3d中一些常用的旋转角表示方法及其含义

1、this.transform.rotation(属性变量)

用于存储当前对象在世界空间中的旋转,是四元数(不是度数,是一些sin,cos的组合)。

transform.rotation的旋转角度不固定,声明后可以再赋值。

2、this.transform.eulerAngles

对象相对世界坐标的欧拉角

3、this.transform.localEulerAngles

对象相对于父对象的欧拉角

4、Quaternion.identity(值类型)

无旋转——即等效为Quaternion(0,0,0,0)

注:只读:Quaternion.identity的旋转角度固定,声明后不可再赋值

5、Quaternion.eulerAngles

将欧拉角转化为四元数格式存起来


欢迎大家在评论区批评指正,谢谢~

猜你喜欢

转载自blog.csdn.net/weixin_55073640/article/details/125768476