Skip to content
Snippets Groups Projects
Commit 1cbea0ad authored by Alexis Iakovenko's avatar Alexis Iakovenko
Browse files

Use dynamic threshold based on initial coordinates

parent 1e6c241e
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,7 @@ public class LiveComparer : MonoBehaviour ...@@ -24,6 +24,7 @@ public class LiveComparer : MonoBehaviour
public void ResetScore() public void ResetScore()
{ {
acceptableScore = frameScore - 1.0f;
totalScore = 0.0f; totalScore = 0.0f;
frameScore = 0.0f; frameScore = 0.0f;
sumScore = 0.0f; sumScore = 0.0f;
...@@ -51,8 +52,8 @@ public class LiveComparer : MonoBehaviour ...@@ -51,8 +52,8 @@ public class LiveComparer : MonoBehaviour
//for now we only consider the left hand //for now we only consider the left hand
frameScore = 100.0f; frameScore = 100.0f;
float positionFactor = 10.0f; float positionFactor = 15.0f;
float rotationFactor = 5.0f; float rotationFactor = 15.0f;
Vector3 differencePosition = leftPalmPosition - Vector3 differencePosition = leftPalmPosition -
replay.gestureToReplay.states [replay.currentFrame].position; replay.gestureToReplay.states [replay.currentFrame].position;
...@@ -102,14 +103,22 @@ public class LiveComparer : MonoBehaviour ...@@ -102,14 +103,22 @@ public class LiveComparer : MonoBehaviour
frameScoreLabel.GetComponent<Text> ().text = "frame score: " + frameScore.ToString (); frameScoreLabel.GetComponent<Text> ().text = "frame score: " + frameScore.ToString ();
totalScoreLabel.GetComponent<Text> ().text = "total score: " + totalScore.ToString (); totalScoreLabel.GetComponent<Text> ().text = "total score: " + totalScore.ToString ();
if (frameScore > acceptableScore) if (replay.currentFrame == 0)
frameScoreLabel.GetComponent<Text> ().color = new Color (0.0f, 0.7f, 0.0f); {
frameScoreLabel.GetComponent<Text> ().color = new Color (0.0f, 0.0f, 0.0f);
totalScoreLabel.GetComponent<Text> ().color = new Color (0.0f, 0.0f, 0.0f);
}
else else
frameScoreLabel.GetComponent<Text> ().color = new Color (0.7f, 0.0f, 0.0f); {
if (frameScore > acceptableScore)
frameScoreLabel.GetComponent<Text> ().color = new Color (0.0f, 0.7f, 0.0f);
else
frameScoreLabel.GetComponent<Text> ().color = new Color (0.7f, 0.0f, 0.0f);
if (totalScore > acceptableScore) if (totalScore > acceptableScore)
totalScoreLabel.GetComponent<Text> ().color = new Color (0.0f, 0.7f, 0.0f); totalScoreLabel.GetComponent<Text> ().color = new Color (0.0f, 0.7f, 0.0f);
else else
totalScoreLabel.GetComponent<Text> ().color = new Color (0.7f, 0.0f, 0.0f); totalScoreLabel.GetComponent<Text> ().color = new Color (0.7f, 0.0f, 0.0f);
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment