Let us have a look at the SurfaceMesh class. In essence, it is just a class that contains the vertices and triangles and therefore knows how to render and update itself onto the screens.
Let me start by giving you all the private fields:
object _lockObject = new object(); static Vector3 color = new Vector3(1.0f, 0.0f, 0.0f); Buffer _indexBuffer; int _indexCount; Buffer _modelConstantBuffer; ModelConstantBuffer _modelConstantBufferData; Matrix4x4 _transformMatrix; Buffer _vertexBuffer;
Some of these you have seen before: the indexBuffer, the modelConstantBuffer, the _modelConstantBufferData and the _vertexBuffer are fields that are also used in SpinningCubeRenderer to define the vertices and indices. Since each surface ...