オプションの光の照射、テクスチャ マッピングおよび各頂点色を使用して、複数の面、線、または点を描画するオブジェクト
例
| 例: PolygonSet を使用した四面体の描画 | |
![]() | |
{import * from CURL.GRAPHICS.SCENE}
{value
|| The scene that holds the tetrahedron.
let scene:Scene =
{Scene
camera =
{Camera
position = {Distance3d -1in, -1in, .5in},
direction = {Direction3d 1, 1, -.5},
up-vector = {Direction3d 0, 0, 1},
field-of-view = 70degrees,
near-clipping-plane = .1in,
far-clipping-plane = 5in,
projection = Projection.perspective
}
}
|| The vertices of the PolygonSet.
let vertices:{Array-of FloatDistance3d} =
{new {Array-of FloatDistance3d},
{Distance3d -.5in, -.5in, -.5in} asa FloatDistance3d,
{Distance3d .5in, -.5in, -.5in} asa FloatDistance3d,
{Distance3d 0in, .5in, -.5in} asa FloatDistance3d,
{Distance3d 0in, 0in, .5in} asa FloatDistance3d,
{Distance3d -.5in, -.5in, -.5in} asa FloatDistance3d,
{Distance3d .5in, -.5in, -.5in} asa FloatDistance3d
}
|| The colors of the vertices of the PolygonSet.
let colors:{Array-of Pixel} =
{new {Array-of Pixel},
{{Palette.get-red}.to-Pixel},
{{Palette.get-green}.to-Pixel},
{{Palette.get-blue}.to-Pixel},
{{Palette.get-yellow}.to-Pixel},
{{Palette.get-red}.to-Pixel},
{{Palette.get-green}.to-Pixel}
}
|| Create the PolygonSet and add it to the scene.
let polygonset:PolygonSet =
{PolygonSet
vertices = vertices,
colors = colors,
primitive-type = PrimitiveType.triangle-strip,
{on event:PointerPressSceneEvent at p:PolygonSet do
{p.rotate {Direction3d 0, 0, 1}, 10deg}
}
}
{scene.add-object polygonset}
|| SceneGraphic displays the scene on the page.
{SceneGraphic
width = 5in,
height = 5in,
background = {FillPattern.get-black},
scene
}
}
|
| 新規の PolygonSet を作成します。 |
| PolygonSet の頂点色。 |
| PolygonSet の拡散色。 |
| PolygonSet の面。これらは頂点配列のインデックスになります。これが null の場合は、 |
| PolygonSet の色またはテクスチャ。 |
| PolygonSet の線の幅。 |
| PolygonSet のノーマル。 |
| PolygonSet の点のサイズ。 |
| PolygonSet の |
| PolygonSet のシェード モデル。 |
| PolygonSet のテクスチャ座標。 |
| PolygonSet の頂点。 |
| SceneObject の軸平行である 3 次元のローカル境界。SceneObject のサブクラスにこのメソッドをオーバーライドする必要があります。 |
新規の PolygonSet を作成します。
PolygonSet の頂点色。
PolygonSet の面。これらは頂点配列のインデックスになります。これが null の場合は、
PolygonSet の色またはテクスチャ。
PolygonSet の線の幅。
PolygonSet のノーマル。
PolygonSet の点のサイズ。
PolygonSet の
PolygonSet のシェード モデル。
PolygonSet のテクスチャ座標。
PolygonSet の頂点。
SceneObject の軸平行である 3 次元のローカル境界。SceneObject のサブクラスにこのメソッドをオーバーライドする必要があります。
戻り値
オーバーライド
注意事項