An Artist's Guide to Programming

Book description

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.

Table of contents

  1. Title Page
  2. Copyright
  3. About the Author
  4. Author’s Note
  5. Introduction
    1. The Basics of a Programming Language: Processing
    2. The Beginning
    3. The Middle
    4. The Rest
    5. Variables
    6. How to Write a Program
  6. Part 1: The Fundamentals of Drawing
    1. Sketch 1: A Circle
      1. Example A
      2. Example B
      3. Example C
    2. Sketch 2: Colors
      1. Example A
      2. Example B
    3. Sketch 3: if Statements—Changing Colors Conditionally
      1. Example A
      2. Example B
      3. Example C
    4. Sketch 4: Loops—Drawing 20 Circles
      1. Example A
      2. Example B
    5. Sketch 5: Lines
      1. Example A
      2. Example B
    6. Sketch 6: Arrays—Drawing Many Circles
    7. Sketch 7: Lines with Rubber Banding
    8. Sketch 8: Random Circles
    9. Sketch 9: A Rectangle
    10. Sketch 10: Triangles and Motion
    11. Sketch 11: Displaying Text
    12. Sketch 12: Manipulating Text Strings
  7. Part 2: Working with Preexisting Images
    1. Sketch 13: Loading and Displaying an Image
      1. Example A
      2. Example B
    2. Sketch 14: Images—Theory and Practice
      1. Example A
      2. Example B
    3. Sketch 15: Manipulating Images I—Aspect Ratio
      1. Example A
      2. Example B
    4. Sketch 16: Manipulating Images II—Cropping
    5. Sketch 17: Manipulating Images III—Magnifier
    6. Sketch 18: Rotation
      1. Example A
      2. Example B
    7. Sketch 19: Rotating About Any Point—Translation
      1. Example A
      2. Example B
    8. Sketch 20: Rotating an Image
    9. Sketch 21: Getting the Value of a Pixel
    10. Sketch 22: Setting and Changing the Values of Pixels
      1. Example A
      2. Example B
    11. Sketch 23: Changing the Values of Pixels—Thresholding
    12. Sketch 24: User-Defined Functions
    13. Sketch 25: Elements of Programming Style
    14. Sketch 26: Duplicating Images—More Functions
  8. Part 3: 2D Graphics and Animation
    1. Sketch 27: Saving an Image and Adjusting Transparency
    2. Sketch 28: Bouncing an Object in a Window
    3. Sketch 29: Basic Sprite Graphics
    4. Sketch 30: Detecting Sprite-Sprite Collisions
    5. Sketch 31: Animation—Generating TV Static
    6. Sketch 32: Frame Animation
      1. Example A
      2. Example B
    7. Sketch 33: Flood Fill—Filling in Complex Shapes
  9. Part 4: Working with Text and Files
    1. Sketch 34: Fonts, Sizes, Character Properties
    2. Sketch 35: Scrolling Text
    3. Sketch 36: Text Animation
    4. Sketch 37: Inputting a Filename
    5. Sketch 38: Inputting an Integer
    6. Sketch 39: Reading Parameters from a File
    7. Sketch 40: Writing Text to a File
    8. Sketch 41: Simulating Text on a Computer Screen
  10. Part 5: Creating User Interfaces and Widgets
    1. Sketch 42: A Button
    2. Sketch 43: The Class Object—Multiple Buttons
    3. Sketch 44: A Slider
    4. Sketch 45: A Gauge Display
    5. Sketch 46: A Likert Scale
    6. Sketch 47: A Thermometer
  11. Part 6: Network Communications
    1. Sketch 48: Opening a Web Page
      1. Example A
      2. Example B
    2. Sketch 49: Loading Images from a Web Page
    3. Sketch 50: Client/Server Communication
  12. Part 7: 3D Graphics and Animation
    1. Sketch 51: Basic 3D Objects
      1. Example A
      2. Example B
    2. Sketch 52: 3D Geometry—Viewpoints, Projections
    3. Sketch 53: 3D Illumination
    4. Sketch 54: Bouncing a Ball in 3D
    5. Sketch 55: Constructing 3D Objects Using Planes
    6. Sketch 56: Texture Mapping
    7. Sketch 57: Billboards—Simulating a Tree
    8. Sketch 58: Moving the Viewpoint in 3D
    9. Sketch 59: Spotlights
    10. Sketch 60: A Driving Simulation
  13. Part 8: Advanced Graphics and Animation
    1. Sketch 61: Layering
    2. Sketch 62: Seeing the World Through a Window
    3. Sketch 63: The PShape Object—A Rotating Planet
    4. Sketch 64: Splines—Drawing Curves
    5. Sketch 65: A Driving Simulation with Waypoints
    6. Sketch 66: Many Small Objects—A Snowstorm
    7. Sketch 67: Particle Graphics—Smoke
    8. Sketch 68: Saving a State—A Spinning Propeller
    9. Sketch 69: L-Systems—Drawing Plants
    10. Sketch 70: Warping an Image
  14. Part 9: Working with Sound
    1. Sketch 71: Playing a Sound File
    2. Sketch 72: Displaying a Sound’s Volume
    3. Sketch 73: Bouncing a Ball with Sound Effects
    4. Sketch 74: Mixing Two Sounds
    5. Sketch 75: Displaying Audio Waveforms
    6. Sketch 76: Controlling a Graphic with Sound
    7. Sketch 77: Positional Sound
    8. Sketch 78: Synthetic Sounds
    9. Sketch 79: Recording and Saving Sound
  15. Part 10: Working with Video
    1. Sketch 80: Playing a Video
    2. Sketch 81: Playing a Video with a Jog Wheel
    3. Sketch 82: Saving Still Frames from a Video
    4. Sketch 83: Processing Video in Real Time
    5. Sketch 84: Capturing Video from a Webcam
    6. Sketch 85: Mapping Live Video as a Texture
  16. Part 11: Measuring and Simulating Time
    1. Sketch 86: Displaying a Clock
    2. Sketch 87: Time Differences—Measuring Reaction Time
    3. Sketch 88: M/M/1 Queue—Time in Simulations
  17. Part 12: Creating Simulations and Games
    1. Sketch 89: Predator-Prey Simulation
    2. Sketch 90: Flocking Behavior
    3. Sketch 91: Simulating the Aurora
    4. Sketch 92: A Dynamic Advertisement
    5. Sketch 93: Nim
    6. Sketch 94: Pathfinding
    7. Sketch 95: Metaballs—A Lava Lamp
    8. Sketch 96: A Robot Arm
    9. Sketch 97: Lightning
    10. Sketch 98: The Computer Game Breakout
    11. Sketch 99: Midpoint Displacement—Simulating Terrain
  18. Part 13: Making Your Work Public
    1. Sketch 100: Processing on the Web

Product information

  • Title: An Artist's Guide to Programming
  • Author(s): Jim Parker
  • Release date: May 2022
  • Publisher(s): No Starch Press
  • ISBN: 9781718501645