July 2017
Beginner to intermediate
390 pages
10h 53m
English
In our CreateDeviceDependentResourcesAsync() initialization method, we add the call to the following to methods:
BuildVertexBuffer(); BuildIndexBuffer();
The first one will define our coordinates for each vertex, and the second method will tell the system in which order these vertices are to be used to draw the triangles. I have chosen to make the object a bit more interesting by making it a diamond shape. Try to see if you can see the shape without running it, by looking at the numbers.
The implementation is as follows:
private void BuildVertexBuffer() { VertexPositionColor[] cubeVertices = { new VertexPositionColor(new Vector3(0.0f, 0.0f, 0.0f), new Vector3(1.0f, 1.0f, 1.0f)), new VertexPositionColor(new Vector3(0.0f, ...Read now
Unlock full access