a port of the Processing Visualization Language
Name

pushMatrix()

Examples
example pic
rect(0, 0, 50, 50);   //White rectangle 

pushMatrix(); 

translate(30, 20); 

fill(0);  

rect(0, 0, 50, 50);   //Black rectangle 

popMatrix(); 

fill(102);  

rect(15, 10, 50, 50); //Gray rectangle
Description Pushes the current transformation matrix onto the matrix stack. Understanding pushMatrix() and popMatrix() requires understanding the concept of a matrix stack. The pushMatrix() function saves the current coordinate system to the stack and popMatrix() restores the prior coordinate system. pushMatrix() and popMatrix() are used in conjuction with the other transformation methods and may be embedded to control the scope of the transformations.
Syntax
pushMatrix()
Parameters
Usage Web & Application
Related popMatrix()
translate()
rotate()
rotateX()
rotateY()
rotateZ()

This reference is licensed under the CC BY-NC-SA 2.0 license:

Creative Commons License
Fork me on GitHub