[Unity知识点整理]关于旋转
来源:互联网 发布:绑架恐怖分子家属 知乎 编辑:程序博客网 时间:2024/05/17 09:05
一、Transform.Rotate :
1.void Rotate(Vector3 eulerAngles, Space relativeTo = Space.Self);
示例:
transform.Rotate(Vector3.right * Time.deltaTime); 绕自身X轴旋转
transform.Rotate(Vector3.up * Time.deltaTime, Space.World); 绕世界Y轴旋转
2.void Rotate(float xAngle, float yAngle, float zAngle, Space relativeTo = Space.Self);
示例:
transform.Rotate(Time.deltaTime, 0, 0);绕自身X轴旋转
transform.Rotate(0, Time.deltaTime, 0, Space.World); 绕世界Y轴旋转
3.void Rotate(Vector3 axis, float angle, Space relativeTo = Space.Self);按照angle度围绕axis轴旋转变换。
示例:
transform.Rotate(Vector3.right, Time.deltaTime);绕自身X轴旋转
transform.Rotate(Vector3.up, Time.deltaTime, Space.World);绕世界Y轴旋转
二、Transform.RotateAround 围绕旋转
void RotateAround(Vector3 point, Vector3 axis, float angle); 围绕世界坐标的point点的axis旋转该变换angle度。
示例:
transform.RotateAround(Vector3.zero, Vector3.up, Time.deltaTime);
三、
Transform.rotation 旋转角度
Quaternion rotation;变换的旋转,在世界坐标空间储存为四元数。
Quaternion.Euler 欧拉
public static Quaternion Euler(float x, float y, float z);
Quaternion rotation = Quaternion.Euler(new Vector3(0, 30, 0));
- [Unity知识点整理]关于旋转
- Unity知识点整理
- 关于Volley知识点整理
- 关于 android基础知识点整理
- 关于springmvc的知识点整理
- 关于mybatis的知识点整理
- Unity面试题整理(4)--Socket知识点扫盲
- [Unity]旋转
- 关于知识点整理的一点想法
- 整理关于JVM方面的知识点
- 整理关于JVM方面的知识点
- 关于正则表达式的知识点整理
- 【Unity优化】关于优化方面的整理
- Unity知识点
- Unity 知识点
- Unity-关于Rigidbody如何使用代码冻结位置和旋转
- 关于Unity的旋转,陀螺仪相关的一些记录
- unity中关于物体的旋转和朝向控制
- 使用powerdesigner连接MySQL并设置逆向工程图文教程
- 树的重心及其一些性质。poj3107 && poj 1655
- spring mvc demo
- spring boot 中配置文件的读取和多环境配置
- 事件冒泡和事件捕获
- [Unity知识点整理]关于旋转
- 1134: 生日日数
- 电商项目总结
- LIST 和SET hashmap hashtable
- 单链表的小应用
- 【蓝桥杯近三年真题库】
- string7
- javascript:;与javascript:void(0)
- mysql学习笔记