Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>SOLVED</strong></p> <p>I put the member call into "Update" callback, before it was called from the "Draw" callback.</p> <p>Correct Code (relevant part)</p> <pre><code>public override void Update(GameTime gameTime) { // Debug.WriteLine("= UPDATE - SkeletonStreamRender"); if (null == this.Chooser.Sensor || false == this.Chooser.Sensor.IsRunning || KinectStatus.Connected != this.Chooser.Sensor.Status) { return; } if (skeletonDrawn || !drawChk) { using (var skeletonFrame = this.Chooser.Sensor.SkeletonStream.OpenNextFrame(0)) { if (null == skeletonData || skeletonData.Length != skeletonFrame.SkeletonArrayLength) { skeletonData = new Skeleton[skeletonFrame.SkeletonArrayLength]; } skeletonFrame.CopySkeletonDataTo(skeletonData); int counter = 0; foreach (Skeleton s in skeletonData) { if (s.TrackingState == SkeletonTrackingState.Tracked) { playersID = s.TrackingId; Skeleton skeleton = MoveTo2(s); skeletonData[counter] = skeleton; continue; } counter++; } skeletonDrawn = false; } [CUT] </code></pre> <p>Wrong call from Draw</p> <pre><code>public override void Draw(GameTime gameTime) { // Debug.WriteLine("== DRAW - SkeletonStreamRender"); // If the joint texture isn't loaded, load it now if (null == this.jointTexture) { this.LoadContent(); } // If we don't have data, lets leave if (null == skeletonData || null == this.mapMethod) { return; } if (false == this.initialized) { this.Initialize(); } this.SharedSpriteBatch.Begin(); foreach (var skeleton in skeletonData) { if (playersID != skeleton.TrackingId) continue; switch (skeleton.TrackingState) { case SkeletonTrackingState.NotTracked: // non tracciato break; case SkeletonTrackingState.Tracked: // blocco la posizione Z Skeleton skeleton = MoveTo2(skeletonTmp); // Draw Bones this.DrawBone(skeleton.Joints, JointType.Head, JointType.ShoulderCenter); this.DrawBone(skeleton.Joints, JointType.ShoulderCenter, JointType.ShoulderLeft); this.DrawBone(skeleton.Joints, JointType.ShoulderCenter, JointType.ShoulderRight); this.DrawBone(skeleton.Joints, JointType.ShoulderCenter, JointType.Spine); [CUT] </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload