void ScientificVisual3DControl_Resized(object sender, EventArgs e)
        {
            ScientificCamera camera = this.sceneControl.Scene.CurrentCamera as ScientificCamera;

            if (camera.CameraType == CameraTypes.Perspecitive)
            {
                IPerspectiveViewCamera perspecitive = camera;
                perspecitive.AdjustCamera(this.modelContainer.BoundingBox, this.sceneControl.OpenGL);
            }
            else if (camera.CameraType == CameraTypes.Ortho)
            {
                IOrthoViewCamera orthoCamera = camera;
                orthoCamera.AdjustCamera(this.modelContainer.BoundingBox, this.sceneControl.OpenGL);
            }
            else
            {
                throw new NotImplementedException();
            }
            ManualRender(this.sceneControl);
        }
Beispiel #2
0
        /// <summary>
        /// Update camera when resized, model container's bounding box updated, etc.
        /// </summary>
        public void UpdateCamera()
        {
            ScientificCamera camera = this.Scene.CurrentCamera;

            //if (camera.CameraType == CameraTypes.Perspecitive)
            {
                IPerspectiveViewCamera perspecitive = camera;
                perspecitive.AdjustCamera(this.modelContainer.BoundingBox, this.OpenGL);
            }
            //else if (camera.CameraType == CameraTypes.Ortho)
            {
                IOrthoViewCamera orthoCamera = camera;
                orthoCamera.AdjustCamera(this.modelContainer.BoundingBox, this.OpenGL);
            }
            //else
            {
                //throw new NotImplementedException();
            }

            //camera.Scale(-camera.scaleFactor);
            //// force CameraRotation to udpate.
            //this.CameraRotation.Camera = this.Scene.CurrentCamera;
            ManualRender(this);
        }