예제 #1
0
파일: Panel3D.cs 프로젝트: fr0/Orion
        static Viewport3DEx CreateViewport()
        {
            var viewport = new Viewport3DEx
            {
                Camera = new PerspectiveCamera
                {
                    LookDirection = new Vector3D(2, 0, -10),
                    Position = new Point3D(-3.18, 2, 3),
                    UpDirection = new Vector3D(0, 1, 0)
                }
            };

            viewport.Children.Add(new ModelVisual3D
            {
                Content = new AmbientLight(Colors.White)
            });

            return viewport;
        }
예제 #2
0
파일: Panel3D.cs 프로젝트: fr0/Orion
        public Panel3D()
        {
            // Create the viewport that hosts the child elements.
            _viewport = CreateViewport();

            // Configure the timer that is used to clean up after the 3D models move.
            _moveItemsCompletionTimer = new DispatcherTimer(DispatcherPriority.Normal);
            _moveItemsCompletionTimer.Tick += this.OnMoveItemsCompleted;

            this.Loaded += this.OnLoaded;
        }