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

From sphere to globe


The third task of our current mission is to convert our sphere into a globe by using a texture image. We will need to define the mapping of each vertex to a part of the texture image to make it fit. We will use a black and white texture, where all the land mass is black and the sea is white. The image was created based on a vector map licensed under a Creative Commons license by STUDIO7DESIGNS, which can be found at http://vector4free.com/vectors/id/75. I added Antarctica and converted it to a PNG file.

After this, we will add satellite images provided by NASA's Visible Earth project (http://visibleearth.nasa.gov/). We will also add a callback handler for keyboard events and make the textures switchable.

Engage Thrusters

Let's start texturing our globe:

  1. First we need to add an image of our globe to the sketch. Download the image from the download section at www.packtpub.com/support. The map looks like this:

  2. Drag the image to the sketch window or add it using the Add File...