Esempio n. 1
0
        public void TranslateSceneWithMouse(Vector mouseMovement)
        {
            ActiveRenderer.Scene.Camera.Move(new Vector3D(mouseMovement.X / 50, 0, -mouseMovement.Y / 50));

            UpdateManipulatorInfo();
            ActiveRenderer.ForceRedraw();
        }
Esempio n. 2
0
        public void ScaleWithMouse(int delta)
        {
            ActiveRenderer.Scene.Camera.Zoom += delta * 0.002;

            UpdateManipulatorInfo();
            ActiveRenderer.ForceRedraw();
        }
Esempio n. 3
0
        private void LoadScene()
        {
            var result = MessageBox.Show(
                _ownerWindow,
                "Loading a scene will clear this one. Are you sure?",
                "New scene confirmation",
                MessageBoxButton.YesNo,
                MessageBoxImage.Question
                );

            if (result == MessageBoxResult.No)
            {
                return;
            }

            var ofd        = new OpenFileDialog();
            var fileResult = ofd.ShowDialog();

            if (fileResult == false)
            {
                return;
            }

            CreateNewScene();
            _scene.Import(ofd.FileName);
            ActiveRenderer.ForceRedraw();
        }
Esempio n. 4
0
        public void RotateSceneWithMouse(Vector mouseMovement)
        {
            var rotation = new Vector3D(-mouseMovement.Y / 50, -mouseMovement.X / 50, 0);

            ActiveRenderer.Scene.Camera.Rotate(rotation);

            UpdateManipulatorInfo();
            ActiveRenderer.ForceRedraw();
        }
Esempio n. 5
0
        public void MoveManipulator(double dx, double dy, double dz)
        {
            var shift = new Vector3D(dx, dy, dz);

            _scene.Manipulator.Translate(shift);
            foreach (var obj in _scene.GrabbedObjects)
            {
                obj.Translate(shift);
            }

            UpdateManipulatorInfo();
            ActiveRenderer.ForceRedraw();
        }
Esempio n. 6
0
 private void SceneCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     ActiveRenderer.ForceRedraw();
 }
Esempio n. 7
0
 private void SceneChanged(object sender, PropertyChangedEventArgs e)
 {
     ActiveRenderer.ForceRedraw();
 }