Class CameraExtensions
- Namespace
- HelixToolkit.Wpf.SharpDX
- Assembly
- HelixToolkit.Wpf.SharpDX.dll
Provides extension methods for the cameras.
public static class CameraExtensions
- Inheritance
-
CameraExtensions
- Inherited Members
Methods
ChangeDirection(Camera, Vector3D, Vector3D, double)
Changes the direction of a camera.
public static void ChangeDirection(this Camera camera, Vector3D newLookDir, Vector3D newUpDirection, double animationTime)
Parameters
cameraCameraThe camera.
newLookDirVector3DThe new look direction.
newUpDirectionVector3DThe new up direction.
animationTimedoubleThe animation time.
CopyTo(ICameraModel, Camera)
Copies the specified camera, converts field of view/width if necessary.
public static void CopyTo(this ICameraModel source, Camera dest)
Parameters
sourceICameraModelThe source camera.
destCameraThe destination camera.
CreateDefaultCamera()
Creates a default perspective camera.
public static Camera CreateDefaultCamera()
Returns
- Camera
A perspective camera.
FindPanVector(Camera, double, double)
Finds the pan vector.
public static Vector3D FindPanVector(this Camera camera, double dx, double dy)
Parameters
Returns
GetInfo(Camera)
Gets an information string about the specified camera.
public static string GetInfo(this Camera camera)
Parameters
cameraCameraThe camera.
Returns
- string
The get info.
GetInverseViewProjectionMatrix(CameraCore?, double)
Gets the inverse camera transform.
public static Matrix4x4 GetInverseViewProjectionMatrix(this CameraCore? camera, double aspectRatio)
Parameters
cameraCameraCoreThe camera.
aspectRatiodoubleThe aspect ratio.
Returns
- Matrix4x4
The inverse transform.
GetInverseViewProjectionMatrix3D(Camera, double)
Gets the inverse camera transform.
public static Matrix3D GetInverseViewProjectionMatrix3D(this Camera camera, double aspectRatio)
Parameters
Returns
- Matrix3D
The inverse transform.
GetInversedViewMatrix(CameraCore?)
public static Matrix4x4 GetInversedViewMatrix(this CameraCore? camera)
Parameters
cameraCameraCore
Returns
GetInversedViewMatrix(Camera)
public static Matrix3D GetInversedViewMatrix(this Camera camera)
Parameters
cameraCamera
Returns
GetProjectionMatrix(CameraCore?, double)
Gets the projection matrix for the specified camera.
public static Matrix4x4 GetProjectionMatrix(this CameraCore? camera, double aspectRatio)
Parameters
cameraCameraCoreThe camera.
aspectRatiodoubleThe aspect ratio.
Returns
- Matrix4x4
The projection matrix.
GetProjectionMatrix3D(Camera, double)
Gets the projection matrix for the specified camera.
public static Matrix3D GetProjectionMatrix3D(this Camera camera, double aspectRatio)
Parameters
Returns
- Matrix3D
The projection matrix.
GetViewMatrix(CameraCore?)
Obtains the view transform matrix for a camera. (see page 327)
public static Matrix4x4 GetViewMatrix(this CameraCore? camera)
Parameters
cameraCameraCoreCamera to obtain the ViewMatrix for
Returns
- Matrix4x4
A Matrix object with the camera view transform matrix, or a Matrix with all zeros if the "camera" is null.
GetViewMatrix3D(Camera)
Obtains the view transform matrix for a camera. (see page 327)
public static Matrix3D GetViewMatrix3D(this Camera camera)
Parameters
cameraCameraCamera to obtain the ViewMatrix for
Returns
- Matrix3D
A Matrix object with the camera view transform matrix, or a Matrix with all zeros if the "camera" is null.
GetViewProjectionMatrix(CameraCore?, double)
Get the combined view and projection transform
public static Matrix4x4 GetViewProjectionMatrix(this CameraCore? camera, double aspectRatio)
Parameters
cameraCameraCoreThe camera.
aspectRatiodoubleThe aspect ratio.
Returns
- Matrix4x4
The total view and projection transform.
GetViewProjectionMatrix3D(Camera, double)
Get the combined view and projection transform
public static Matrix3D GetViewProjectionMatrix3D(this Camera camera, double aspectRatio)
Parameters
Returns
- Matrix3D
The total view and projection transform.
LookAt(Camera, Point3D, double, double)
Set the camera target point and camera distance.
public static void LookAt(this Camera camera, Point3D target, double distance, double animationTime)
Parameters
cameraCameraThe camera.
targetPoint3DThe target point.
distancedoubleThe distance to the camera.
animationTimedoubleThe animation time.
LookAt(ICameraModel, Vector3, double)
public static void LookAt(this ICameraModel camera, Vector3 target, double animationTime)
Parameters
cameraICameraModeltargetVector3animationTimedouble
LookAt(ICameraModel, Point3D, double)
Set the camera target point without changing the look direction.
public static void LookAt(this ICameraModel camera, Point3D target, double animationTime)
Parameters
cameraICameraModelThe camera.
targetPoint3DThe target.
animationTimedoubleThe animation time.
LookAt(ICameraModel, Point3D, Vector3D, double)
Set the camera target point and look direction
public static void LookAt(this ICameraModel camera, Point3D target, Vector3D newLookDirection, double animationTime)
Parameters
cameraICameraModelThe camera.
targetPoint3DThe target.
newLookDirectionVector3DThe new look direction.
animationTimedoubleThe animation time.
LookAt(ICameraModel, Point3D, Vector3D, Vector3D, double)
Set the camera target point and directions
public static void LookAt(this ICameraModel camera, Point3D target, Vector3D newLookDirection, Vector3D newUpDirection, double animationTime)
Parameters
cameraICameraModelThe camera.
targetPoint3DThe target.
newLookDirectionVector3DThe new look direction.
newUpDirectionVector3DThe new up direction.
animationTimedoubleThe animation time.
MoveCameraPosition(Camera, Vector3D)
Moves the camera position.
public static void MoveCameraPosition(this Camera camera, Vector3D delta)
Parameters
Reset(Camera)
Resets the specified camera.
public static void Reset(this Camera camera)
Parameters
cameraCameraThe camera.
Reset(OrthographicCamera)
Resets the specified orthographic camera.
public static void Reset(this OrthographicCamera camera)
Parameters
cameraOrthographicCameraThe camera.
Reset(PerspectiveCamera)
Resets the specified perspective camera.
public static void Reset(this PerspectiveCamera camera)
Parameters
cameraPerspectiveCameraThe camera.
ToBoundingBox(Rect3D)
public static BoundingBox ToBoundingBox(this Rect3D bounds)
Parameters
boundsRect3D
Returns
ZoomExtents(Camera, Viewport3DX, BoundingBox, double)
Zooms to fit the specified bounding rectangle.
public static void ZoomExtents(this Camera camera, Viewport3DX viewport, BoundingBox bounds, double animationTime = 0)
Parameters
cameraCameraThe actual camera.
viewportViewport3DXThe viewport.
boundsBoundingBoxThe bounding rectangle.
animationTimedoubleThe animation time.
ZoomExtents(Camera, Viewport3DX, double)
Zooms to fit the extents of the specified viewport.
public static void ZoomExtents(this Camera camera, Viewport3DX viewport, double animationTime = 0)
Parameters
cameraCameraThe actual camera.
viewportViewport3DXThe viewport.
animationTimedoubleThe animation time.
ZoomExtents(Camera, Viewport3DX, Point3D, double, double)
Zooms to fit the specified sphere.
public static void ZoomExtents(this Camera camera, Viewport3DX viewport, Point3D center, double radius, double animationTime = 0)
Parameters
cameraCameraThe camera.
viewportViewport3DXThe viewport.
centerPoint3DThe center of the sphere.
radiusdoubleThe radius of the sphere.
animationTimedoubleThe animation time.
ZoomExtents(Camera, Viewport3DX, Rect3D, double)
Zooms to fit the specified bounding rectangle.
public static void ZoomExtents(this Camera camera, Viewport3DX viewport, Rect3D bounds, double animationTime = 0)
Parameters
cameraCameraThe actual camera.
viewportViewport3DXThe viewport.
boundsRect3DThe bounding rectangle.
animationTimedoubleThe animation time.
ZoomToRectangle(Camera, Viewport3DX, Rect)
Zooms the camera to the specified rectangle.
public static void ZoomToRectangle(this Camera camera, Viewport3DX viewport, Rect zoomRectangle)
Parameters
cameraCameraThe camera.
viewportViewport3DXThe viewport.
zoomRectangleRectThe zoom rectangle.