locked
Kinect V2 face with grid RRS feed

  • Question

  • Hello I'm an university student and I'm working with Kinect v2

    I would be very grateful for helping me to solve this doubt with the API HD face basics. How could I get a grid mesh using the code of the HD face basics?

    I mean showing this:

    Like this:

    Thanks!

    Friday, March 13, 2015 4:02 PM

All replies

  • The HD Face provides the indices that allow you to draw the triangles you'd like. In the HD Face sample, the mesh is shaded with a pixel shader and a vertex shader.

    If you just use the vertices to draw your mesh and leave off the shaders it should accomplish what you're looking for. Keep in mind the V1 has considerably less vertices than V2.


    Sr. Enterprise Architect | Trainer | Consultant | MCT | MCSD | MCPD | SharePoint TS | MS Virtual TS |Windows 8 App Store Developer | Linux Gentoo Geek | Raspberry Pi Owner | Micro .Net Developer | Kinect For Windows Device Developer |blog: http://dgoins.wordpress.com

    Saturday, March 14, 2015 6:47 PM
  • you could also change the rendering to wireframe mode. Because there are way more vertices in the new mesh model, it is going to be very dense.

    Carmine Sirignano - MSFT

    Monday, March 16, 2015 5:57 PM
  • How I can change the rendering mode in Visual Studio 2013?
    Monday, March 16, 2015 8:19 PM
  • Easiest way... watch this tutorial

    Example:

    WireFrame Mesh

    Code:

    //Create an Initializer
    void HDFaceD3DPanel::InitRenderState()
    {
    	D3D11_RASTERIZER_DESC wfd;
    	ZeroMemory(&wfd, sizeof(D3D11_RASTERIZER_DESC));
    	wfd.FillMode = D3D11_FILL_WIREFRAME;
    	wfd.CullMode = D3D11_CULL_NONE;
    	
    	//to enable clipping
    	wfd.DepthClipEnable = true;
    
    	m_d3dDevice->CreateRasterizerState(&wfd, m_WireFrameRS.GetAddressOf());
    
    }
    
    
    //Then inside your render code:
      m_d3dContext->IASetVertexBuffers(0, 1, m_vertexBuffer.GetAddressOf(), &stride, &offset);
    
        m_d3dContext->IASetIndexBuffer(m_indexBuffer.Get(), DXGI_FORMAT_R32_UINT, 0);
    
    	// Attach the WireFrame Rasterizer
    	m_d3dContext->RSSetState(m_WireFrameRS.Get());
    
        m_d3dContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
    
        m_d3dContext->IASetInputLayout(m_inputLayout.Get());
    
        // Attach our vertex shader.
        m_d3dContext->VSSetShader(m_vertexShader.Get(), nullptr, 0);
    
        // Send the constant buffer to the Graphics device.
        m_d3dContext->VSSetConstantBuffers(0, 1, m_constantBuffer.GetAddressOf());
    
        // Attach our pixel shader.
        m_d3dContext->PSSetShader(m_pixelShader.Get(), nullptr, 0);
    
    	
        // Draw the objects.
        m_d3dContext->DrawIndexed(this->modelIndicesCount, 0, 0);



    Sr. Enterprise Architect | Trainer | Consultant | MCT | MCSD | MCPD | SharePoint TS | MS Virtual TS |Windows 8 App Store Developer | Linux Gentoo Geek | Raspberry Pi Owner | Micro .Net Developer | Kinect For Windows Device Developer |blog: http://dgoins.wordpress.com

    Tuesday, March 17, 2015 10:12 PM
  • thank you for the answer.

    How Can do this in WPF (C#)?

    Wednesday, March 18, 2015 2:32 PM