예제 #1
0
        private void SelectView(View view)
        {
            // ReSharper disable RedundantComparisonWithNull
            dumpViewButton.Enabled = view is TextureView;
            // ReSharper restore RedundantComparisonWithNull

            if (viewPropertyGrid.SelectedObject != view)
            {
                viewPropertyGrid.SelectedObject = view;
                if (view == null)
                {
                    cameraPropertyGrid.SelectedObject = null;
                    cameraLabel.Text = "Camera:";
                }
                else
                {
                    cameraPropertyGrid.SelectedObject = view.Camera;
                    cameraLabel.Text = view.Camera.ToString();
                }
            }

            UpdateShaders();
            UpdateRenderables();
            UpdateLights();
        }
예제 #2
0
        private void InitializeScene(Engine engine)
        {
            var scene = new Scene
            {
                Positionables = { Model.Sphere(engine, XTexture.Get(engine, "flag.png")) }
            };

            _camera = new TrackCamera {
                VerticalRotation = 20
            };
            var view = new View(scene, _camera)
            {
                BackgroundColor = Color.CornflowerBlue
            };

            engine.Views.Add(view);
        }