Py5Shape.reset_matrix()

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
def setup():
    global s
    s = py5.load_shape("bot.svg")
    s.rotate(py5.PI/6)


def draw():
    py5.background(204)
    py5.scale(0.2)
    py5.shape(s, py5.width//2, py5.height//2)


def mouse_pressed():
    # removes all transformations applied to shape
    # loads the identity matrix
    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 Java method: PShape.resetMatrix

Syntax

reset_matrix() -> None

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