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

Mission Accomplished


Our current mission was to use the neon globe we created in the previous project and turn it into a geographic information system showing where the requests for a website are coming from. We started by parsing the logfile using regular expressions and extracting the IP address and the timestamp from each line. To make the timestamps easier to work with, we used SimpleDateFormater to convert the string representation to a long. In the draw() method, we created a timeline showing the timestamps of a logfile.

In the second task, we added the database from the hostIP project, which allows us to map blocks of IP addresses to geo-coordinates on city level. To speed up the geocoding, we created HashMap using the IP address block as a key. Since the loading of the hostIP database takes some time, we moved the initialization code to a separate thread and added a progress bar to our draw() method.

In the third task, we used the geocoded data to draw a small red dot for each request...