1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| public struct FormatPNTVertexColor
{
public Vector3 Position;
public Vector3 Normal;
public int VertexColor;
public Vector2 UV;
//
public static readonly VertexFormats Format = VertexFormats.Position | VertexFormats.Normal | VertexFormats.Diffuse | VertexFormats.Texture0;
public static readonly VertexElement[] Declarator = new VertexElement[]
{
new VertexElement(0, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 0),
new VertexElement(0, 12, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Normal, 0),
new VertexElement(0, 24, DeclarationType.Color, DeclarationMethod.Default, DeclarationUsage.Color, 0),
new VertexElement(0, 28, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0),
VertexElement.VertexDeclarationEnd
};
//
public FormatPNTVertexColor(Vector3 Position, Vector3 Normal, Vector2 UV, Color VertexColor)
{
this.Position = Position;
this.Normal = Normal;
this.VertexColor = VertexColor.ToArgb();
this.UV = UV;
}
} |