次の方法で共有


CustomVertex.PositionNormalTextured.Nx

Nx フィールド

使用例

  • テクスチャ マップ化オブジェクト用頂点バッファの作成

定義

Visual Basic Public Nx As Single
C# public Single Nx;
Managed C++ public: Single Nx;
JScript public var Nx() : Single

フィールド値

System.Single.

これは読み取り/書き込み可能フィールドである。 

使用例

テクスチャ マップ化オブジェクト用頂点バッファの作成

この例では、テクスチャ マップ化された Microsoft® Direct3D® オブジェクトを表現する、定義済み頂点構造体を作成する方法を示す。

CustomVertex クラスで利用可能な 11 種類の構造体を、さまざまな種類の 3D オブジェクトの頂点バッファ表現に使うことができる。この場合、各頂点について PositionNormalTexturedPositionNormalTextured 構造体は、 (Tu, Tv) テクスチャ座標だけでなく、(Nx, Ny, Nz) 法線ベクトルを格納する。

public void OnCreateVertexBuffer(object sender, EventArgs e)
{
    VertexBuffer vb = (VertexBuffer)sender;
    
    // Create a vertex buffer.
    // Lock the buffer to be able to return filled structures
    CustomVertex.PositionNormalTextured[] verts =
                        (CustomVertex.PositionNormalTextured[])vb.Lock(0,0);
                        
    // Fill the PositionNormalTextured structures with the 
    // 3-D object representation.
    // When finished, unlock the vertex buffer to allow CPU access again.
}

対象

PositionNormalTextured

© 2002 Microsoft Corporation. All rights reserved. Terms of use.