Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KinectViewModel"/> class.
 /// </summary>
 /// <param name="kinectService">The kinect service.</param>
 public KinectViewModel(KinectService kinectService)
 {
     RotationAngle   = 90;
     CurrentRotation = 0;
     _kinectService  = kinectService;
     _kinectService.Initialize();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Executes when capture button was hit.
        /// </summary>
        public void CaptureExecuted()
        {
            DepthImagePixel[] data = KinectService.GetDepthData();
            if (_builder == null)
            {
                _builder = new ModelBuilder(ModelBuilder.GetModelSize(data, 640), CubeDivide, ModelDepth);
            }

            _builder.CheckVerticesInCube((int)CurrentRotation, data, KinectService.Kinect.DepthStream.NominalFocalLengthInPixels);
            CurrentRotation = CurrentRotation + RotationAngle;

            if (CurrentRotation == FullRotationAngle)
            {
                CurrentRotation = 0;
                var modelWindow = new ModelWindow();
                modelWindow.DataContext = new ModelWindowViewModel(_builder.CreateModel());
                modelWindow.Show();
            }
        }