Be interested to see how to define 3 dimensional shapes, start with a simple cube and build from that small program you did to explain the spinning triangle... while i'm here
can you explain this part please...
Code:
//Vertices of our primitive
vertices = new VertexPositionColor[3];
//Top left vertex
vertices[0].Position = new Vector3(-1, 1, 0);
//Top right vertex
vertices[1].Position = new Vector3(0, 2, 1);
//Bottom left vertex
vertices[2].Position = new Vector3(1, -1, 0);
//Setup the colors of each vertex
vertices[0].Color = Color.Red;
vertices[1].Color = Color.Blue;
vertices[2].Color = Color.Green;
//Index of each corner
indices = new int[] { 0, 1, 2 };
//Position of our primitive
position = Vector3.Zero;
If i'm getting this right (probably not but anyway...),
The 3D world is the matrix,
Vector3 is that particular triangle,
And thats defined here...
Code:
//Top left vertex
vertices[0].Position = new Vector3([COLOR=red]-1, 1, 0[/COLOR]);
//Top right vertex
vertices[1].Position = new Vector3([COLOR=red]0, 2, 1[/COLOR]);
//Bottom left vertex
vertices[2].Position = new Vector3([COLOR=red]1, -1, 0[/COLOR]);
The RED are x,y,z in 3D space??? (or am i way off) and what are they relative to?
And
Code:
//Index of each corner
indices = new int[] { 0, 1, 2 };
What roll does this line play in it?
The way i think it works is,
You have a primative (Your shape/object),
Which is made up of
vertices,
Each vertice has a Vector3(-1, 1, 0) type definition ???, which are called indices???
Like... A Primative made up of vertices (Refrenced by Vector3?) and the indices are what make your shape?
Anyway... now i have a headache thinking about this
i'll leave it in your hands
.