Click or drag to resize
AB4D logo

BaseCameraCreateOrthographicMouseRay3D Method

CreateOrthographicMouseRay3D is used for orthographic camera and calculates a normalized 3D ray that goes from the mouse position into the 3D scene for an Orthographic camera. The ray goes from rayOrigin in the rayDirection. If the ray cannot be calculated this method returns false. For perspective camera use CreatePerspectiveMouseRay3D(Point, Size, Matrix3D, Matrix3D, Point3D, Vector3D) or use non-static CreateMouseRay3D(Point, Point3D, Vector3D) method.

Namespace: Ab3d.Cameras
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.0.8746.1045
Syntax
C#
public static void CreateOrthographicMouseRay3D(
	Point mousePosition,
	Size viewportSize,
	Point3D cameraPosition,
	Vector3D lookDirection,
	Vector3D upDirection,
	double cameraWidth,
	double nearPlaneDistance,
	out Point3D rayOrigin,
	out Vector3D rayDirection
)

Parameters

mousePosition  Point
mouse position
viewportSize  Size
viewport size - usually size of Viewport3D (AvailableWidth, AvailableHeight)
cameraPosition  Point3D
position of the camera
lookDirection  Vector3D
camera's look direction vector (no need to be normalized)
upDirection  Vector3D
camera's up direction vector (no need to be normalized)
cameraWidth  Double
width of the orthographic camera
nearPlaneDistance  Double
near plane distance
rayOrigin  Point3D
out - ray origin
rayDirection  Vector3D
out - normalized ray direction
See Also