Hey I'm having a little trouble. I've been working with xna for a while, but I'm completely new to 3D. I'm following the code verbatim from the winformsgraphicsdevice sample on the msdn website. It has a control that draws a primitive triangle to the screen. Simple as that, but I get an exception on this line:
GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 1);
Which says:
"The current vertex declaration does not include all the elements required by the current vertex shader. Normal0 is missing."
I'm assuming it has something to do with my VertexPositionColor
variable, vertices
. That code is here:
vertices = new VertexPositionColor[3];
vertices[0] = new VertexPositionColor(new Vector3(-1, -1, 0), Color.Black);
vertices[1] = new VertexPositionColor(new Vector3( 1, -1, 0), Color.Black);
vertices[2] = new VertexPositionColor(new Vector3(0, 1, 0), Color.Black);