Ejemplo n.º 1
0
    void Update()
    {
        if (!isOn)
        {
            return;
        }

        headRotation = faceTrackingManager.GetHeadRotation(true).eulerAngles;
        //invierte:
        headRotation.x = headRotation.x * -2;
        headRotation.z = headRotation.z * -1;
        headRotation.y = headRotation.y * 2;

        faceInteractions.transform.localEulerAngles = headRotation;
        //el 22 es la punta de arriba de la boca:
        Vector3 vert_pos_mouth_1 = faceTrackingManager.GetFaceModelVertex(22);
        //el 10 es la punta de abajo de la boca:
        Vector3 vert_pos_mouth_2 = faceTrackingManager.GetFaceModelVertex(10);



        mouthPosition = vert_pos_mouth_1;//Vector3.Lerp(vert_pos_mouth_1, vert_pos_mouth_2, 0.5f);

        float mouthValue = Vector3.Distance(vert_pos_mouth_1, vert_pos_mouth_2);

        smoothMouthValue = Mathf.Lerp(mouthValue, smoothMouthValue, mouthSmoothFilter);

        SetMouthState();

        faceInteractions.transform.position = Vector3.Lerp(vert_pos_mouth_1 + offsetMomuth, faceInteractions.transform.position, 0.1f);

        // DrawPoints();
    }