Example #1
0
void testApp::FTHelperCallingBack(PVOID pVoid) {
	testApp* pApp = reinterpret_cast<testApp*>(pVoid);
    if (pApp) {
        
		IFTResult* pResult = pApp->faceTracker.GetResult();
        if (pResult && SUCCEEDED(pResult->GetStatus())) {
            // FLOAT* pAU = NULL;
            // UINT   numAU;
            // pResult->GetAUCoefficients(&pAU, &numAU);
            // pApp->m_eggavatar.SetCandideAU(pAU, numAU);
			
			//FT_VECTOR2D* points;
			//UINT         count;
			//pResult->Get2DShapePoints(&points, &count);

			// IFTImage*  img = pApp->m_FTHelper.GetColorImage();
			// memcpy(pApp->colorBuffer, img->GetBuffer(), 640*480*4);
			
			// FLOAT scale;
            // FLOAT rotationXYZ[3];
            // FLOAT translationXYZ[3];
            // pResult->Get3DPose(&scale, rotationXYZ, translationXYZ);
            // pApp->m_eggavatar.SetTranslations(translationXYZ[0], translationXYZ[1], translationXYZ[2]);
            // pApp->m_eggavatar.SetRotations(rotationXYZ[0], rotationXYZ[1], rotationXYZ[2]);
        }
    }	
}
/*
 * The "FT Helper" class is generic. It will call back this function
 * after a face has been successfully tracked. The code in the call back passes the parameters
 * to the Egg Avatar, so it can be animated.
 */
void MultiFace::FTHelperCallingBack(PVOID pVoid, UINT userId)
{
    MultiFace* pApp = reinterpret_cast<MultiFace*>(pVoid);
    if (pApp)
    {
        IFTResult* pResult = pApp->m_FTHelper.GetResult(userId);
        if (pResult && SUCCEEDED(pResult->GetStatus()))
        {
            FLOAT* pAU = NULL;
            UINT numAU;
            pResult->GetAUCoefficients(&pAU, &numAU);
            pApp->m_eggavatar[userId].SetCandideAU(pAU, numAU);
            FLOAT scale;
            FLOAT rotationXYZ[3];
            FLOAT translationXYZ[3];
            pResult->Get3DPose(&scale, rotationXYZ, translationXYZ);
            pApp->m_eggavatar[userId].SetTranslations(translationXYZ[0], translationXYZ[1], translationXYZ[2]);
            pApp->m_eggavatar[userId].SetRotations(rotationXYZ[0], rotationXYZ[1], rotationXYZ[2]);
        }
    }
}