Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

MatrixTransform3D Class

Creates a transformation specified by a Matrix3D, used to manipulate objects or coordinate systems in 3-D world space.

Namespace: System.Windows.Media.Media3D
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public sealed class MatrixTransform3D : Transform3D
public final class MatrixTransform3D extends Transform3D
public final class MatrixTransform3D extends Transform3D
<MatrixTransform3D .../>

A 4x4 matrix is used for three-dimensional transformations. When a point is multiplied by a matrix (P1 * M1), the point is transformed from its previous coordinate system to a new coordinate system.

    try
    {
        Double setM11 = System.Convert.ToDouble(M11Text.Text);
        Double setM21 = System.Convert.ToDouble(M21Text.Text);
        Double setM31 = System.Convert.ToDouble(M31Text.Text);
        Double setOffsetX = System.Convert.ToDouble(OffsetXText.Text);

        Double setM12 = System.Convert.ToDouble(M12Text.Text);
        Double setM22 = System.Convert.ToDouble(M22Text.Text);
        Double setM32 = System.Convert.ToDouble(M32Text.Text);
        Double setOffsetY = System.Convert.ToDouble(OffsetYText.Text);

        Double setM13 = System.Convert.ToDouble(M13Text.Text);
        Double setM23 = System.Convert.ToDouble(M23Text.Text);
        Double setM33 = System.Convert.ToDouble(M33Text.Text);
        Double setOffsetZ = System.Convert.ToDouble(OffsetZText.Text);

        Double setM14 = System.Convert.ToDouble(M14Text.Text);
        Double setM24 = System.Convert.ToDouble(M24Text.Text);
        Double setM34 = System.Convert.ToDouble(M34Text.Text);
        Double setM44 = System.Convert.ToDouble(M44Text.Text);

    endMatrix3D = new Matrix3D(setM11, setM12, setM13, setM14, setM21, setM22, setM23, setM24, setM31, setM32, setM33, setM34, setOffsetX, setOffsetY, setOffsetZ, setM44);

    myMatrixTransform3D.Matrix = endMatrix3D;
}
catch
{
    MessageBox.Show("Set Matrix3D values or rotation values before transforming");
}


System.Object
   System.Windows.Threading.DispatcherObject
     System.Windows.DependencyObject
       System.Windows.Freezable
         System.Windows.Media.Animation.Animatable
           System.Windows.Media.Media3D.Transform3D
            System.Windows.Media.Media3D.MatrixTransform3D
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.