다음을 통해 공유


Matrix.LookAtLH 메서드

업데이트: 2007년 11월

왼쪽 보기 매트릭스를 만듭니다.

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

구문

‘선언
Public Shared Function LookAtLH ( _
    cameraPosition As Vector3, _
    cameraTarget As Vector3, _
    cameraUpVector As Vector3 _
) As Matrix
‘사용 방법
Dim cameraPosition As Vector3
Dim cameraTarget As Vector3
Dim cameraUpVector As Vector3
Dim returnValue As Matrix

returnValue = Matrix.LookAtLH(cameraPosition, _
    cameraTarget, cameraUpVector)
public static Matrix LookAtLH(
    Vector3 cameraPosition,
    Vector3 cameraTarget,
    Vector3 cameraUpVector
)
public:
static Matrix LookAtLH(
    Vector3 cameraPosition, 
    Vector3 cameraTarget, 
    Vector3 cameraUpVector
)
public static function LookAtLH(
    cameraPosition : Vector3, 
    cameraTarget : Vector3, 
    cameraUpVector : Vector3
) : Matrix

매개 변수

반환 값

형식: Microsoft.WindowsMobile.DirectX.Matrix

왼쪽 보기 매트릭스인 Matrix 구조체입니다.

설명

이 메서드에서는 다음 수식을 사용하여 반환되는 매트릭스를 계산합니다.

zaxis = normal(cameraTarget - cameraPosition)
xaxis = normal(cross(cameraUpVector, zaxis))
yaxis = cross(zaxis, xaxis)
 xaxis.x           yaxis.x           zaxis.x          0
 xaxis.y           yaxis.y           zaxis.y          0
 xaxis.z           yaxis.z           zaxis.z          0
-dot(xaxis, cameraPosition)  -dot(yaxis, cameraPosition)  -dot(zaxis, cameraPosition)  1

예제

다음 예제에서는 LookAtLH 메서드를 사용하는 방법을 보여 줍니다. 이 예제는 Windows SDK(소프트웨어 개발 키트)의 Direct3D 모바일 매트릭스 샘플에서 가져온 것입니다.

' 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))
// 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));

권한

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

플랫폼

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에서 지원

참고 항목

참조

Matrix 구조체

Matrix 멤버

Microsoft.WindowsMobile.DirectX 네임스페이스