packages/Windows API Code Pack 1.1/source/Samples/DirectX/CS/UtilitiesLibrary/D3DUtilities/Math/MatrixUtilities.cs
/// <summary>
/// Returns the world*perspective matrix for the camera
/// </summary>
/// <param name="camera">The WPF camera</param>
/// <param name="aspectRatio">The aspect ratio of the device surface</param>
/// <returns></returns>
Returns the world*perspective matrix for the camera
Returns the world * perspective matrix for the camera
public static Matrix3D ToMatrix3DLH( this PerspectiveCamera camera, double aspectRatio )
        {
            Transform3DGroup tg = new Transform3DGroup( );
            tg.Children.Add(new MatrixTransform3D(GetLookAtMatrixLH(camera)));
            tg.Children.Add(camera.Transform);
            tg.Children.Add(new MatrixTransform3D(GetPerspectiveMatrixLH(camera, aspectRatio)));
            return tg.Value;
        }
public static Matrix3D ToMatrix3DLH ( this PerspectiveCamera camera , double aspectRatio ) { Transform3DGroup tg = new Transform3DGroup ( ) ; tg . Children . Add ( new MatrixTransform3D ( GetLookAtMatrixLH ( camera ) ) ) ; tg . Children . Add ( camera . Transform ) ; tg . Children . Add ( new MatrixTransform3D ( GetPerspectiveMatrixLH ( camera , aspectRatio ) ) ) ; return tg . Value ; }
Returns the world*perspective matrix for the camera
Returns the world * perspective matrix for the camera
None
PerspectiveCamera
this
aspectRatio
double
The aspect ratio of the device surface
The aspect ratio of the device surface
camera
The WPF camera
The WPF camera