您當前的位置:首頁 > 攝影

如何在Unity中製造陡峭度超過90度的峭壁?

作者:由 喵喵喵 發表于 攝影時間:2015-06-01

如何在Unity中製造陡峭度超過90度的峭壁?lhelpme2015-06-01 23:05:49

陡峭程度超過90度,同一個點就會有多個高度,基於高度圖的 terrian 就會失效,這些可以作為地形裝飾用模型來做。

如何在Unity中製造陡峭度超過90度的峭壁?Ponder2015-06-02 12:27:31

模型 或者使用voxel地形

如何在Unity中製造陡峭度超過90度的峭壁?知乎使用者2015-06-03 22:44:57

自己建模型啊

如何在Unity中製造陡峭度超過90度的峭壁?凱丁2015-06-03 22:56:17

unity自帶terrain是不行的,但是可以自己搞個vertex field terrain,相比較Height map 只存一個高度資料,vector field 存的是個向量,所以能構建超過90度的峭壁

如何在Unity中製造陡峭度超過90度的峭壁?Missmissmi2018-06-08 18:20:45

123456789public class ro : MonoBehaviour{ void Update() { Quaternion target=Quaternion。Euler(0,90,0); transform。rotation=Quaternion。RotateTowards(transform。rotation,target,2。0f); }}將此指令碼掛到Cube上這個會比較費事。下面給你一個思路程式碼。 你自己依據實際情況再修正就行了。過程:1。新建一個C#指令碼 姓名:mouseControl2。複製下述程式碼後儲存, 然後在場景中新建一個物體, 將指令碼拖放在該物體上運轉即可123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051using UnityEngine;using System。Collections; public class mouseControl : MonoBehaviour { float org_y; //float time = 0。0f; bool mousedown = false; bool isrotate = false; // Use this for initialization void Start () { org_y = transform。eulerAngles。y; } // Update is called once per frame void FixedUpdate () { if (Input。GetMouseButton(0)) mousedown = true; if(mousedown) { if (!isrotate) { if ((transform。eulerAngles。y - org_y) < 90) { transform。Rotate(0, Time。deltaTime * 90 * 2, 0, Space。World); } else { isrotate = true; //已被旋轉, 下次點選就回到本來方位。 mousedown = false; //中止 } } else { if(transform。eulerAngles。y <=360 && (transform。eulerAngles。y - org_y) >=0。001) { transform。Rotate(0, -Time。fixedDeltaTime * 90 * 2, 0, Space。World); //回到本來方位 } else { isrotate = false; //旋轉恢復 mousedown = false; //中止 } } } }}

標簽: Transform  90  mousedown  false  org