GMU:Tutorials/Performance Platform/Measuring Motion with Processing: Difference between revisions

From Medien Wiki
No edit summary
No edit summary
 
Line 15: Line 15:
*Groups of persons mode: Measuring the pairwise distances between root nodes of three persons.<br>
*Groups of persons mode: Measuring the pairwise distances between root nodes of three persons.<br>
== Process: ==
== Process: ==
1. Collecting the correlative data for the speed: Through the connecting of  OSC and Motion Tracking platform, the root position and the updated data of one person could be obtained. The shifting distance and the relevant time decides the speed of the root node.
'''1. Collecting the correlative data for the speed:''' Through the connecting of  OSC and Motion Tracking platform, the root position and the updated data of one person could be obtained. The shifting distance and the relevant time decides the speed of the root node.
<br>
<br>
<source lang="java">
<source lang="java">
Line 34: Line 34:
   }
   }
</source>
</source>
2. The shifting distance and the relevant time decides the speed of the root node.  <br>
'''2. The shifting distance and the relevant time decides the speed of the root node.''' <br>
<source lang="java">
<source lang="java">
float speed (Sphere sphere1)
float speed (Sphere sphere1)
Line 43: Line 43:
}
}
</source>
</source>
3.Calculating the distance between two root points.
'''3.Calculating the distance between two root points.'''
<source lang="java">
<source lang="java">
float distance (Sphere sphere1,Sphere sphere2)
float distance (Sphere sphere1,Sphere sphere2)
Line 55: Line 55:
}
}
</source>
</source>
4.Calculating the area of the triangle make up by three root points.
'''4.Calculating the area of the triangle make up by three root points.'''
<source lang="java">
<source lang="java">
float triangleSize(Sphere sphere1,Sphere sphere2,Sphere sphere3)
float triangleSize(Sphere sphere1,Sphere sphere2,Sphere sphere3)
Line 73: Line 73:
Three root positions could form a triangle in the space. With the help of  Heron’s formula, the area of the triangle could be calculated.
Three root positions could form a triangle in the space. With the help of  Heron’s formula, the area of the triangle could be calculated.


5.According to the speed, distance, area giving different background color.
'''5.According to the speed, distance, area giving different background color.'''
<source lang="java">
<source lang="java">
//the maximum area is 6*6/2=18m^2,mapping the value of the area to the color of the background
//the maximum area is 6*6/2=18m^2,mapping the value of the area to the color of the background