|
@@ -25,6 +25,7 @@ namespace bbiwarg.Graphics
|
|
|
private uint[] triangles = new uint[0];
|
|
|
|
|
|
private Point palmPoint;
|
|
|
+ private Point[] fingerPoints;
|
|
|
|
|
|
|
|
|
public Output(IVideoDataSource source)
|
|
@@ -95,6 +96,12 @@ namespace bbiwarg.Graphics
|
|
|
Vertex palmVertex = new Vertex(palmPosition[0], palmPosition[2], palmPosition[1]);
|
|
|
palmPoint = new Point(palmVertex, Color.Yellow, 0.005f);
|
|
|
graphicElements.Add(palmPoint);
|
|
|
+
|
|
|
+ fingerPoints = new Point[5];
|
|
|
+ for (int i = 0; i < 5; i++)
|
|
|
+ {
|
|
|
+ fingerPoints[i] = new Point(new Vertex(0f, 0f, 0f), Color.Yellow, 0.005f);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void updateDepthPixels()
|
|
@@ -111,6 +118,28 @@ namespace bbiwarg.Graphics
|
|
|
palmPoint.position.x = palmPosition[0];
|
|
|
palmPoint.position.y = palmPosition[2];
|
|
|
palmPoint.position.z = palmPosition[1];
|
|
|
+
|
|
|
+
|
|
|
+ Vector[] fingerPositions = source.getFingerTipPositions3D(1);
|
|
|
+ DetectionStatus[] fingerStatus = source.getFingerStatus(1);
|
|
|
+ for(int i=0; i<5; i++) {
|
|
|
+ if(fingerStatus[i] == DetectionStatus.Tracked) {
|
|
|
+ fingerPoints[i].position.x = fingerPositions[i][0];
|
|
|
+ fingerPoints[i].position.y = fingerPositions[i][2];
|
|
|
+ fingerPoints[i].position.z = fingerPositions[i][1];
|
|
|
+ }
|
|
|
+ else if(fingerStatus[i] == DetectionStatus.Detected) {
|
|
|
+ graphicElements.Add(fingerPoints[i]);
|
|
|
+ fingerPoints[i].position.x = fingerPositions[i][0];
|
|
|
+ fingerPoints[i].position.y = fingerPositions[i][2];
|
|
|
+ fingerPoints[i].position.z = fingerPositions[i][1];
|
|
|
+ }
|
|
|
+ else if(fingerStatus[i] == DetectionStatus.Inactive && graphicElements.IndexOf(fingerPoints[i]) > -1) {
|
|
|
+ graphicElements.Remove(fingerPoints[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void initBuffers()
|