{ // ... } // Raise hand if (hand.Direction.Pitch < -2.5 * avgPitch && repsPerformed < repsRequired && !raisePromptGiven) { // ... } Listing Exercise 2 Wrist Flexion & Extension Key Metric Conditional – – The third and final exercise (Three Jaw Chuck Pinch) uses the exact same logic as the first exercise (Fist Clench) and will therefore not be covered. The only notable difference between them is the number of fingers being checked for at each stage of the exercise. Since the third exercise uses the thumb, index finger and middle finger, we check for 3 fingers instead of 5 followed by 1 instead of 0. After the data from the Leap Motion has been collected and used to progress the exercises, the last remaining task for the current loop iteration is to update the 3d hand model. The 3D hand model used in the LMRS is powered by version 3.5 of XNA and uses data from the Leap Motion to animate the bones of the model. Before animating the hand however, we must first calculate two key vectors, the angles between which will then be used to animate the hand model by setting the joints equal to these angles. The first of these two vectors covers the distance between the centre of the palm and the base of the finger in question; the second of the two vectors covers the distance from the base of the finger to the finger tip, these can be seen in Figure 38. Figure Vectors used for calculation – However, before we can even calculate these two vectors, we must first calculate the base of the finger itself as this data is not readily accessible via the Leap Motion SDK, however, the Leap developers do provide a means to calculate this in the SDK documentation . These three vectors (finger base, palm to base and base to tip) along with the resulting angle data are
{ // ... } // Raise hand if (hand.Direction.Pitch < -2.5 * avgPitch && repsPerformed < repsRequired && !raisePromptGiven) { // ... } Listing – Exercise 2 – Wrist Flexion & Extension Key Metric Conditional The third and final exercise (Three Jaw Chuck Pinch) uses the exact same logic as the first exercise (Fist Clench) and will therefore not be covered. The only notable difference between them is the number of fingers being checked for at each stage of the exercise. Since the third exercise uses the thumb, index finger and middle finger, we check for 3 fingers instead of 5 followed by 1 instead of 0. After the data from the Leap Motion has been collected and used to progress the exercises, the last remaining task for the current loop iteration is to update the 3d hand model. The 3D hand model used in the LMRS is powered by version 3.5 of XNA and uses data from the Leap Motion to animate the bones of the model. Before animating the hand however, we must first calculate two key vectors, the angles between which will then be used to animate the hand model by setting the joints equal to these angles. The first of these two vectors covers the distance between the centre of the palm and the base of the finger in question; the second of the two vectors covers the distance from the base of the finger to the finger tip, these can be seen in Figure 38. Figure – Vectors used for calculation However, before we can even calculate these two vectors, we must first calculate the base of the finger itself as this data is not readily accessible via the Leap Motion SDK, however, the Leap developers do provide a means to calculate this in the SDK documentation . These three vectors (finger base, palm to base and base to tip) along with the resulting angle data are
thesis-jamietaylor.docx