Ejemplo n.º 1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.rbOrthographic = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 2:
                this.rbPerspective = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 3:
                this.tbScaleX = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.tbScaleY = ((System.Windows.Controls.TextBox)(target));
                return;

            case 5:
                this.tbScaleZ = ((System.Windows.Controls.TextBox)(target));
                return;

            case 6:
                this.tbAngle = ((System.Windows.Controls.TextBox)(target));
                return;

            case 7:
                this.tbAxis = ((System.Windows.Controls.TextBox)(target));
                return;

            case 8:
                this.btnApply = ((System.Windows.Controls.Button)(target));

            #line 73 "..\..\CombineTransformation.xaml"
                this.btnApply.Click += new System.Windows.RoutedEventHandler(this.btnApply_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.myViewport = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 10:
                this.myCameraMatrix = ((System.Windows.Media.Media3D.MatrixCamera)(target));
                return;

            case 11:
                this.scaleTransform = ((System.Windows.Media.Media3D.ScaleTransform3D)(target));
                return;

            case 12:
                this.rotateTransform = ((System.Windows.Media.Media3D.RotateTransform3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 2
0
		/// <summary>
		/// Create a MatrixCamera from an existing ProjectionCamera
		/// </summary>
		/// <param name="camera">Camera</param>
		/// <param name="width">Viewport height</param>
		/// <param name="height">Viewport width</param>
		/// <param name="near">Near plane distance</param>
		/// <param name="far">Far plane distance</param>
		/// <returns>MatrixCamera</returns>
		public static MatrixCamera CreateMatrixCamera( ProjectionCamera camera, double width, double height, double near, double far )
		{
			MatrixCamera matrixCamera = new MatrixCamera(
				CreateViewMatrix( camera ),
				CreateProjectionMatrix( camera, width, height, near, far ) );
			matrixCamera.Transform = camera.Transform;

			return matrixCamera;
		}
Ejemplo n.º 3
0
		/// <summary>
		/// Create a MatrixCamera from an existing ProjectionCamera
		/// </summary>
		/// <param name="camera">Camera</param>
		/// <param name="width">Viewport height</param>
		/// <param name="height">Viewport width</param>
		/// <returns>MatrixCamera</returns>
		public static MatrixCamera CreateMatrixCamera( ProjectionCamera camera, double width, double height )
		{
			MatrixCamera matrixCamera = new MatrixCamera(
				CreateViewMatrix( camera ),
				CreateProjectionMatrix( camera, width, height, camera.NearPlaneDistance, camera.FarPlaneDistance ) );
			matrixCamera.Transform = camera.Transform;

			return matrixCamera;
		}
Ejemplo n.º 4
0
        private void SetMatrixCamera(object sender, EventArgs e)
        {
            //Define matrices for ViewMatrix and ProjectionMatrix properties.
            Matrix3D vmatrix = new Matrix3D(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
            Matrix3D pmatrix = new Matrix3D(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);

            MatrixCamera mCamera = new MatrixCamera(vmatrix, pmatrix);
            myViewport.Camera = mCamera;
        }
Ejemplo n.º 5
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.tbCameraPosition = ((System.Windows.Controls.TextBox)(target));
                return;

            case 2:
                this.tbLookDirection = ((System.Windows.Controls.TextBox)(target));
                return;

            case 3:
                this.tbUpDirection = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.tbNearPlane = ((System.Windows.Controls.TextBox)(target));
                return;

            case 5:
                this.tbFarPlane = ((System.Windows.Controls.TextBox)(target));
                return;

            case 6:
                this.tbWidth = ((System.Windows.Controls.TextBox)(target));
                return;

            case 7:
                this.btnApply = ((System.Windows.Controls.Button)(target));

            #line 53 "..\..\OrthographicProjection.xaml"
                this.btnApply.Click += new System.Windows.RoutedEventHandler(this.btnApply_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.myViewport = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 9:
                this.myCameraMatrix = ((System.Windows.Media.Media3D.MatrixCamera)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.tbM11 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 2:
                this.tbM21 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 3:
                this.tbM31 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.tbM41 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 5:
                this.tbM12 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 6:
                this.tbM22 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 7:
                this.tbM32 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 8:
                this.tbM42 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 9:
                this.tbM13 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 10:
                this.tbM23 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 11:
                this.tbM33 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 12:
                this.tbM43 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 13:
                this.tbM14 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 14:
                this.tbM24 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 15:
                this.tbM34 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 16:
                this.tbM44 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 17:
                this.rbOrthographic = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 18:
                this.rbPerspective = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 19:
                this.btnApply = ((System.Windows.Controls.Button)(target));

            #line 112 "..\..\MatrixTransformation.xaml"
                this.btnApply.Click += new System.Windows.RoutedEventHandler(this.btnApply_Click);

            #line default
            #line hidden
                return;

            case 20:
                this.myViewport = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 21:
                this.myCameraMatrix = ((System.Windows.Media.Media3D.MatrixCamera)(target));
                return;

            case 22:
                this.myTransform = ((System.Windows.Media.Media3D.MatrixTransform3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 7
0
		/// <summary>
		/// Get display matrix
		/// </summary>
		/// <param name="camera">Camera</param>
		/// <param name="width">Viewport width</param>
		/// <param name="height">Viewport height</param>
		/// <returns>Display matrix</returns>
		public static Matrix3D GetDisplayMatrix( MatrixCamera camera, double width, double height )
		{
			return ( camera.ViewMatrix * camera.ProjectionMatrix ) * GetHomogeneousToViewportTransform3D( width, height );
		}