Constructing the face model
Now we will extend the previous example to support rendering the face mesh onto the color image. The face mesh itself may not be useful for your own applications, but it is in fact composited by a few parameterized points, that is, animation units (AU) and shape units (SU). The face tracking results can also be represented in terms of the weights of six AUs and 11 SUs, which will be explained in the forthcoming Understanding the code section.
Drawing the parametric face model
Now we are going to draw a 3D mesh of the face we have detected, which is formed by a list of vertices and normals, as well as the triangle indices. The Microsoft Kinect SDK already provides SDKs to obtain this data and this example will only draw them on the screen with OpenGL commands.
Common mesh data contains two parts: the vertices on the mesh, and the triangles composing the whole mesh, each of which includes three vertices. We define two variables at first to store the vertex data and...