Exemple #1
0
        void ResetUI()
        {
            tbSteps.Text   = "0";
            tbCubeOps.Text = string.Empty;

            ResetCamera();

            btnUnfold.Content = "Unfold";
            //_rubikscube.ViewPoint = MathConverter.ToPoint3(_camera.Position);
            _viewport.UpdateLayout();
        }
Exemple #2
0
        public void updateResult(string text, bool draw)
        {
            if (this.infoTxtBlk.Dispatcher.Thread != Thread.CurrentThread)
            {
                this.infoTxtBlk.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new UpdateResultCallback(this.updateResult), text, draw);
            }
            else
            {
                try {
                    if (kinectList == null)
                    {
                        return;
                    }

                    this.infoTxtBlk.Text = "[Fused Kinect Result]" + Environment.NewLine + fusedKinectParameters.printKinectParameters();
                    //show synchy info
                    this.infoTxtBlk.Text = this.infoTxtBlk.Text + "[Synchy Info] num = " + GUIComponents.synchyList.Count + Environment.NewLine;
                    for (int i = 0; i < GUIComponents.synchyList.Count; ++i)
                    {
                        this.infoTxtBlk.Text = this.infoTxtBlk.Text + i + " : " + GUIComponents.synchyList[i].printSynchy() + Environment.NewLine;
                    }

                    MatrixProcessor mp = new MatrixProcessor();
                    server.fusedKinectParameter = fusedKinectParameters;

                    if (!draw)
                    {
                        return;
                    }

                    //3D plot functions
                    show_viewport3D.Children.Clear();
                    ClearViewport();

                    PerspectiveCamera cam = (PerspectiveCamera)show_viewport3D.Camera;
                    show_viewport3D.Children.Add(new ModelVisual3D()
                    {
                        Content = new DirectionalLight(Colors.White, new Vector3D(cam.LookDirection.X, cam.LookDirection.Y, cam.LookDirection.Z))
                    });
                    show_viewport3D.Children.Add(new ModelVisual3D()
                    {
                        Content = new DirectionalLight(Colors.White, new Vector3D(-cam.LookDirection.X, -cam.LookDirection.Y, -cam.LookDirection.Z))
                    });

                    drawSynchy();

                    PerspectiveCamera c = (PerspectiveCamera)show_viewport3D.Camera.GetCurrentValueAsFrozen();
                    for (int i = 0; i < transfMatrix.Count; ++i)
                    {
                        drawFrameAxis(i);
                    }

                    if (fusedKinectParameters != null)
                    {
                        if (fusedKinectParameters.skeletonArray != null)
                        {
                            for (int j = 0; j < fusedKinectParameters.skeletonArray.Length; ++j)
                            {
                                if (fusedKinectParameters.skeletonArray[j] != null)
                                {
                                    drawSkeleton(fusedKinectParameters.skeletonArray[j]);
                                }
                            }
                        }
                    }

                    show_viewport3D.UpdateLayout();
                } catch (Exception ex) {
                    string ss = ex.ToString();
                }
            }
        }