Book Image

Processing 2: Creative Coding Hotshot

By : Nikolaus Gradwohl
Book Image

Processing 2: Creative Coding Hotshot

By: Nikolaus Gradwohl

Overview of this book

Processing makes it convenient for developers, artists, and designers to create their own projects easily and efficiently. Processing offers you a platform for expressing your ideas and engaging audiences in new ways. This book teaches you everything you need to know to explore new frontiers in animation and interactivity with the help of Processing."Processing 2: Creative Coding Hotshot' will present you with nine exciting projects that will take you beyond the basics and show you how you can make your programs see, hear, and even feel! With these projects, you will also learn how to build your own hardware controllers and integrate devices such as a Kinect senor board in your Processing sketches.Processing is an exciting programming environment for programmers and visual artists alike that makes it easier to create interactive programs.Through nine complete projects, "Processing 2: Creative Coding Hotshot' will help you explore the exciting possibilities that this open source language provides. The topics we will cover range from creating robot - actors performing Shakespeare's "Romeo and Juliet", to generating objects for 3D printing, and you will learn how to run your processing sketches nearly anywhere from a desktop computer to a browser or a mobile device.
Table of Contents (16 chapters)
Processing 2: Creative Coding Hotshot
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Let me change it


Nobody feels like smiling all the time, but it is currently somewhat cumbersome to change the facial parameters of our smiley, which could have an impact on your current state of emotion. To prevent our Smilie-O-Mat from increasing the user's level of frustration or annoyance, our second task for this mission is to make the facial parameters adjustable using the mouse by adding three sliders below the smiley.

Engage Thrusters

Let's now change our face:

  1. Open the Smilie-O-Mat sketch and change the size of our sketch window in the setup() method to add more room for the sliders below the smiley face.

    void setup() {
      size(300,390);
      smooth();
      background(255);
      colorMode(HSB);
    }
  2. Now add a new method named drawSliders() and draw three black rectangles for the bases of our sliders.

    void drawSliders() {
      fill(0);
      strokeWeight(1);
      rect( 20,315,width-40,2 );
      rect( 20,345,width-40,2 );
      rect( 20,375,width-40,2 );
    }
  3. The first slider will change the mouth position, so we add a...