Py5Graphics.set_matrix()

Set the current matrix to the one specified through the parameter source.

Description

Set the current matrix to the one specified through the parameter source. Inside the Processing code it will call Py5Graphics.reset_matrix() followed by Py5Graphics.apply_matrix(). This will be very slow because Py5Graphics.apply_matrix() will try to calculate the inverse of the transform, so avoid it whenever possible.

This method is the same as set_matrix() but linked to a Py5Graphics object. To see example code for how it can be used, see set_matrix().

Underlying Java method: PGraphics.setMatrix

Syntax

set_matrix(source: NDArray[(2, 3), Float], /) -> None
set_matrix(source: NDArray[(4, 4), Float], /) -> None

Parameters

  • source: NDArray[(2, 3), Float] - transformation matrix data

  • source: NDArray[(4, 4), Float] - transformation matrix data

Updated on September 11, 2021 16:51:34pm UTC