Transform.Rotate旋转-创新互联

function Rotate (eulerAngles : Vector3, relativeTo : Space = Space.Self) : voidTransform.Rotate
旋转

Description描述

创新互联建站主营古城网站建设的网络公司,主营网站建设方案,成都App定制开发,古城h5重庆小程序开发公司搭建,古城网站营销推广欢迎古城等地区企业咨询

Applies a rotation of eulerAngles.z degrees around the z axis, eulerAngles.x degrees around the x axis, and eulerAngles.y degrees around the y axis (in that order).

应用一个欧拉角的旋转角度,eulerAngles.z度围绕z轴,eulerAngles.x度围绕x轴,eulerAngles.y度围绕y轴(这样的顺序)。

If relativeTo is left out or set to Space.Self the rotation is applied around the transform's local axes. (The x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is Space.World the rotation is applied around the world x, y, z axes.

如果相对于留空或者设置为Space.Self 旋转角度被应用围绕变换的自身轴。(当在场景视图选择物体时,x、y和z轴显示)如果相对于 Space.World 旋转角度被应用围绕世界的x、y、z轴。

function Update() {
// Slowly rotate the object around its X axis at 1 degree/second.  //沿着x轴每秒1度慢慢的旋转物体    transform.Rotate(Vector3.right * Time.deltaTime);

// ... at the same time as spinning relative to the global  // Y axis at the same speed.  //相对于世界坐标沿着y轴每秒1度慢慢的旋转物体    transform.Rotate(Vector3.up * Time.deltaTime, Space.World);
}

• function Rotate (xAngle : float, yAngle : float, zAngle : float, relativeTo : Space = Space.Self) : void

Description描述

Applies a rotation of zAngle degrees around the z axis, xAngle degrees around the x axis, and yAngle degrees around the y axis (in that order).

应用一个旋转角度,zAngle度围绕z轴,xAngle度围绕x轴,yAngle度围绕y轴(这样的顺序)。

If relativeTo is left out or sot to Space.Self the rotation is applied around the transform's local axes. (The x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is Space.World the rotation is applied around the world x, y, z axes.

如果相对于留空或者设置为Space.Self 旋转角度被应用围绕变换的自身轴。(当在场景视图选择物体时,x、y和z轴显示)如果相对于 Space.World 旋转角度被应用围绕世界的x、y、z轴。

function Update() {
// Slowly rotate the object around its X axis at 1 degree/second.  //围绕x轴每秒1度,慢慢的旋转物体    transform.Rotate(Time.deltaTime, 0, 0);

// ... at the same time as spinning it relative to the global  // Y axis at the same speed.  //相对于世界坐标,围绕y轴每秒1度,慢慢的旋转物体    transform.Rotate(0, Time.deltaTime, 0, Space.World);
}

• function Rotate (axis : Vector3, angle : float, relativeTo : Space = Space.Self) : void

Description描述

Rotates the transform around axis by angle degrees.

按照angle度围绕axis轴旋转变换。

If relativeTo is left out or set to Space.Self the axis parameter is relative to the transform's local axes. (The x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is Space.World the axis parameter is relative to the world x, y, z axes.

如果相对于留空或者设置为Space.Self 旋转角度被应用围绕变换的自身轴。(当在场景视图选择物体时,x、y和z轴显示)如果相对于 Space.World 旋转角度被应用围绕世界的x、y、z轴。

function Update() {
// Slowly rotate the object around its X axis at 1 degree/second.  //围绕x轴每秒1度,慢慢的旋转物体    transform.Rotate(Vector3.right, Time.deltaTime);

// ... at the same time as spinning it relative to the global  // Y axis at the same speed.  //相对于世界坐标,围绕y轴每秒1度,慢慢的旋转物体    transform.Rotate(Vector3.up, Time.deltaTime, Space.World);
}

本文标题:Transform.Rotate旋转-创新互联
URL分享:http://csruizhi.cn/article/phdis.html

其他资讯

Copyright © 2007-2024 成都优众联杰科技有限公司 All Rights Reserved 蜀ICP备2024116266号
友情链接: 达州网站设计 成都企业网站制作 网站建设 成都响应式网站建设 上市集团网站建设 成都网站建设 成都营销网站制作 成都网站建设 高端网站建设 高端网站设计推广 成都网站建设 专业网站设计 高端网站设计 成都网站建设公司 网站建设开发 重庆网站设计 宜宾网站设计 重庆网站建设 网站制作公司 重庆网站制作 成都网站建设 营销型网站建设