Skip to content

Documentation / loaders / convertStrandUpAxis

Function: convertStrandUpAxis()

convertStrandUpAxis(positions, upAxis): Float32Array

Defined in: libs/loaders/src/curves/upaxis.ts:40

Rotates control points from upAxis into the engine's Y-up frame, in place.

Parameters

positions

Float32Array

Control point positions, 3 floats per point, modified in place.

upAxis

StrandUpAxis

Up axis the positions are currently expressed in.

Returns

Float32Array

The same array, for convenience.

Remarks

Z-up becomes Y-up by a -90 degree rotation about X, (x, y, z) to (x, z, -y) - the same convention glTF uses for Z-up authoring tools. It is a rotation rather than an axis swap, so the determinant stays positive and triangle winding is unaffected.

Released under the MIT License.