|
@@ -39,6 +39,12 @@ namespace bbiwarg.Graphics
|
|
|
|
|
|
protected override void OnRenderFrame(FrameEventArgs e)
|
|
|
{
|
|
|
+ if (!inputProvider.isActive())
|
|
|
+ {
|
|
|
+ inputProvider.stop();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
base.OnRenderFrame(e);
|
|
|
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
|
|
Matrix4 modelview = Matrix4.LookAt(Vector3.Zero, -Vector3.UnitZ, Vector3.UnitY);
|
|
@@ -74,10 +80,11 @@ namespace bbiwarg.Graphics
|
|
|
++numFingersDetected;
|
|
|
}
|
|
|
|
|
|
- pointData = new float[(4 + 3) * (2 + numFingersDetected)];
|
|
|
+ pointData = new float[(4 + 3) * (3 + numFingersDetected)];
|
|
|
Color y = Color.Yellow;
|
|
|
Vector palmPosition = videoHandle.getPalmPosition3D(1);
|
|
|
Vector foreFingerPosition = videoHandle.pixel2VertexPosition(foreFingerDetection.getForeFingerPosition3D(1));
|
|
|
+ Vector foreArmPosition = inputProvider.getForearmPosition3D(1);
|
|
|
|
|
|
pointData[0] = palmPosition[0];
|
|
|
pointData[1] = palmPosition[1];
|
|
@@ -88,7 +95,17 @@ namespace bbiwarg.Graphics
|
|
|
pointData[5] = y.B / 255.0f;
|
|
|
pointData[6] = y.A / 255.0f;
|
|
|
|
|
|
- int index = 7;
|
|
|
+ pointData[7] = foreArmPosition[0];
|
|
|
+ pointData[8] = foreArmPosition[1];
|
|
|
+ pointData[9] = -foreArmPosition[2];
|
|
|
+
|
|
|
+ pointData[10] = y.R / 255.0f;
|
|
|
+ pointData[11] = y.G / 255.0f;
|
|
|
+ pointData[12] = y.B / 255.0f;
|
|
|
+ pointData[13] = y.A / 255.0f;
|
|
|
+
|
|
|
+
|
|
|
+ int index = 14;
|
|
|
Vector[] fingerPositions = inputProvider.getFingerTipPositions3D(1);
|
|
|
for (int i = 0; i < fingerStatus.Length; ++i)
|
|
|
{
|