다음을 통해 공유


Device.Transform 속성

업데이트: 2007년 11월

변환 상태를 설명하는 매트릭스를 가져옵니다.

네임스페이스:  Microsoft.WindowsMobile.DirectX.Direct3D
어셈블리:  Microsoft.WindowsMobile.DirectX(Microsoft.WindowsMobile.DirectX.dll)

구문

‘선언
Public ReadOnly Property Transform As Transforms
‘사용 방법
Dim instance As Device
Dim value As Transforms

value = instance.Transform
public Transforms Transform { get; }
public:
property Transforms^ Transform {
    Transforms^ get ();
}
public function get Transform () : Transforms

속성 값

형식: Microsoft.WindowsMobile.DirectX.Direct3D.Transforms

반환된 변환 상태를 설명하는 Transforms 구조체입니다.

예외

예외 상황
InvalidCallException

메서드 호출이 잘못된 경우. 예를 들어 매개 변수에 잘못된 값이 포함되어 있을 수 있습니다.

예제

다음 코드에서는 Transform 속성을 사용하는 방법을 보여 줍니다.

' This code example is from the Direct3D Mobile Matrices Sample
' in the .NET Compact Framework Samples in the SDK.
Private Sub SetupMatrices()
    ' For the world matrix, rotate the object about the y-axis.
    ' Set up the rotation matrix to generate one full rotation (2*PI radians) 
    ' every 1000 ms. To avoid the loss of precision inherent in very high 
    ' floating-point numbers, the system time is modulated by the rotation 
    ' period before conversion to a radian angle.
    Dim iTime As Integer = Environment.TickCount Mod 1000
    Dim fAngle As Single = iTime * (2.0F * System.Convert.ToSingle(Math.PI)) / 1000.0F
    device.Transform.World = Matrix.RotationY(fAngle)
    ' Set up the view matrix. A view matrix can be defined given an eye point,
    ' a point to lookat, and a direction indicating which way is up. Here, you set
    ' the eye five units back along the z-axis and up three units, look at the
    ' origin, and define "up" to be in the y-direction.
    device.Transform.View = Matrix.LookAtLH(New Vector3(0.0F, 3.0F, -5.0F), New Vector3(0.0F, 0.0F, 0.0F), New Vector3(0.0F, 1.0F, 0.0F))
    ' For the projection matrix, set up a perspective transform (which
    ' transforms geometry from 3-D view space to 2-D viewport space, with
    ' a perspective divide making objects smaller in the distance). To build
    ' a perspective transform, you need the field of view (1/4 PI is common),
    ' the aspect ratio, and the near and far clipping planes (which define
    ' the distances at which geometry should no longer be rendered).
    device.Transform.Projection = Matrix.PerspectiveFovLH(System.Convert.ToSingle(Math.PI) / 4, 1.0F, 1.0F, 100.0F)
End Sub
// This code example is from the Direct3D Mobile Matrices Sample
// in the .NET Compact Framework Samples in the SDK.
private void SetupMatrices()
{
    // For the world matrix, rotate the object about the y-axis.

    // Set up the rotation matrix to generate one full rotation (2*PI radians)
    // every 1000 ms. To avoid the loss of precision inherent in very high
    // floating-point numbers, the system time is modulated by the rotation
    // period before conversion to a radian angle.
    int iTime = Environment.TickCount % 1000;
    float fAngle = iTime * (2.0f * (float)Math.PI) / 1000.0f;
    device.Transform.World = Matrix.RotationY(fAngle);
    // Set up the view matrix. A view matrix can be defined given an eye point,
    // a point to look at, and a direction indicating which way is up. Here, you set
    // the eye five units back along the z-axis and up three units, look at the
    // origin, and define "up" to be in the y-direction.
    device.Transform.View = Matrix.LookAtLH(new Vector3(0.0f, 3.0f, -5.0f), new Vector3(0.0f, 0.0f, 0.0f), new Vector3(0.0f, 1.0f, 0.0f));
    // For the projection matrix, set up a perspective transform (which
    // transforms geometry from 3-D view space to 2-D viewport space, with
    // a perspective divide making objects smaller in the distance). To build
    // a perspective transform, you need the field of view (1/4 PI is common),
    // the aspect ratio, and the near and far clipping planes (which define
    // the distances at which geometry should no longer be rendered).
    device.Transform.Projection = Matrix.PerspectiveFovLH((float)Math.PI / 4, 1.0f, 1.0f, 100.0f);
}

권한

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

플랫폼

Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Compact Framework

3.5, 2.0에서 지원

참고 항목

참조

Device 클래스

Device 멤버

Microsoft.WindowsMobile.DirectX.Direct3D 네임스페이스