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 } |
ZSError zsGetCoordinateSpaceTransform | ( | ZSHandle | viewportHandle, |
ZSCoordinateSpace | a, | ||
ZSCoordinateSpace | b, | ||
ZSMatrix4* | transform | ||
) |
Gets the coordinate space transformation from space a to b.
[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.
[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. |
// 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);
enum ZSCoordinateSpace |