Chapter 3. Draw
At first, drawing on a computer screen is like working on graph paper. It starts as a careful technical procedure, but as new concepts are introduced, drawing simple shapes with software expands into animation and interaction. Before we make this jump, we need to start at the beginning.
A computer screen is a grid of light elements called pixels. Each pixel has a position within the grid defined by coordinates. When you create a p5.js sketch, you view it with a web browser. Within the window of the browser, p5.js creates a drawing canvas, an area in which graphics are drawn. The canvas may be the same size as the window, or it may have different dimensions. The canvas is usually positioned at the top left of your window, but ...
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.
Read now
Unlock full access