none
FaceTracking and Direct3D RRS feed

  • Question

  • I  would like to redraw the simple face mesh in the face tracking visualization using D3D. What coordinate system are the results of the face tracking sdk? I know the 2D points are in the image plane, but what coordinate system are the 3D points?
    Saturday, March 16, 2013 8:11 AM

All replies

  • Have a look at the FaceTrackingVisualization sample. The values for the Model would be a local coordinate system(model space). The way it is generated should not matter since you will have to generate your own translation matrix to move this into a different coordinate space.
    Monday, March 18, 2013 7:37 PM
  • Thanks for the reply Carmine Si. It is very helpful.

    I have two questions though: In the face tracking visualization, he uses the debug methods Drawline when drawing the 3D model (hence a 2D draw method). I would instead like to use the 3D points directly. Thus, as we are given the 3D points, how do we draw them in D3D, i.e. how do we specify the view and projection matrices to take the 3D triangles  (from Get3DModel, and GetTriangles), to image space?

    Second, what is the difference between GetProjectedShape (from iftmodel), and Get2Dshapepoints(from iftresult)? Don't they have the same result?

    Wednesday, March 20, 2013 4:38 PM
  • For D3D, there are Vertex and Index buffers that are required to generate a 3D mesh. The Vertex buffer will contain all the points in the mesh. The index buffer contains the order to generate the polygon. If you follow a similar pattern to tracing the triangle, this will help with filling in the Index Buffer. Depending on the version of D3D, here is a link to give you more information on these buffers. 

    Rendering from Vertex and Index Buffers
    http://msdn.microsoft.com/en-us/library/windows/desktop/bb153357(v=vs.85).aspx

    As for the difference, you will want to avoid the projection since this will be done for you in your D3D render loop.

    Face Tracking
    http://msdn.microsoft.com/en-us/library/jj130970.aspx

    Get3DShape - returns the 3D face model vertices transformed by the passed Shape Units, Animation Units, scale stretch, rotation and translation

    GetProjectedShape - Returns the 3D face model vertices transformed by the passed Shape Units, Animation Units, scale stretch, rotation and translation and projected to the video frame

    Thursday, March 21, 2013 10:15 PM