次の方法で共有


Matrix.LookAtLH メソッド

[このドキュメントはプレビュー版であり、後のリリースで変更されることがあります。 空白のトピックは、プレースホルダーとして挿入されています。]

左手座標系ビュー行列を作成します。

名前空間:  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
)
static member 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 Software Development Kit (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));

.NET Framework セキュリティ

プラットフォーム

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

.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。 サポートされているバージョンについては、「.NET フレームワークのシステム要件」を参照してください。

バージョン情報

.NET Compact Framework

サポート対象 : 3.5、2.0

参照

参照

Matrix 構造体

Matrix メンバー

Microsoft.WindowsMobile.DirectX 名前空間