function Rotate (eulerAngles : Vector3, relativeTo : Space = Space.Self) : void

Description描述

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);
}

转载于:https://www.cnblogs.com/vincentDr/p/3678342.html

Transform.Rotate 旋转相关推荐

  1. css3 animation动画360旋转。旋转效果用transform:rotate过渡。

    旋转:  <div class="lds-hourglass"></div> .lds-hourglass {display:inline-block;po ...

  2. 巧用左手判断CSS中transform:rotate旋转方向

    在制作网页的过程中,我们会经常让元素进行旋转,来形成一定的立体感,或是配合关键帧(@keyframe)做成动画特效,使得页面更加美观. 在css3中我们可以借助transform:rotate();来 ...

  3. web基础·transform:rotate()搭配perspective实现3D旋转

    perspective:透视:像素(单位)   3d变换需要透视,透视要加在观察元素的父盒子上 [透视的值越小会越明显] rotate():旋转:rotateX().rotateY().rotateZ ...

  4. css3transform rotate,css3 transform:rotate旋转问题

    圆环里面的黑色箭头,默认rotate(0deg),橙色的是rotate(72deg),依次增加72deg.到了红色是rotate(288deg).transform动画,从黑橙黄蓝红顺时针旋转.红的到 ...

  5. CSS3图片旋转功能transform:rotate以及Canvas旋转示例

    <!DOCTYPE html> <html> <head><title>CSS3旋转图片</title><style>.demo ...

  6. 放大 旋转 css3,CSS3详解:transform 的旋转、旋转放大、放大、移动

    CSS3 transform是什么? transform的含义是:改变,使-变形:转换 CSS3 transform都有哪些常用属性? transform的属性包括:rotate() / skew() ...

  7. css对称旋转,CSS3 transform平面旋转

    CSS3 transform平面旋转 1.translate(x,y) 设置盒子位移 2.scale(x,y) 设置盒子缩放 3.rotate(deg) 设置盒子旋转 4.skew(x-angle,y ...

  8. css3 transform rotate-2D旋转

    2019独角兽企业重金招聘Python工程师标准>>> /*div 旋转同时放大*/ .box { width:100px; height:100px; background:#F9 ...

  9. CSS3 skew倾斜、rotate旋转动画

    css3出现之前,我们实现一个对象的一组连续动画需要通过JavaScript或Jquery编写,脚本代码较为复杂: 若需要实现倾斜.旋转之类的动画难度将更高(我还没试过用JavaScript或Jque ...

最新文章

  1. Xamarin Essentials教程语音播报TextToSpeech
  2. golang 获取struct类型_聊聊golang的类型断言
  3. 2022-02-25
  4. VTK修炼之道74:交互部件_Widget的创建
  5. 阿里MySQL读写一致_阿里面试题:如何保证缓存与数据库的双写一致性?
  6. (JAVA)复制文件test.txt,并且排序。文件重新命名为test1.txt
  7. python中的urlencode和urldecode
  8. 小蛮机器人如何联网_机器人视界|数字化时代 机器人成为新晋“代言人”
  9. python中导入模块的方式_在python中导入模块中的对象有哪几种方式
  10. py文件编译成pyc文件
  11. 软件测试 查看网页打开时间,网页响应时间101(一)
  12. 手机版支付宝转账截图生成器Q574651623
  13. 操作系统中的基础抽象
  14. c语言ip判断程序,IP判断 (C语言代码)
  15. 变限积分求导公式总结_变限积分求导的口诀记忆法及应用
  16. java与es8实战之四:SpringBoot应用中操作es8(无安全检查)
  17. 你会用“お”和“ご”吗?
  18. BaseDao.java
  19. 关于手工制作PCB印刷电路板的镜像操作详解【干货】
  20. 穷查理宝典--人类误判心理学思维导图

热门文章

  1. 给这台华为S5700交换机配一下链路聚合
  2. OAM v1alpha2 新版:平衡标准与可扩展性
  3. Postman批量跑接口
  4. 价格的格式化 php,价格格式化问题。
  5. linux 内核参数 rss,Linux控制内存的内核参数
  6. 小程序mysql+php测试,分享微信小程序的一些常见辅助测试功能:chance
  7. python加载包出错_python导入Pmw包运行提示一下错误
  8. python requests_小白学 Python 爬虫(18):Requests 进阶操作
  9. python文字识别算法_Python图像处理之图片文字识别(OCR)
  10. 数字图像处理经典论文汇总