Book Image

Processing 2: Creative Programming Cookbook

Book Image

Processing 2: Creative Programming Cookbook

Overview of this book

Processing is probably the best known creative coding environment that helps you bridge the gap between programming and art. It enables designers, artists, architects, students and many others to explore graphics programming and computational art in an easy way, thus helping you boost your creativity. "Processing 2: Creative Programming Cookbook" will guide you to explore and experience the open source Processing language and environment, helping you discover advanced features and exciting possibilities with this programming environment like never before. You'll learn the basics of 2D and 3D graphics programming, and then quickly move up to advanced topics such as audio and video visualization, computer vision, and much more with this comprehensive guide. Since its birth in 2001, Processing has grown a lot. What started out as a project by Ben Fry and Casey Reas has now become a widely used graphics programming language. Processing 2 has a lot of new and exciting features. This cookbook will guide you to explore the completely new and cool graphics engine and video library. Using the recipes in this cookbook, you will be able to build interactive art for desktop computers, Internet, and even Android devices! You don't even have to use a keyboard or mouse to interact with the art you make. The book's next-gen technologies will teach you how to design interactions with a webcam or a microphone! Isn't that amazing? "Processing 2: Creative Programming Cookbook" will guide you to explore the Processing language and environment using practical and useful recipes.
Table of Contents (18 chapters)
Processing 2: Creative Programming Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Processing is probably the best-known creative coding environment that helps you bridge the gap between programming and art. It enables designers, artists, architects, students, and many others, to explore graphics programming and computational art in an easy way, thus helping boost creativity.

Processing 2: Creative Programming Cookbook will guide you to explore and experience the open source Processing language and environment, helping you discover advanced features and exciting possibilities with this programming environment, like never before. You'll learn the basics of 2D and 3D graphics programming, and then quickly move up to advanced topics, such as audio and video visualization, computer vision, and much more, with this comprehensive guide.

Since its birth in 2001, Processing has grown a lot. What started out as a project by Ben Fry and Casey Reas has now become a widely used graphics programming language.

Processing 2 has a lot of new and exciting features. This cookbook will guide you through exploring the completely new and cool graphics engine and video library. Using the recipes in this cookbook, you will be able to build interactive art for desktop computers, the Internet, and even Android devices! You don't even have to use a keyboard or mouse to interact with the art you make. The book's next-gen technologies will teach you how to design interactions with a webcam or a microphone! Isn't that amazing?

Processing 2: Creative Programming Cookbook will guide you to explore the Processing language and environment using practical and useful recipes.

What this book covers

Chapter 1, Getting Started with Processing 2, takes a look at installing Processing on your computer and creating your first interactive sketch.

Chapter 2, Drawing Text, Curves, and Shapes in 2D, covers the basics of 2D drawing. We'll take a look at how we can use colors, typography, and images.

Chapter 3, Drawing in 3D—Lights, Camera, and Action!, explores the third dimension. You'll learn how to draw basic 3D shapes and how you can use lights to add some extra depth to your 3D scene.

Chapter 4, Working with Data, will teach you how to load data from text files and parse it to make it useful in your sketch. We also explore some datatypes that will be useful for storing data.

Chapter 5, Exporting from Processing, covers everything to get your work out in the world. You'll learn to save your sketches as an image, PDF file, or standalone application.

Chapter 6, Working with Video, explores how you can work with video and how you can manipulate it to create something interesting.

Chapter 7, Audio Visualization, will show you how to use the Minim library. We'll take a look at how we can visualize audio, and create some basic instruments.

Chapter 8, Exploring Computer Vision, will teach you how computer vision works with Processing. We'll take a look at blob tracking and color tracking and will explore the basics of OpenCV.

Chapter 9, Exploring JavaScript Mode, will show you how you can use your freshly acquired Processing skills to create interactive sketches for the web.

Chapter 10, Exploring Android Mode, covers how you can use Processing to create interactive applications for Android smartphones and tablets.

Chapter 11, Using Processing with Other Editors, shows you how you can use Processing with Eclipse and IntelliJ IDEA. We also take a look at how you can create your own libraries and tools to use with Processing.

What you need for this book

The software you need for the biggest part of the book is Processing, and can be downloaded at http://processing.org/.

For some chapters, you'll need to download some extra software. For Chapter 10, you need the Android SDK, which can be downloaded at http://developer.android.com/sdk/index.html. For Chapter 11, you'll need some other editors to work with Processing. Eclipse can be downloaded at http://eclipse.org/ and IntelliJ IDEA at http://www.jetbrains.com/idea/.

If you need to download or install extra libraries, fonts, or other files, the recipe will mention where you can find what you need.

Who this book is for

This book targets creative professionals, visual artists, designers, and students who have basic knowledge of the Processing development environment and who want to discover the next level of Processing—anyone with a creative practice who wants to use computation in their design process. A basic understanding of programming is assumed. However, this book is also recommended to the non-artistic looking to expand their graphics and artistic skills.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text are shown as follows: "The size() function sets the dimensions of your sketch window."

A block of code is set as follows:

void setup()
{
  size( 640, 480 );
  smooth();
}

void draw()
{
  background(255);

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Click on the Run button to start Processing."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.