日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Transform.Rotate 旋转

發(fā)布時間:2025/3/20 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Transform.Rotate 旋转 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

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).

應(yīng)用一個歐拉角的旋轉(zhuǎn)角度,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.

如果相對于留空或者設(shè)置為Space.Self?旋轉(zhuǎn)角度被應(yīng)用圍繞變換的自身軸。(當(dāng)在場景視圖選擇物體時,x、y和z軸顯示)如果相對于?Space.World?旋轉(zhuǎn)角度被應(yīng)用圍繞世界的x、y、z軸。

function Update() {// Slowly rotate the object around its X axis at 1 degree/second.//沿著x軸每秒1度慢慢的旋轉(zhuǎn)物體transform.Rotate(Vector3.right * Time.deltaTime);// ... at the same time as spinning relative to the global// Y axis at the same speed.//相對于世界坐標(biāo)沿著y軸每秒1度慢慢的旋轉(zhuǎn)物體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).

應(yīng)用一個旋轉(zhuǎn)角度,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.

如果相對于留空或者設(shè)置為Space.Self?旋轉(zhuǎn)角度被應(yīng)用圍繞變換的自身軸。(當(dāng)在場景視圖選擇物體時,x、y和z軸顯示)如果相對于?Space.World?旋轉(zhuǎn)角度被應(yīng)用圍繞世界的x、y、z軸。

function Update() {// Slowly rotate the object around its X axis at 1 degree/second.//圍繞x軸每秒1度,慢慢的旋轉(zhuǎn)物體transform.Rotate(Time.deltaTime, 0, 0);// ... at the same time as spinning it relative to the global// Y axis at the same speed.//相對于世界坐標(biāo),圍繞y軸每秒1度,慢慢的旋轉(zhuǎn)物體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軸旋轉(zhuǎn)變換。

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.

如果相對于留空或者設(shè)置為Space.Self?旋轉(zhuǎn)角度被應(yīng)用圍繞變換的自身軸。(當(dāng)在場景視圖選擇物體時,x、y和z軸顯示)如果相對于?Space.World?旋轉(zhuǎn)角度被應(yīng)用圍繞世界的x、y、z軸。

function Update() {// Slowly rotate the object around its X axis at 1 degree/second.//圍繞x軸每秒1度,慢慢的旋轉(zhuǎn)物體 transform.Rotate(Vector3.right, Time.deltaTime);// ... at the same time as spinning it relative to the global// Y axis at the same speed.//相對于世界坐標(biāo),圍繞y軸每秒1度,慢慢的旋轉(zhuǎn)物體 transform.Rotate(Vector3.up, Time.deltaTime, Space.World); }

?

轉(zhuǎn)載于:https://www.cnblogs.com/vincentDr/p/3678342.html

總結(jié)

以上是生活随笔為你收集整理的Transform.Rotate 旋转的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。