頂点フォーマットいろいろ
「男は黙ってナマポリゴン」で使用して頂点フォーマット「VertexPositionColor」ですが、他に「VertexPositionColorTexture」「VertexPositionNormalTexture」「VertexPositionTexture」といった形式があります。残り3つに関してはテクスチャーを使用する時に用います。
■VertexPositionColor
VertexPositionColor[] vertices = { new VertexPositionColor( new Vector3( 1.0f, 0.0f, 0.0f ), //position:座標 new Color(255, 255, 50, 100) ), //color:色 : };
■VertexPositionColorTexture
VertexPositionColorTexture[] vertices = { new VertexPositionColorTexture( new Vector3( 1.0f, 0.0f, 0.0f ), //position:座標 new Color(255, 255, 50, 100), //color:色 new Vector2( 1.0f, 0.0f ) ). //textureCoordinate:テクスチャUV値 : };
■VertexPositionNormalTexture
VertexPositionNormalTexture[] vertices = { new VertexPositionNormalTexture( new Vector3( 1.0f, 0.0f, 0.0f ), //position:座標 new Vector3( 1.0f, 0.0f, 0.0f ), //normal:法線 new Vector2( 1.0f, 0.0f ) ). //textureCoordinate:テクスチャUV値 : };
■VertexPositionTexture
VertexPositionTexture[] vertices = { new VertexPositionTexture( new Vector3( 1.0f, 0.0f, 0.0f ), //position:座標 new Vector2( 1.0f, 0.0f ) ). //textureCoordinate:テクスチャUV値 : };