We are about to switch to a new forum software. Until then we have removed the registration on this forum.
The reference page for pushMatrix() states
that Understanding pushMatrix() and popMatrix() requires understanding the concept of a matrix stack.
Where can I learn more about matrix stacks?
Answers
one of the tutorials
http://www.processing.org/tutorials/transform2d/
see section The Transformation Matrix - or read the whole thing
;-)
In my opinion matrices as applied to computer graphics and stacks can be thought of as two completely separate concepts.
By default, units are 1 pixel, the x-axis is horizontal, the y-axis is vertical, and the origin is at the top left of the window. There are matrix transformations to change this:
Any single matrix can have these transformations applied to it. It is worth noting that these transformations do not change the actual values of objects being drawn in Processing, they change where objects are drawn.
A stack is a data structure that is conceptually similar to an ArrayList but only supports push(), pop(), and getting information about the last pushed element. Here is an example of how an integer stack works:
A stack of matrices then is a way of having more than one matrix where only the top matrix affects how objects are drawn. Another example with matrices:
Here is an example, try uncommenting the rect()s:
Thanks, this really helped!