iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x

Coordinates in 3D Space

In SciChart, there is a possibility to configure the coordinate system which will be used by renderers. Could be one of the following;

  • Left Handed Coordinate System
  • Right Handed Coordinate System

Be default SCIChartSurface3D renders 3D world using the Left-Handed coordinate system - LHS. In the Left-Handed coordinates X and Z Axes form the horizontal plane, and Y Axis is always up - YDirection = [0, 1, 0]. It is helpful to think of the 3D world as a 2D Chart with X and Y axes plus addition of Z-Axis which goes “into the screen”.

LHS rule 3D

Left-Handed Coordinates

SciChart also allows you to render SCIChartSurface3D world in Right-Handed coordinate system - RHS. It is easily switchable via the ISCIViewport3D.isLeftHandedCoordinateSystem property:

self.surface.viewport.isLeftHandedCoordinateSystem = NO;
self.surface.viewport.isLeftHandedCoordinateSystem = false
Surface.Viewport.IsLeftHandedCoordinateSystem = false;

World Coordinates

World Coordinates is the term used to describe coordinates in the 3D World. These are the raw [X, Y, Z] coordinates of a vertex. By default, the origin [0, 0, 0] is in the center of the bottom plane of the chart.

The box in the chart is called the AxisCube. The AxisCube size is defined by the SCIChartSurface3D.worldDimensions property, which is a single SCIVector3 with [X, Y, Z] sizes and defines the size of a cube as follows:

World Coordinates

Therefore, size of the AxisCube in [X, Y, Z] is extends like below:

Direction Extends like
X-Direction [-worldDimensions.x / 2; worldDimensions.x / 2]
Y-Direction [0; worldDimensions.y]
Z-Direction [-worldDimensions.z / 2; worldDimensions.z / 2]

NOTE: By default the SCIChartSurface3D.worldDimensions is initialized with [X = 300, Y = 200, Z = 300]

To change the SCIChartSurface3D.worldDimensions property, simply provide it with the SCIVector3 (3-component vector) like below:

[self.surface.worldDimensions assignX:200 y:200 z:200];
self.surface.worldDimensions.assignX(200, y: 200, z: 200)
Surface.WorldDimensions = new SCIVector3(200, 200, 200);

Data Coordinates

By contrast to the WorldCoordinates, which are absolute coordinates in the 3D World, in SciChart 3D there is the concept of Data Coordinates.

Data Coordinates are measured on an ISCIAxis3D instance, for example, the Y-Axis (which is UP) might have a size of 200 in the World Coordinates, but might display a VisibleRange of [0...10]. Therefore, Data which falls int he range [0...10] will be spaced on this axis from [0...200] World Coordinates.

The difference between World and Data Coordinates is shown in the following example:

World Coordinates

Converting from World to Data Coordinates

The conversion between Data Coordinates and World Coordinates is done by the ISCIAxis3D. It’s no different to 2D conversions which is described in the Axis APIs - Convert Pixel to Data coordinates article.

You can find simple example how to do the conversions for SCINumericAxis3D below.

id<ISCICoordinateCalculator> calculator = xAxis.currentCoordinateCalculator; float coordinate = [calculator getCoordinateFrom:1.2]; // Convert back: double dataValue = [calculator getDataValueFrom:coordinate];
let calculator = xAxis.currentCoordinateCalculator! let coordinate = calculator.getCoordinate(1.2) // Convert back: let dataValue = calculator.getDataValue(coordinate)
var coordinate = xAxis.GetCoordinate(1.2.FromComparable()); // Convert back: var dataValue = xAxis.GetDataValue(coordinate);