private void SetupKinect() { this.context = new xn.Context(SAMPLE_XML_FILE); this.sessionManager = new xnv.SessionManager(this.context, "Wave", "RaiseHand"); this.pointControl = new xnv.PointControl(); this.sessionManager.SessionStart += new xnv.SessionManager.SessionStartHandler(sessionManager_SessionStart); this.primaryHand = new xnv.HandPointContext(); this.handPoints = new List <xnv.HandPointContext> (); this.pointControl.PointDestroy += new xnv.PointControl.PointDestroyHandler(pointControl_PointDestroy); this.pointControl.PointUpdate += new xnv.PointControl.PointUpdateHandler(pointControl_PointUpdate); this.pointControl.PointCreate += new xnv.PointControl.PointCreateHandler(pointControl_PointCreate); this.pointControl.PrimaryPointCreate += new xnv.PointControl.PrimaryPointCreateHandler(pointControl_PrimaryPointCreate); this.pointControl.PrimaryPointReplace += new xnv.PointControl.PrimaryPointReplaceHandler(pointControl_PrimaryPointReplace); this.pointControl.PrimaryPointDestroy += new xnv.PointControl.PrimaryPointDestroyHandler(pointControl_PrimaryPointDestroy); this.sessionManager.AddListener(this.pointControl); this.shouldRun = true; this.readerThread = new Thread(ReaderThread); this.readerThread.Start(); }
void pointControl_PointUpdate(ref xnv.HandPointContext context) { foreach (xnv.HandPointContext hpc in handPoints) { if (hpc.nID == context.nID) { handPoints[handPoints.IndexOf(hpc)] = context; } } /*string sendData = * "Pos(" + context.ptPosition.X.ToString () + ", " + context.ptPosition.Y.ToString () + ", " + context.ptPosition.Z.ToString () + ") " + "nID: " + context.nID.ToString () + " nUserID: " + context.nUserID.ToString (); + + + Console.Out.WriteLine ("PointUpdate: " + sendData);*/ }
void pointControl_PointCreate(ref xnv.HandPointContext context) { handPoints.Add(context); }
void pointControl_PrimaryPointDestroy(uint id) { primaryHand = new xnv.HandPointContext(); }
void pointControl_PrimaryPointCreate(ref xnv.HandPointContext context, ref xn.Point3D pnt) { primaryHand = context; }
void pointControl_PrimaryPointReplace(uint nID, ref xnv.HandPointContext context) { primaryHand = context; }
private void SetupKinect() { this.context = new xn.Context (SAMPLE_XML_FILE); this.sessionManager = new xnv.SessionManager (this.context, "Wave", "RaiseHand"); this.pointControl = new xnv.PointControl (); this.sessionManager.SessionStart += new xnv.SessionManager.SessionStartHandler (sessionManager_SessionStart); this.primaryHand = new xnv.HandPointContext (); this.handPoints = new List<xnv.HandPointContext> (); this.pointControl.PointDestroy += new xnv.PointControl.PointDestroyHandler (pointControl_PointDestroy); this.pointControl.PointUpdate += new xnv.PointControl.PointUpdateHandler (pointControl_PointUpdate); this.pointControl.PointCreate += new xnv.PointControl.PointCreateHandler (pointControl_PointCreate); this.pointControl.PrimaryPointCreate += new xnv.PointControl.PrimaryPointCreateHandler (pointControl_PrimaryPointCreate); this.pointControl.PrimaryPointReplace += new xnv.PointControl.PrimaryPointReplaceHandler (pointControl_PrimaryPointReplace); this.pointControl.PrimaryPointDestroy += new xnv.PointControl.PrimaryPointDestroyHandler (pointControl_PrimaryPointDestroy); this.sessionManager.AddListener (this.pointControl); this.shouldRun = true; this.readerThread = new Thread (ReaderThread); this.readerThread.Start (); }
void pointControl_PrimaryPointDestroy(uint id) { primaryHand = new xnv.HandPointContext (); }
void selectableSlider_PrimaryPointCreate(ref xnv.HandPointContext context, ref xn.Point3D ptFocus) { this.SliderArea.BackColor = Color.Red; }