The CoordinateSystemAPI provides methods to retrieve the current (right-handed) coordinate system's transformation matrix and its right,
up, and forward vectors.
All information are based on the front plane axis setting which defines the orientation of the
front plane of the model in the 3D space.
Quick Start
To read out the current coordinate system as well as the currently set front plane axis setting,
you can use the following code:
// Get the webvis contextconstwebvis = webvis.getContext();constcsMat = context.getCoordinateSystemMatrix();constfront = context.readSetting(webvis.SettingStrings.FRONT_PLANE_AXIS);// Print the current coordinate system matrix and the corresponding front plane axis.console.log('Front Plane Axis Setting:', front);console.log('Coordinate System Matrix (column-major):');console.table([ [csMat[0], csMat[4], csMat[8], csMat[12]], // First row [csMat[1], csMat[5], csMat[9], csMat[13]], // Second row [csMat[2], csMat[6], csMat[10], csMat[14]], // Third row [csMat[3], csMat[7], csMat[11], csMat[15]] // Fourth row]);
This function returns a 4x4 transformation matrix that transforms the default right-handed coordinate system,
where the x-axis points right, the y-axis points up, and the z-axis points forward (towards the viewer),
to a custom coordinate system defined by the front plane axis setting.
CoordinateSystemAPI
Overview
The
CoordinateSystemAPIprovides methods to retrieve the current (right-handed) coordinate system's transformation matrix and its right, up, and forward vectors. All information are based on the front plane axis setting which defines the orientation of the front plane of the model in the 3D space.Quick Start
To read out the current coordinate system as well as the currently set front plane axis setting, you can use the following code:
To change the transformations, change the front plane axis setting:
See