Contents

matrix4x4f::transformPosition

Transforms a position by a 4x4 matrix, including translation.

Declaration

float3 matrix4x4f::transformPosition(float4x4 matrix, float3 position)

Parameters

  • matrix:

    The 4x4 transformation matrix to apply.

  • position:

    The 3D position to transform.

Return Value

The transformed 3D position.

Discussion

Multiplies the position by the matrix with a w component of 1.0, so rotation, scale, and translation are all applied. This is appropriate for points in space that should be fully transformed by the matrix.