Here’s a basic example of Delauny Triangulation. In this sketch I’m randomly adding 2D nodes to the triangle mesh. The colors are sampled from the center point of each triangle.
I was recently tipped off to Delaunay Triangulation, which connects an arbitrary set of points with a minimum number of triangles. This is exactly what we needed to create planar surfaces between our subway station nodes, and I was able to do that with the Edgy triangulation library for iOS. It was quite a nice feeling to see this rendered as a 3D topography for the first time.
Once we had the triangles, it was trivial to manually dump the data into an .obj file and open it in Rhino.
We’ve arrived at the moment of truth; particle systems. Simply put, particle systems are a collection of objects that all operate on a similar rule-set. But they have a wide range of possible uses; by tweaking their variables or dressing them up, they can model behaviors like flocking birds, clouds, or fire.
This is a simple example of a particle emitter using additive blending. Dragging your finger sends a wind force toward the emitter. I’ve also included a settings panel that allows you to select any of the OpenGL blend functions.
In this example, I’ve created a “Flame” subclass of ParticleSystem. You can spawn flames by touching the screen, and they seek out the brightest regions of the paper. They will avoid their own trails, since they’re black, and the flame burns “upwards” according to the device orientation.
Both of these sketches have been committed to my Nature Of Code github repo.
Liz Khoo and I have been working with the MTA Turnstile data for our semester-long project in Sculpting Data into Everyday Objects. Over the past few weeks we’ve been able to parse the data and visually investigate what we’ve got.
After paging through a few weeks of data it became clear that the days and weeks after Hurricane Sandy would be our focus. The system was dramatically brought offline just prior to landfall, and the data indicates just how long it took for stations to resume operation after the storm passed.
This was our initial sketch showing the volume of riders entering the system. This screen represents 24 “control units” at 1 station over 1 week.
Here we’re parsing all stations over the course of a week. The bright white activity on the left is the flow prior to Sandy, and the right is just starting to show the first stations coming back online.
We mapped the station data to their geographic coordinates to create this map. Scrubbing the mouse horizontally changes the brightness of the dots correspondant to the traffic shown in the screenshot above. This sketch is parsing 3 weeks of data, which gives us a better indication of how long it took for the stations to recover.
In this sketch we looked at how long an individual station took to come back online. Darker stations took longer. We’re tentatively going to use this data as the basis for our X, Y and Z values for 3D modeling.
Here are some screenshots of an iPad app that lets us browse the data in 3 dimensions. The slider changes the Z depth.
For this week’s Data Representation assignment, we were asked to select a dataset from the Guardian Data Store and represent it in two ways. The first is the Tufte way, which focuses on simplicity and clarity. The other is to look at the unique character of the dataset, and try to represent it in a way that only applies to our data.
I’ve chosen the Close Earth Encounters dataset, which looks at asteroid flybys circa 2011.
For the first representation, I’ve done a straight-forward chart with distance on one axis and size on the other:
For the character representation, I’m plotting the asteroids in a faux-orbital path around the earth to represent the distance in relation to other satellites (e.g. The Moon, the Space Shuttle and Mars), and also indicate the scale of the system. The length of the tail corresponds to the velocity of the asteroid, and the brightness of the tail maps to the diameter of the object. I’ve also included data from the recent DA14 flyby, as a benchmark that people may be familiar with.
Move your mouse along the Y axis to change the scale.
If you’re running Processing 2 β5 or later, you can install a command-line app which will compile and run your sketches for you. It’s called processing-java. To install it, open Processing and select “Install processing-java” from the “Tools” menu.
Once that was installed, I added the following line to ~/.profile that allows me to quickly launch a Processing app from the CLI:
alias run_sketch="processing-java --sketch=\"\`pwd\`\" --output=/tmp/processing_output --force --run"
When you’re in a sketch directory, you can simply type `run_sketch` to compile and launch the program.
I’ve also downloaded the TextMate Processing Bundle, which adds some Processing text-completion and shortcuts to TextMate. Once that’s installed, I remapped ⌘R to the following command, which runs the sketch with processing-java.
#!/usr/bin/env bash /usr/bin/processing-java --sketch="$TM_PROJECT_DIRECTORY" --output=/tmp/processing_output --force --run
Voila! You can now edit and run your Processing sketches without the Processing IDE, if you’re so inclined.
This week’s installment of Nature of Code looks at oscillation and springs. As always, the code is available in my NOC github repo.

This week we looked at Vectors and Forces. I also added a simple example of OpenGL texture mapping.
What may not be obvious at the end of the Mover Swarm video is that I’m dragging the mouse to affect the acceleration, which results in the slower plumes.

This semester I’m taking Nature of Code, which is a class taught by Dan Shiffman that explores the “evolutionary properties in nature and software.” You don’t have to be a student at NYU to follow along, because Dan is taking a unique approach to this class by recording all of the lessons as videos and posting them online. You can watch the videos as the semester progresses at the course website.
The structure of the course is pretty open-ended, so I’ve decided to do my coursework in iOS using OpenGL ES 2. This gives me an opportunity to learn more about shaders and also port some of Dan’s examples into a new language. All of my code will be published on github in my Nature of Code repository.
Much of this week was spent creating a “universal” (iPhone and iPad) app that will accommodate the sketches for the rest of the semester. It still needs some polish, but it’s a good place to start. The initial sketches address our first topic: randomness. Here are a couple videos that show them in action:
© William Lindmeier | wdl225@nyu.edu | @wdlindmeier | Theme by Eleven Themes
Recent Comments