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
廣告