Unity学习 180806 欧拉旋转 eulers

类与方法:

Transform.Rotate(Vector3 eulers,Space relativeTo=Space.self/Space.world)

Vector3 euler--旋转的欧拉角,使用时指明旋转的轴与速度

Space--旋转参考的坐标系,自身或者世界坐标

Example:

Unity学习 180806 欧拉旋转 eulers_第1张图片
Unity Demo of Rotate()

Transform.Rotate(Float xAngle,yAngle,zAngle,Space relativeTo);

Example:

//Rotate the Object around its local x axis at 1 degree per second

transform.Rotate(Time.deltatime,0,0);

//Rotate around the World's Y axis

transform.Rotate(0,Time.deltatime,0,Space.world);

//these two methods are all in the UPDATE() method;

Transform.RotateAround(Vector3 point,Vector3 axis,float angle);

该方法通常将 Vector3 point 指定为一个物体的point,就可以实现类似行星绕日的效果,其中float angle 指定旋转速度。如 20f* Time.deltatime.

你可能感兴趣的:(Unity学习 180806 欧拉旋转 eulers)