p5.js resetMatrix() Function
The resetMatrix() function is used to replace the current matrix with the identity matrix (The square matrix whose all values are zero except diagonal which is 1). When we are rotating, translating, and scaling any graphics image using applyMatrix() then by applying the function resetMatrix() we can change the graphics to its original form.
Below are the examples to illustrate the resetMatrix() function.
Step 1: Open online web editor https://editor.p5js.org/.
Step 2: Write the following code and run to see the output.