Reference+
Name
resetMatrix()
Class
PShape
Description
Replaces the current matrix of a shape with the identity matrix. The equivalent function in OpenGL is glLoadIdentity().
Examples
PShape s; void setup() { size(100, 100); s = loadShape("ohio.svg"); s.rotate(PI/6); } void draw() { background(204); shape(s); } void mousePressed() { // Removes all transformations applied to shape // Loads the identity matrix s.resetMatrix(); }
Syntax
sh.resetMatrix()
Parameters
sh
(PShape)
any variable of type PShape
Return
void
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.