Skip to Content
Getting Started with Processing.py
book

Getting Started with Processing.py

by Allison Parrish, Ben Fry, Casey Reas
May 2016
Beginner content levelBeginner
242 pages
4h 19m
English
Make: Community
Content preview from Getting Started with Processing.py

Chapter 6. Translate, Rotate, Scale

An alternative technique for positioning and moving things on screen is to change the screen coordinate system. For instance, you can move a shape 50 pixels to the right, or you can move the location of coordinate (0,0) 50 pixels to the right—the visual result on screen is the same.

By modifying the default coordinate system, we can create different transformations including translation, rotation, and scaling.

Translate

Working with transformations can be tricky, but the translate() function is the most straightforward, so we’ll start with that. As Figure 6-1 shows, this function can shift the coordinate system left, right, up, and down.

Figure 6-1. Translating the coordinates

Example 6-1: Translating ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Introduction to D3.js with React

Introduction to D3.js with React

Adam Janes

Publisher Resources

ISBN: 9781457186820Errata Page