reset_matrix()

Replaces the current matrix with the identity matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
def setup():
    py5.size(100, 100, py5.P3D)
    py5.no_fill()
    py5.box(80)
    py5.print_matrix()
    # prints:
    # 01.0000  00.0000  00.0000 -50.0000
    # 00.0000  01.0000  00.0000 -50.0000
    # 00.0000  00.0000  01.0000 -86.6025
    # 00.0000  00.0000  00.0000  01.0000

    py5.reset_matrix()
    py5.box(80)
    py5.print_matrix()
    # prints:
    # 1.0000  0.0000  0.0000  0.0000
    # 0.0000  1.0000  0.0000  0.0000
    # 0.0000  0.0000  1.0000  0.0000
    # 0.0000  0.0000  0.0000  1.0000

Description

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

Underlying Java method: resetMatrix

Syntax

reset_matrix() -> None

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