Folds a transformation into the one matrix that does all its steps in order.
The lists rotationCenterAxis and the other builders return become a single matrix, which is
what a renderer or a placement often wants. An empty list gives the identity.
Example: a move by [1,0,0] followed by a move by [0,2,0] -> one move by [1,2,0]
The transformation: a matrix, or a list applied in order
A list holding the one combined matrix
Builds the transformation that undoes one that only moves and turns.
The transformation is combined first. One that scales, stretches or mirrors is refused, since
undoing it exactly takes a general inverse; isRigid tells the two apart.
Example: a quarter turn about Z, then a move by [10,0,0] -> the move back, then the turn back
The transformation: a matrix, or a list applied in order
A list holding the one matrix that undoes it
Measures how a transformation scales volumes, and whether it mirrors.
It is the determinant of the combined matrix's turn-and-scale part: 1 for a move and turn, the volume factor for a scale, negative when the transformation mirrors. Example: a uniform scale by 2 -> 8
The transformation: a matrix, or a list applied in order
The determinant
Tells whether a transformation only moves and turns, without scaling, stretching or mirroring.
The transformation is combined first; each of its axes must have length 1 and stand square to
the others within tolerance.
Example: a rotation -> true, a scale by 2 -> false
The transformation and the tolerance
True when it is a rigid motion
Gives the matrix that changes nothing, as a starting point or a placeholder.
Example: [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1]
The identity matrix
Builds a quaternion that turns about an axis by an angle in degrees, positive counter-clockwise when the axis points toward you.
A quaternion holds a rotation as four numbers with none of the gimbal lock of three angles; glTF and the renderers store rotations this way. Example: axis [0,0,1], angle 90 -> [0, 0, 0.7071, 0.7071]
The axis and the angle in degrees
The rotation as [x, y, z, w]
Builds a quaternion from three angles in degrees: a turn about the X axis, then about Y, then
about Z, each about the fixed world axes, as rotationCenterX, rotationCenterY and
rotationCenterZ applied in that order.
Example: [0, 0, 90] -> [0, 0, 0.7071, 0.7071]
The angles about X, Y and Z
The rotation as [x, y, z, w]
Reads a quaternion back as the three angles in degrees that quaternionFromEuler takes,
about X, then Y, then Z.
Y stays between -90 and 90. Within a ten-thousandth of a degree of either end, X and Z turn about one line, so X is 0 and Z takes the whole turn. Example: [0, 0, 0.7071, 0.7071] -> [0, 0, 90]
The rotation
The angles about X, Y and Z
Combines two rotations into the one that turns by first and then by second.
Order matters: turning about X then Z differs from turning about Z then X. Example: a quarter turn about X, then a quarter turn about Z -> one rotation doing both
The rotation applied first and the one applied after it
The combined rotation as [x, y, z, w]
Turns a vector, or a point about the origin, by a rotation.
Example: [1, 0, 0] turned by a quarter turn about Z -> [0, 1, 0]
The rotation and the vector
The turned vector
Gives the rotation that turns the world axes onto a frame's: X onto its direction and Z onto its normal. The origin is left out.
The direction is squared to the normal first, so a rough direction is enough. Example: normal [0,0,1], direction [0,1,0] -> a quarter turn about Z
The frame
The rotation as [x, y, z, w]
Writes a rotation as the transformation matrix the other methods here build, so it can be
applied with point.transformPoints or combined with moves.
Example: a quarter turn about Z -> the matrix that takes [1,0,0] to [0,1,0]
The rotation
The matrix, 16 numbers in column-major order
Builds a rotation about an axis that passes through a center point.
The result is three matrices applied in order: move the center to the origin, rotate, move back. The angle is in degrees; positive turns counter-clockwise when the axis points toward you. Example: center [5,0,0], axis [0,1,0], angle 90 -> a quarter turn about the vertical line through [5,0,0]
The axis direction, the center it passes through and the angle in degrees
The list of matrices to apply in order
Builds a rotation about a line parallel to the X axis through a center point.
The result is three matrices applied in order: move the center to the origin, rotate, move back. The angle is in degrees; positive turns counter-clockwise when the axis points toward you. Example: center [0,0,0], angle 90 -> a quarter turn about the X axis
The center and the angle in degrees
The list of matrices to apply in order
Builds a rotation about a line parallel to the Y axis through a center point.
The result is three matrices applied in order: move the center to the origin, rotate, move back. The angle is in degrees; positive turns counter-clockwise when the axis points toward you. Example: center [0,0,0], angle 90 -> a quarter turn about the Y axis
The center and the angle in degrees
The list of matrices to apply in order
Builds a rotation about a line parallel to the Z axis through a center point.
The result is three matrices applied in order: move the center to the origin, rotate, move back. The angle is in degrees; positive turns counter-clockwise when the axis points toward you. Example: center [0,0,0], angle 90 -> a quarter turn about the Z axis
The center and the angle in degrees
The list of matrices to apply in order
Builds a rotation from three angles about a center point: yaw turns about Y, pitch about X and roll about Z.
The result is three matrices applied in order: move the center to the origin, rotate, move back. Angles are in degrees. Example: yaw 90, pitch 0, roll 0 -> a quarter turn about the vertical axis
The yaw, pitch and roll in degrees and the center
The list of matrices to apply in order
Builds a scale with its own factor per axis, measured from a center point that stays in place.
The result is three matrices applied in order: move the center to the origin, scale, move back. Example: center [5,5,5], factors [2,1,0.5] -> doubles X, keeps Y, halves Z about [5,5,5]
The center and the factor for each axis
The list of matrices to apply in order
Builds a scale with its own factor per axis, measured from the origin.
Example: factors [2,3,1] -> doubles X, triples Y, keeps Z
The factor for each axis
A list with the one scale matrix
Builds a stretch along one direction, measured from a center point; distances across that direction stay as they are.
The result is three matrices applied in order: move the center to the origin, stretch, move back. Example: center [0,0,0], direction [1,0,0], scale 2 -> everything twice as far from the center along X
The center, the direction and the factor
The list of matrices to apply in order
Builds a scale by the same factor on every axis, measured from the origin.
Example: 2 -> everything twice as big and twice as far from the origin
The factor
A list with the one scale matrix
Builds a scale by the same factor on every axis, measured from a center point that stays in place.
The result is three matrices applied in order: move the center to the origin, scale, move back. Example: center [5,5,5], scale 0.5 -> everything half as big, shrinking toward [5,5,5]
The factor and the center
The list of matrices to apply in order
Builds a move by a vector.
Example: [10,5,0] -> 10 along X, 5 along Y, nothing along Z
The vector to move by
A list with the one translation matrix
Builds one move per vector, for transforming many points each by its own vector.
Example: [[1,0,0], [0,2,0]] -> two transformations: one along X, one along Y
The vectors to move by
One transformation per vector, in the same order
Builds transformation matrices for moving, rotating, scaling and stretching geometry. A transformation is a 4x4 matrix as 16 numbers in column-major order; most methods return a short list of them that is applied in order, so a rotation about a point is a move to the origin, the rotation, and the move back. Angles are in degrees. Such a list can also be combined into one matrix, undone, and read for whether it keeps shapes rigid. Apply the result with the transform methods of
point,polyline,lineand the kernels.