Name

translate()

Examples
translate(30, 20)
rect(0, 0, 55, 55)
# Translating in 3D requires P3D
# as the parameter to size()
size(100, 100, P3D)
# Translate 30 across, 20 down, and
# 50 back, or "away" from the screen.
translate(30, 20, -50)
rect(0, 0, 55, 55)
rect(0, 0, 55, 55)  # Draw rect at original 0,0
translate(30, 20)
rect(0, 0, 55, 55)  # Draw rect at 0,0
translate(14, 14)
rect(0, 0, 55, 55)  # Draw rect at 0,0
Description
Related popMatrix()
pushMatrix()
rotate()
rotateX()
rotateY()
rotateZ()
scale()
Updated on Wed Jan 18 17:32:21 2017.
Creative Commons License