public void SetScene(Scene scene)
        {
            if (this.scene != null) {
                this.scene.primitiveAdded -= SceneUpdated;
                this.scene.scenePrimitiveUpdated -= SceneUpdated;
            }
            if (camera != null) {
                camera.cameraUpdated -= CameraUpdated;
            }

            this.scene = scene;
            switch (cameraType) {
                case CameraType.XOrtho: camera = scene.XOrthographicCamera; break;
                case CameraType.YOrtho: camera = scene.YOrthographicCamera; break;
                case CameraType.ZOrtho: camera = scene.ZOrthographicCamera; break;
                case CameraType.Perspective: camera = scene.PerspectiveCamera; break;
            }

            this.scene.primitiveAdded += SceneUpdated;
            this.scene.scenePrimitiveUpdated += SceneUpdated;
            camera.cameraUpdated += CameraUpdated;

            camera.Width = glControl.Width;
            camera.Height = glControl.Height;
        }
 private void SceneUpdated(Scene scene, Primitive primitive)
 {
     glControl.Invalidate();
 }