Click or drag to resize
AB4D logo

CameraUtils Class

CameraUtils class contains some helper methods to work with Ab3d.Cameras.
Inheritance Hierarchy
SystemObject
  Ab3d.UtilitiesCameraUtils

Namespace: Ab3d.Utilities
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.0.8746.1045
Syntax
C#
public static class CameraUtils

The CameraUtils type exposes the following members.

Methods
 NameDescription
Public methodStatic memberCalculateCameraAngles(Vector3D, Double, Double) Calculates heading and attitude angles in degrees from lookDirection as Vector3D.
Public methodStatic memberCalculateCameraAngles(Vector3D, Vector3D, Double, Double, Double) Calculates heading, attitude and bank angles in degrees from lookDirection and upDirection as Vector3D.
Public methodStatic memberCalculateCameraAnglesInRadians(Vector3D, Double, Double) Calculates heading and attitude angles in radians from lookDirection as Vector3D.
Public methodStatic memberCalculateCameraAnglesInRadians(Vector3D, Vector3D, Double, Double, Double) Calculates heading, attitude and bank angles in radians from lookDirection and upDirection as Vector3D.
Public methodStatic memberCalculateCameraDirections Returns the lookDirection and upDirection from the specified heading, attitude and bank (angles in degrees).
Public methodStatic memberCalculateUpDirection Calculates the up direction vector from look direction vector.
Public methodStatic memberGetClosestPathStartAngle Returns an adjusted start angle so that the path to the end angle will be the shortest.
Public methodStatic memberGetOrthographicScreenSize GetOrthographicScreenSize calculates a size on screen (in same units as size of Viewport3D.Width - without DPI scale) of a Size in 3D space (worldSize) that is shown with orthographic camera with cameraWidth and in Viewport3D with viewport3DSize.
Public methodStatic memberGetOrthographicWorldSize GetOrthographicWorldSize calculates a size in 3D world from a screen Size (screenSize in screen coordinates) that is at distanceFromCamera and shown with orthographic camera with cameraWidth and in Viewport3D with viewport3DSize.
Public methodStatic memberGetPerspectiveScreenSize GetPerspectiveScreenSize calculates a size on screen (in same units as size of Viewport3D.Width - without DPI scale) of a Size in 3D space (worldSize) that is at lookDirectionDistance and shown with perspective camera with fieldOfView and in Viewport3D with viewport3DSize.
Public methodStatic memberGetPerspectiveWorldSize GetPerspectiveWorldSize calculates a size in 3D world from a screen Size (screenSize in screen coordinates) that is at lookDirectionDistance and shown with perspective camera with fieldOfView and in Viewport3D with viewport3DSize.
Public methodStatic memberIsClockwiseRotation Returns true if the shortest direction from startAngle to endAngle is in clockwise direction. The angles are specified in degrees.
Public methodStatic memberNormalizeAngleTo180 Returns an angle that is normalized so that it is always in range from -180 to 180 degrees. For example 270 is converted into -90; -200 is converted into 160. To get an angle in range from 0 to 360, use the NormalizeAngleTo360(Double) method.
Public methodStatic memberNormalizeAngleTo360 Returns an angle that is normalized so that it is always in range from 0 to 360 degrees. For example -90 is converted into 270; 400 is converted into 40. To get an angle in range from -180 to 180, use the NormalizeAngleTo180(Double) method.
Top
See Also