Ejemplo n.º 1
0
    void OnGUI()
    {
#if !UNITY_WSA
        string str;

//		print ("confidence 0 in op mon : " + Pupil.values.Confidences [0]);
        Operator.properties.Properties [0].confidence = PupilTools.Confidence(PupilData.leftEyeID);
        Operator.properties.Properties [1].confidence = PupilTools.Confidence(PupilData.rightEyeID);

//		print (Pupil.values.Confidences [0]);

        GUI.color = new Color(1, 1, 1, .5f);

        float imageHeight           = (Screen.width / 2) / 1.333f; //for 4:3 ratio
        float imageVerticalPosition = (Screen.height - imageHeight) / 2;

        GUI.DrawTexture(new Rect(0, imageVerticalPosition, Screen.width / 2, imageHeight), pupilSettings.framePublishing.eye0Image);
        GUI.DrawTexture(new Rect(Screen.width / 2, imageVerticalPosition, Screen.width / 2, imageHeight), pupilSettings.framePublishing.eye1Image);

        Operator.properties.Properties [0].OperatorCamera.Render();


        //Construct the Text box string for data display on the Operator Monitor view
        str  = "Gaze Point : " + " ( X: " + PupilData._3D.GazePosition.x + " Y: " + PupilData._3D.GazePosition.y + " Z: " + PupilData._3D.GazePosition.z + " ) ";
        str += "\nEyeball 0 Center : " + " ( X: " + PupilData._3D.RightEyeCenter.x + " Y: " + PupilData._3D.RightEyeCenter.y + " Z: " + PupilData._3D.RightEyeCenter.z + " ) ";
        str += "\nEyeball 1 Center : " + " ( X: " + PupilData._3D.LeftEyeCenter.x + " Y: " + PupilData._3D.LeftEyeCenter.y + " Z: " + PupilData._3D.LeftEyeCenter.z + " ) ";
        str += "\nPupil Diameter : " + PupilData.Diameter();


        //Use the predefined style for the TextArea
        GUIStyle _s = pupilTracker.Styles.Find(x => x.name == "OpMon_textArea");
        GUI.TextArea(new        Rect(0, 0, Screen.width, 200), str, _s);

        //This is the call to draw both Confidence Graphs for each eyes
        DrawGraph(Operator.properties.Properties[0]);
        DrawGraph(Operator.properties.Properties[1]);
#endif
    }