If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Course: Unlisted resources area > Unit 2

Lesson 1: ProcessingJS documentation

pushMatrix()/popMatrix()

With these two functions combined, you can apply different transformation functions to different parts of your code. Before calling transformation functions, call pushMatrix(). When you're done and want to stop applying those transformations to drawn shapes, call popMatrix(). For more details on transformations, read this series.
pushMatrix(): Remembers the current coordinate system (in the "matrix stack").
popMatrix(): Restores the previous coordinate system (from the "matrix stack") - whatever was most recently pushed.

Want to join the conversation?

No posts yet.