
- BabylonJS 教程
- BabylonJS - 首頁
- BabylonJS - 簡介
- BabylonJS - 環境搭建
- BabylonJS - 概述
- BabylonJS - 基本元素
- BabylonJS - 材質
- BabylonJS - 動畫
- BabylonJS - 相機
- BabylonJS - 光照
- BabylonJS - 引數化形狀
- BabylonJS - 網格
- 向量位置和旋轉
- BabylonJS - 貼花
- BabylonJS - Curve3
- BabylonJS - 動態紋理
- BabylonJS - 視差貼圖
- BabylonJS - 鏡頭光暈
- BabylonJS - 建立螢幕截圖
- BabylonJS - 反射探針
- 標準渲染管線
- BabylonJS - ShaderMaterial
- BabylonJS - 骨骼和骨架
- BabylonJS - 物理引擎
- BabylonJS - 播放聲音和音樂
- BabylonJS 有用資源
- BabylonJS - 快速指南
- BabylonJS - 有用資源
- BabylonJS - 討論
BabylonJS - 圓錐
這是 MeshBuilder 中使用的形狀之一。
語法
以下是建立圓錐的語法:
var cone = BABYLON.MeshBuilder.CreateCylinder("cone", {height,diameterTop: 0, diameterBottom, diameter, tessellation: 4, subdivisions, faceColors, faceUV, arc, updatable}, scene);
CreateCylinder 用於建立圓柱體和圓錐體,並由 diameterTop 屬性控制。如果設定為 0,則為圓錐;如果大於 0,則為圓柱體。
引數
考慮以下建立圓錐的引數:
高度 (Height) - 給圓柱體的高度。
頂部直徑 (DiameterTop) - 給頂部蓋的直徑。如果為 0,則為圓錐。它將覆蓋 diameter 屬性。
底部直徑 (DiameterBottom) - 底部的直徑。必須大於 0。它將覆蓋 diameter 屬性。
直徑 (Diameter) - 頂部和底部的直徑。
細分 (Tessellation) - 徑向邊的數量。
細分數 (Subdivisions) - 環的數量。
面顏色 (FaceColors) - 3 個 Color4 的陣列,0:底部蓋,1:圓柱體管,2:頂部蓋
面 UV (FaceUV) - 3 個 Vector4 的陣列,0:底部蓋,1:圓柱體管,2:頂部蓋
弧度 (Arc) - 0 和 1 之間的周長比例
可更新 (Updatable) - 預設情況下,此值設定為 false。如果需要在變形過程中更新,可以將其設定為 true。
babylonjs_mesh.htm
廣告