Microsoft DirectX 8.0 (Visual Basic)

線リスト

線リストとは、個々の直線の線分のリストである。線リストは、3D シーンでみぞれや大雨を表現するときなどに便利である。アプリケーションでは、頂点の配列に値を設定することで線リストを作成する。線リストの頂点の数は、2 以上の偶数でなければならない。

次の図は、レンダリングされる線リストを示している。

線リストにはマテリアルとテクスチャを適用できる。マテリアルまたはテクスチャの色は、描画された線に沿ってのみ表示され、線と線の間には表示されない。

次のコードは、線リストに対して頂点を作成する方法を示している。

Private Type CUSTOMVERTEX
    x As Single
    y As Single
    z As Single
End Type

Dim Vertices(5) As CUSTOMVERTEX
With Vertices(0): .x = -5.0: .y = -5.0: .z = 0.0: End With
With Vertices(1): .x =  0.0: .y =  5.0: .z = 0.0: End With
With Vertices(2): .x =  5.0: .y = -5.0: .z = 0.0: End With
With Vertices(3): .x = 10.0: .y =  5.0: .z = 0.0: End With
With Vertices(4): .x = 15.0: .y = -5.0: .z = 0.0: End With
With Vertices(5): .x = 20.0: .y =  5.0: .z = 0.0: End With