Click or drag to resize
DigitalRuneSceneHelperLookAt Method (SceneNode, Vector3F, Vector3F, Vector3F)
Moves and rotates the scene node so that it faces a certain direction (in world space).

Namespace: DigitalRune.Graphics.SceneGraph
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public static void LookAt(
	this SceneNode node,
	Vector3F position,
	Vector3F target,
	Vector3F upVector
)

Parameters

node
Type: DigitalRune.Graphics.SceneGraphSceneNode
The scene node.
position
Type: DigitalRune.Mathematics.AlgebraVector3F
The new position in world space.
target
Type: DigitalRune.Mathematics.AlgebraVector3F
The target coordinates in world space at which the scene node is "looking".
upVector
Type: DigitalRune.Mathematics.AlgebraVector3F
The direction that is "up" from the scene node's point of view given in world space. (Does not need to be normalized.)

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type SceneNode. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionnode is .
ArgumentExceptionposition is the same as target.
ArgumentExceptionupVector is (0, 0, 0).
DivideByZeroException The camera direction (target - position) is probably pointing in the same or opposite direction as upVector. (The two vectors must not be parallel.)
Remarks
A scene node uses the same coordinate system as the XNA Framework: By default, the positive x-axis points to the right, the positive y-axis points up, and the positive z-axis points towards the viewer. This method moves the scene node to position and rotates it so that its local forward direction (0, 0, -1) is pointing towards target.
See Also