public void update() { foreach (DictionaryEntry dE in skeleton.getBodyParts()) { Object3D esfera = (Object3D)esferas[(String)dE.Key]; esfera.traslacion = Matrix.CreateTranslation(((HumanBodyPart)dE.Value).X, ((HumanBodyPart)dE.Value).Y, ((HumanBodyPart)dE.Value).Z) * translation; } }
public override void update() { if ((DateTime.Now - timeLastFrame) < this.interval) { for (int i = 0; i < skeletons.Count; i++) { if (this.getState(i).Equals(this.DETECTADO)) { SkeletonData data = skeletonFrame.Skeletons[skeletonsPosition[i]]; if (SkeletonTrackingState.Tracked == data.TrackingState) { HumanSkeleton skeleton = skeletons.ElementAt(i); foreach (DictionaryEntry dE in skeleton.getBodyParts()) { Joint j = data.Joints[getSkeletonJoint((String)dE.Key)]; ((HumanBodyPart)dE.Value).setPosition(j.Position.X, j.Position.Y, j.Position.Z); } } else { skeletonsPosition[i] = -1; this.setState(i, this.BUSCANDO); } } } } else { loseUsers(); } }
private void crearEstructura() { try { String line; List <HumanSkeleton> animacion = new List <HumanSkeleton>(); while ((line = mySR.ReadLine()) != null) { HumanSkeleton nuevo = new HumanSkeleton(); nuevo.init();//lo inicializa con las 15 partes del cuerpo char[] delimiterChars = { SEPARADOR }; string[] words = line.Split(delimiterChars); for (int i = 0; i < nuevo.getBodyParts().Count * 4; i += 4) { setSkeletonBodyPart(nuevo, words[i], words[i + 1], words[i + 2], words[i + 3]); } animacion.Add(nuevo); } myRecorder.Add(animacion); this.closeConection(); this.setState(this.skeletons.Count - 1, this.DETECTADO); } catch (Exception e) { Console.WriteLine(e.Message); } }