Skip to main content
Version: 3.5.x

Basis Permutation

The basis maps between Haply's internal coordinate system and your application's.

Haply default frame

Haply uses a right-handed coordinate system:

AxisDirection
+XRight
+YForward
+ZUp

How it works

A permutation string tells the service how your application's axes map to Haply's. Once set, every value the service returns (positions, velocities, forces, orientations) is expressed in your basis, and every value you send is interpreted in your basis. The conversion is automatic and bidirectional.

The string is a permutation of X, Y, Z, optionally prefixed by + or - to negate an axis.

Examples

PermutationMeaningTypical use
XYZIdentity — no remappingHaply-native apps
XZYSwap Y and Z → your +Y is upY-up engines
X-YZNegate Y → left-handed Z-upUnreal Engine
ZXYCycle all three axesCustom frame

Interpretation

"YZX" means:

  • Your X axis = Haply's Y (forward)
  • Your Y axis = Haply's Z (up)
  • Your Z axis = Haply's X (right)

Setting the basis

{
"session": {
"configure": {
"basis": { "permutation": "XZY" }
}
}
}

The basis is persistent — set it once on the first message and it stays active until changed or the session ends.

Migrating from session.set_basis

The axis-sign convention changed between the legacy session.set_basis and session.configure.basis. A permutation that worked under the old command may produce an inverted transformation under the new one. Negate the axis signs where needed (e.g., X-ZY becomes XZ-Y). See the Deprecation Note for details.