Beispiel #1
0
    public static void TryCreateModel()
    {
        ModelWindow window = (ModelWindow)EditorWindow.GetWindow(typeof(ModelWindow), true, "模型建造选项", true);

        window.Show();
        window.Init();
    }
Beispiel #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();
            }
        }