Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo
Processing Creative Coding and Computational Art

Book Description

If you're interested in creating cutting-edge code-based art and animations, you've come to the right place! Processing (available at is a revolutionary open source programming language and environment designed to bridge the gap between programming and art, allowing non-programmers to learn programming fundamentals as easily as possible, and empowering anyone to produce beautiful creations using math patterns. With the software freely available, Processing provides an accessible alternative to using Flash for creative coding and computational art--both on and off the Web.

This book is written especially for artists, designers, and other creative professionals and students exploring code art, graphics programming, and computational aesthetics. The book provides a solid and comprehensive foundation in programming, including object-oriented principles, and introduces you to the easy-to-grasp Processing language, so no previous coding experience is necessary. The book then goes through using Processing to code lines, curves, shapes, and motion, continuing to the point where you'll have mastered Processing and can really start to unleash your creativity with realistic physics, interactivity, and 3D! In the final chapter, you'll even learn how to extend your Processing skills by working directly with the powerful Java programming languagethe language Processing itself is built with.

Table of Contents

  1. Title Page
  2. Dedication
  3. Contents at a Glance
  4. Contents
  6. About the Author
  7. About the Tech Reviewers
  8. Acknowledgments
  9. Introduction
    1. Impetus for writing the book
    2. Intended audience
    3. Coding as an organic, creative, and cathartic process
    4. "I'm an artist-I Don't do math"
    5. Toward a left/right brain integration
    6. Setting up Processing
    7. Web capability
    8. Launching the application
    9. How to use this book
    10. Give us some feedback!
    11. Layout conventions
    1. Chapter 1: Code Art
      1. Aesthetics + Computation
      2. Computer art history
      3. Code artists
      4. Summary
    2. Chapter 2: Creative Coding
      1. The origin of Processing
      2. Programming language comparisons
      3. Procedural OOP ("poop") approach
      4. Algorithms aren't as scary as they sound
      5. Happy coding mistakes
      6. Algorithmic tree
      7. Summary
    3. Chapter 3: Code Grammar 101
      1. Structure and abstraction
      2. Your first program
      3. Literals
      4. Variables
      5. Operators
      6. Conditionals
      7. Arrays and loops
      8. Functions
      9. Summary
    4. Chapter 4: Computer Graphics, the Fun, Easy Way
      1. Coordinate systems
      2. Anatomy of an image
      3. The pixel
      4. Graphic formats
      5. Animation
      6. The joy of math
      7. Interactivity
      8. Summary
    5. Chapter 5: The Processing Environment
      1. How it works
      2. Tour de Processing
      3. Programming modes
      4. Rendering modes
      5. Summary
    1. Chapter 6: Lines
      1. It's all about points
      2. Streamlining the sketch with a while loop
      3. Streamlining the sketch further with a for loop
      4. Creating organic form through randomization
      5. Coding a grid
      6. Creating space through fades
      7. Creating lines with pixels
      8. Processing's line functions
      9. Joining lines
      10. Creating a table structure
      11. Vertex functions
      12. Anti-aliasing using the smooth function
      13. Applying the vertex function
      14. Creating line strips
      15. Line loops
      16. Polygons and patterns
      17. Summary
    2. Chapter 7: Curves
      1. Making the transition from lines to curves
      2. Creating curves using trig
      3. Creating curves using polynomials
      4. Using Processing's curve functions
      5. Summary
    3. Chapter 8: Object-Oriented Programming
      1. A new way of programming?
      2. BurritoRecipe class
      3. Advanced OOP concepts
      4. Summary
    4. Chapter 9: Shapes
      1. Patterns and principles (some encouragement)
      2. Processing's shape functions
      3. Applying OOP to shape creation
      4. Creating a neighborhood
      5. Summary
    5. Chapter 10: Color and Imaging
      1. The importance of color
      2. Color theory
      3. A quick review of creating transformations
      4. Pushing and popping the matrix
      5. Setting the color mode
      6. More convenient color functions
      7. Imaging
      8. Summary
    6. Chapter 11: Motion
      1. Animation basics
      2. Simple collision detection
      3. Accessing time
      4. Fun with physics
      5. Object interactions
      6. Advanced motion and object collisions
      7. Asteroid shower in three stages
      8. Inter-object collision
      9. Summary
    7. Chapter 12: Interactivity
      1. Interactivity simplified
      2. Mouse events
      3. Creating a simple drawing application
      4. Keystroke events
      5. Summary
    8. Chapter 13: 3D
      1. Processing 3D basics
      2. 3D transformation
      3. Creating a custom cube
      4. 3D rotations
      5. Beyond box() and sphere()
      6. Summary
    1. Appendix A: Processing Language API
      1. Introducing the Processing API
      2. Structure
      3. Environment
      4. Data
      5. Control
      6. Shape
      7. Input
      8. Output
      9. Transform
      10. Lights, Camera
      11. Color
      12. Image
      13. Rendering
      14. Typography
      15. Math
      16. Constants
      17. Processing libraries
    2. Appendix B: Math Reference
      1. Algebra
      2. Geometry
      3. Trigonometry
      4. Bitwise Operations
  13. Index