Table of Contents

Enum OrientationModes

Namespace
LightningChartLib.WinForms.Charting
Assembly
LightningChart.WinForms.Charting.NET4.dll

Camera orientation / rotation interpretation types, giving meaning for RotationX, RotationY and RotationZ settings and their calculation order, thus affecting camera position and orientation. See remarks for generic information on camera placement and orientation. See different enumeration values and OrientationMode property for more information on available options, their usage and effects.

public enum OrientationModes

Fields

XYZ_Mixed = 0

XYZ Mixed mode orientation interpretation.

Camera position is defined as X-Y extrinsic rotation and camera up direction by world Z-axis rotation.

This was the only available angle property interpretation used in LC up to version 8.3.

This interpretation has some problematic features and will be deprecated in the future. It's highly suggested to move using ZXY_Extrinsic interpretation. See Remarks for more information

Orientation explanation

Defines camera position against Target property using left hand X-Y extrinsic rotation and rotating camera in-place around world Z-axis.

Camera looking direction is defined by rotating camera first on around world X-axis by RotationX degrees, and then around world Y-axis by RotationY degrees.

Camera position is calculated based on this orientation, so that the camera is placed so that it looks on the defined Target.

Camera is then rotated in-place around world Z-axis by RotationZ degrees.

In effect the camera RotationZ changes only the cameras up-direction.

Rotations use left-hand rule, meaning that positive angle causes rotation of the camera Counter-Clockwise when looking along rotation axis from negative to positive.

As the camera target is at the looking direction from camera, the camera is at opposite direction from the target. One can think as the angles defining the camera position as well, but the rotation angles are opposite.

Orientation feeling

X and Y rotations feel quite natural, but with Z-rotation it feels weird, especially from certain angles.

Problems

As the rotation is done around world Z-axis, the horizontal camera rotation axis stays on world X-Y plane.

1. The rotation settings does not allow certain orientations.

2. The orientation is not defined if the cameras up direction is parallel to the cameras view direction. At these situations we use a fallback system for calculating the camera orientation. This orientation might differ from the expected one. A ChartMessage warning of type ProblematicCameraOrientation is raised on these situations.

It is preferred to use some other angle interpretation mode to prevent the problems.

User device based rotations

When user rotates camera using mouse or some other pointer device, the orientation changes differently on different orientation modes.

Rotation can be separated to two parts, vertical and horizontal, based on the movement of the pointer device.

Vertical rotation is done on seen views horizon - around cameras "right" direction - and affects camera elevation.

Horizontal rotation is done around rotation up direction, that is only affected by set RotationZ property, that is not really affected by user device based rotation, expect by reversing it when the view crosses the rotation up direction pole.

The rotation up direction is defined as explained before on the Orientation explanation part.

Versions

This orientation mode has been available always and the default until v8.4. User device rotation has acted like this from version 7.0 forwards.

ZXY_Extrinsic = 1

Remarks

Camera positioning / orientation

Camera orientation and position is controlled by multiple different properties.

TargetDefines the location in world coordinates the camera looks at. This location will be at the center of the rendered image.
ViewDistanceDistance of the camera from the Target in world coordinates.

In effect defines how large an area is seen, together with FieldOfViewAngle. Modified on zooming operations.

RotationX, RotationY and RotationZDefines the orientation and thus in effect the position of the camera. Effect of the properties varies based on selected OrientationMode.

Rotation(XYZ) properties define the orientation of the camera. After this the camera is placed so that the Target is in the center of the view, at ViewDistance away of it.

User device based rotations

When user rotates camera using mouse or some other pointer device the orientation changes differently on different orientation modes. Especially horizontal rotation is done around a separate axis, that changes differently on different orientation modes. See different modes for detailed explanation on the rotation differences.

Terminology reference

Similar terminology as in Wikipedia is used in this documentation.
IntrinsicDefines orientation as rotations from starting orientation in specific order so that every rotations is done around previously rotated cameras axes, not the world axes.
ExtrinsicDefines orientation as rotations from starting orientation in specific order so that every rotations is done on original world axes, not the changed cameras axes.
y-x'-z''Small letters indicate intrinsic rotations, at the order they are stated.

y' is the rotation around objects Y-axis, done first.

x' is the rotation around objects X-axis, after the first rotation.

z'' is the rotation around objects Z-axis, after the first two rotations.

Z-X-YCapital letters indicate extrinsic rotations, at the order they are stated. All rotations are done around matching world axes.
Camera up directionThe camera and it's position / orientation defines what is seen on the rendered view. Camera position / orientation is mostly defined by RotationX and RotationY properties, especially if RotationZ is zero. Camera can however be rotated around it's looking direction, affecting the view. This orientation is defined by camera up vector, a vector that defines what way is up for the cameras view.

There is no accessible property like this, but it's referenced as a concept.

Horizontal rotation axisWhen camera is rotated by user device, like mouse, new camera orientation is calculated, affecting multiple of the rotation properties. Vertical rotation always affects the camera same way, rotating the view direction around current cameras right direction (X axis).

Horizontal rotation however has its own rotation axis defined. It's not directly readable or settable, but referenced on different parts of documentation and automatically determined based on different orientation settings. Sometimes this is referenced as rotation up direction.

Extra information

For generic information on orientation definition through angles, see Wikipedia article on Euler and Tait-Bryan angles https://en.wikipedia.org/wiki/Euler_angles.