Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Jim Parker

Rating No ratings yet

An Artist's Guide to Programming teaches computer programming with the aid of 100 example programs, each of which integrates graphical or sound output. The Processing-language-based examples range from drawing a circle and animating bouncing balls to 3D graphics, audio visualization, and interactive games. Readers learn core programming concepts like conditions, loops, arrays, strings and functions, as well as how to use Processing to draw lines, shapes, and 3D objects. They’ll learn key computer graphics concepts like manipulating images, animating text, mapping textures onto objects, and working with video. Advanced examples include sound effects and audio visualization, network communication, 3D geometry and animation, simulations of snow and smoke, predator-prey populations, and interactive games.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on introduction to programming for visual artists, teaching core coding concepts through 100 Processing sketches that produce drawings, animations, sound, and interactive games. Best for creative beginners who learn by making things they can see and hear. 【Book Arc】 - **Opening (~0%–10%)**: Establishes the sketch structure—`setup()` runs once, `draw()` loops continuously—and gets you drawing immediately with shapes, colors, and coordinates. Solves the "blank page" problem by making output visible from the first line. - **Early (~10%–30%)**: Builds programming fundamentals through visual tasks: loops and arrays (drawing repeated circles, storing mouse-click positions), strings and text, and image manipulation (pixels, `PImage`, sub-images, magnification). Solves how to represent and transform data you can see. - **Early–Middle (~30%–40%)**: Introduces motion and interaction—bouncing objects with boundary collision, frame-by-frame animation, loading fonts, and animating text character by character. Solves the gap between static drawings and living sketches. - **Middle (~40%–50%)**: Covers user input and interface building: keyboard entry, saving/loading data to files, and constructing a clickable button with armed/hover states. Solves how to make programs respond to and record user actions. - **Late (~50%+)**: Moves into advanced territory—sound effects and audio visualization, network communication, 3D geometry and animation, particle simulations (snow, smoke), predator-prey population models, and interactive games. Solves how to combine everything into richer, systems-level sketches. - **Ending**: Culminates in complete interactive projects that integrate graphics, sound, input, and simulation—the payoff of the learn-by-doing approach. 【Key Takeaways】 - **The sketch is the fundamental unit** (Opening): Every Processing program has a `setup()` that initializes once and a `draw()` that repeats ~60 times per second—this two-function template is the backbone of everything that follows. - **Learning happens by doing, not by reading** (Opening): The book deliberately favors lots of code and relatively little explanation; you're meant to change parameters and observe results. - **Arrays turn repetition into data** (Early): Storing mouse positions, animation frames, or character properties in arrays lets simple loops produce complex, stateful behavior. - **Images are just 2D arrays of pixels** (Early): Understanding `PImage`, `get()`/`set()`, and pixel-level operations unlocks manipulation, magnification, and effects like grayscale conversion. - **Motion requires boundary logic** (Early–Middle): Bouncing objects teach collision detection and the subtlety of overshoot at high speeds—a concrete lesson in why naive physics breaks. - **Interaction is built from primitives** (Middle): Buttons are rectangles plus armed-state checks plus a callback; keyboard and file I/O follow the same pattern of input → state → response. - **Text can be animated at the character level** (Middle): Using `charAt()` to give each character its own position, velocity, and size enables effects like exploding words. - **Simulation and media extend the toolkit** (Late): Particle systems, predator-prey models, audio visualization, and 3D graphics show how the same fundamentals scale into ambitious projects. 【Reading Tips】 - **Type every example by hand** rather than copying—the book's value is in the muscle memory and the errors you'll debug. - **Deep-read the early chapters** on `setup()`/`draw()`, arrays, and images; these concepts recur constantly and are worth mastering before moving on. - **Skim the advanced chapters** (3D, network, simulations) on a first pass, then return when you have a project that needs them. - **Experiment aggressively**: change colors, speeds, sizes, and loop bounds—the author explicitly intends this as the learning method. - **Treat the 100 sketches as a reference library**, not a linear novel; jump to the sketch closest to what you want to build. 【Coverage Limits】 The excerpts cover the book's structure, early-to-middle fundamentals, and a list of advanced topics, but do not include detailed content from the late chapters on 3D, networking, or specific simulations. Chapter titles and exact percentages beyond the markers provided are not available.
Page 9
corporate sales, or translations, please contact No Starch Press, Inc. directly at info@nostarch.com or: No Starch Press, Inc. 245 8th Street, San Francisco,...
View in text
Excerpt 2
For example, s1.charAt(3) is “b” and s1.charAt(18) is “,”. Strings cannot be compared using the standard relational operators (because they are really class...
View in text
Excerpt 3
de { px = width-delta-sprite.width; dx = -dx; 2 } else if (px < 0) // left side { px = -px; dx = -dx; // Reverse x-direction } } void ybounce () { int delta;...
View in text
Excerpt 4
record when the ball collides with the edge of the screen. The output method that corresponds to loadStrings() is the function saveStrings(). We’ll declare a...
View in text
Excerpt 5
usePressed () { 1 link ("https://www.microsoft.com"); } Example B String url = ""; void setup () { size (240, 200); } void draw () { background (200, 200, 20...
View in text
Excerpt 6
uld hold a shape, align with points on paper, and allow the drafter to connect them using a pencil. Mathematically, a spline is a polynomial function that ap...
View in text
Excerpt 7
sin(h)*hr); } float queue[] = new float[200], end=2.0e3; float miaTime=16.0, msTime=8.0,arrival,departure; int Nqueue=0, nq; float qsum=0.0, time=0.0; void s...
View in text
Excerpt 8
} 3 i f (i!=0 && random(1) < 0.20) for (int j=0; j<600; midpoint and calls itself twice, passing the left and right halves of the line and a smaller dy. The...
View in text
Tags
AI categories
Programming LanguageEducation
ISBN: 1098130227
Publisher: No Starch Press
Publish Year: 2022
Language: English
Pages: 463
File Format: PDF
File Size: 9.5 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…