Py5Shape.reset_matrix()#

Replaces the current matrix of a shape with the identity matrix.

Examples#

 1def setup():
 2    global s
 3    s = py5.load_shape("bot.svg")
 4    s.rotate(py5.PI/6)
 5
 6
 7def draw():
 8    py5.background(204)
 9    py5.scale(0.2)
10    py5.shape(s, py5.width//2, py5.height//2)
11
12
13def mouse_pressed():
14    # removes all transformations applied to shape
15    # loads the identity matrix
16    s.reset_matrix()

Description#

Replaces the current matrix of a shape with the identity matrix. The equivalent function in OpenGL is gl_load_identity().

Underlying Processing method: PShape.resetMatrix

Syntax#

reset_matrix() -> None

Updated on November 12, 2021 11:30:58am UTC