Skip to main content

Matrix4

A recorded, replayable Matrix4 transform intent.

This class records constructors and mutating method calls, then Flet replays them in Flutter to build a real Matrix4 for flet.Transform.matrix.

Properties

  • ctor - Recorded constructor call.
  • ops - Ordered list of recorded mutating operations.

Methods

  • diagonal3_values - Creates a matrix initialized with diagonal scale values.
  • identity - Creates a matrix initialized with identity transform.
  • multiply - Appends multiplication by another recorded matrix.
  • rotate_x - Appends x-axis rotation operation in radians.
  • rotate_y - Appends y-axis rotation operation in radians.
  • rotate_z - Appends z-axis rotation operation in radians.
  • rotation_z - Creates a matrix initialized with a z-axis rotation in radians.
  • scale - Appends scale operation.
  • set_entry - Appends raw matrix entry mutation.
  • skew_x - Creates a matrix initialized with x-axis skew in radians.
  • skew_y - Creates a matrix initialized with y-axis skew in radians.
  • translate - Appends translation operation.
  • translation_values - Creates a matrix initialized with translation components.

Properties

ctorclass-attributeinstance-attribute

ctor: _Matrix4Call = field(default_factory=(lambda: _Matrix4Call(name='identity')))

Recorded constructor call.

opsclass-attributeinstance-attribute

ops: list[_Matrix4Call] = field(default_factory=list)

Ordered list of recorded mutating operations.

Methods

diagonal3_valuesclassmethod

diagonal3_values(cls, x: Number, y: Number, z: Number)

Creates a matrix initialized with diagonal scale values.

identityclassmethod

identity(cls)

Creates a matrix initialized with identity transform.

multiply

multiply(other: Matrix4)

Appends multiplication by another recorded matrix.

rotate_x

rotate_x(angle: Number)

Appends x-axis rotation operation in radians.

rotate_y

rotate_y(angle: Number)

Appends y-axis rotation operation in radians.

rotate_z

rotate_z(angle: Number)

Appends z-axis rotation operation in radians.

rotation_zclassmethod

rotation_z(cls, angle: Number)

Creates a matrix initialized with a z-axis rotation in radians.

scale

scale(x: Number, y: Optional[Number] = None, z: Optional[Number] = None)

Appends scale operation.

If only x is provided then uniform scale is used. If x and y are provided then 2D scale is used. If all three are provided then 3D scale is used.

set_entry

set_entry(row: int, col: int, value: Number)

Appends raw matrix entry mutation.

skew_xclassmethod

skew_x(cls, angle: Number)

Creates a matrix initialized with x-axis skew in radians.

skew_yclassmethod

skew_y(cls, angle: Number)

Creates a matrix initialized with y-axis skew in radians.

translate

translate(x: Number, y: Number, z: Number = 0)

Appends translation operation.

translation_valuesclassmethod

translation_values(cls, x: Number, y: Number, z: Number)

Creates a matrix initialized with translation components.