Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

24. Translation & Rotation II


Published on

Published in: Education
  • Be the first to comment

  • Be the first to like this

24. Translation & Rotation II

  1. 1. From last time… • Briefly saw recursion! • Drew arbitrary shapes with beginShape(), vertex(), and endShape() • Saw lots of methods that simulate 3D:! ! translate() and rotate()! ! pushMatrix() and popMatrix()
  2. 2. git/GithubPro Git, Scott Chacon!
  3. 3. –Former Co-Worker “Unless you have a hacksaw or a screwdriver, you can’t break anything…”
  4. 4. CAP Translation &! Rotation II
  5. 5. Rotation & Scaling • ‘Simple’ rotation (rotate()) implies 2D rotation, i.e. rotating around the z-axis! • rotateX() // around the x axis • rotateY() // around the y axis • rotateZ() // around the z axis • scale()
  6. 6. Demo! Square Rotation
  7. 7. Learning Processing, p. 246 “A nice rule of thumb… is to use pushMatrix() and popMatrix() before and after translation and rotation for all shapes so that they can be treated as individual entities.”
  8. 8. Demo! Guilty Pleasure
  9. 9. For next time… • Read Shiffman, pp. 255–264, Images I