Open topic with navigation

# Coordinate Space API

## Detailed Description

Use these functions for operations that require coordinate space transformations.

## List of Functions
ZSError | zsGetCoordinateSpaceTransform (ZSHandle viewportHandle, ZSCoordinateSpace a, ZSCoordinateSpace b, ZSMatrix4* transform)
ZSError | zsTransformMatrix (ZSHandle viewportHandle, ZSCoordinateSpace a, ZSCoordinateSpace b, ZSMatrix4* matrix)
## List of Enumerations
enum | ZSCoordinateSpace { ZS_COORDINATE_SPACE_TRACKER = 0, ZS_COORDINATE_SPACE_DISPLAY = 1, ZS_COORDINATE_SPACE_VIEWPORT = 2, ZS_COORDINATE_SPACE_CAMERA = 3 }

## Function Descriptions

ZSError zsGetCoordinateSpaceTransform | ( | ZSHandle | viewportHandle,
|  | ZSCoordinateSpace | a,
|  | ZSCoordinateSpace | b,
|  | ZSMatrix4* | transform
| ) |  |

Gets the coordinate space transformation from space a to b.

Parameters:

  [in] | viewportHandle | A handle to the viewport.
  [in] | a | The source coordinate space.
  [in] | b | The destination coordinate space.
  [out] | transform | The transformation matrix in order to transform from space a to b.

ZSError zsTransformMatrix | ( | ZSHandle | viewportHandle,
|  | ZSCoordinateSpace | a,
|  | ZSCoordinateSpace | b,
|  | ZSMatrix4* | matrix
| ) |  |

Transforms a 4x4 transformation matrix from space a to b.

Parameters:

  [in] | viewportHandle | A handle to the viewport.
  [in] | a | The source coordinate space.
  [in] | b | The destination coordinate space.
  [in,out] | matrix | The input matrix to be transformed.

Example:

       // For this example, assume stylusHandle and viewportHandle
       // have been properly initialized.
       ZSHandle stylusHandle;
       ZSHandle viewportHandle;

       // Get the stylus tracker-space pose.
       ZSTrackerPose stylusPose;
       zsGetTargetPose(stylusHandle, &stylusPose);

       // Transform the stylus pose matrix from tracker-space to camera-space.
       zsTransformMatrix(viewportHandle,
                         ZS_COORDINATE_SPACE_TRACKER,
                         ZS_COORDINATE_SPACE_CAMERA,
                         &stylusPose.matrix);

## Enumeration Descriptions

enum ZSCoordinateSpace

Defines the coordinate spaces used by the zSpace Core SDK. This enum is used by both the Coordinate Space API and the Stereo Frustum API.

Enumerator:

  ZS_COORDINATE_SPACE_TRACKER |
  ZS_COORDINATE_SPACE_DISPLAY |
  ZS_COORDINATE_SPACE_VIEWPORT |
  ZS_COORDINATE_SPACE_CAMERA |

Open topic with navigation