Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ SDK GetFaceModelTriangles() always fails #19

Open
pixelnerve opened this issue Oct 6, 2016 · 2 comments
Open

C++ SDK GetFaceModelTriangles() always fails #19

pixelnerve opened this issue Oct 6, 2016 · 2 comments

Comments

@pixelnerve
Copy link

This function doesn't seem to work at all. Is there more information about this function ?

@diablodale
Copy link

diablodale commented Oct 7, 2016

Have you allocated the needed memory structures? The doc lacks detail on that. Here is code that works for me:

hr = GetFaceModelTriangleCount((UINT32*)&m_HDFaceModelTriangleCount);
if (SUCCEEDED(hr))
{
    m_pHDFaceModelTriangleVertexIndices = (UINT32*)malloc(m_HDFaceModelTriangleCount * 3 * sizeof(UINT32));
    if (m_pHDFaceModelTriangleVertexIndices)
    {
        hr = GetFaceModelTriangles(m_HDFaceModelTriangleCount * 3, m_pHDFaceModelTriangleVertexIndices);
    }
    else
    {
        hr = E_OUTOFMEMORY;
    }
}

@pixelnerve
Copy link
Author

Ah perfect. That works. I was mislead by the function name. Was using triangle count as capacity. Should be triangleCount * 3

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants