O'Reilly logo

Microsoft HoloLens Developer’s Guide by Dennis Vroegop

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The SurfaceMesh class

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required