Skip to content

Instantly share code, notes, and snippets.

@cedricbonhomme
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cedricbonhomme/b43bcbd42808f828540f to your computer and use it in GitHub Desktop.
Save cedricbonhomme/b43bcbd42808f828540f to your computer and use it in GitHub Desktop.
#
# 1. Download CSV points cloud data of Thom Yorke here:
# https://code.google.com/p/radiohead/downloads/list
# (original implementation)
# 2. Add Python mode to Processing
# 3. Load this file (or paste the contents of this file
# into Processing and save to a name and location of your choosing)
# 4. If it doesnt exist, create a folder called "data"
# inside the sketch folder.
# 5. Extract all animation CSV files into "data" folder (2101 files total)
# 6. Press play and enjoy.
#
frameCounter = 1
def setup():
size(1024,768, OPENGL)
strokeWeight(1)
def draw():
global frameCounter
# We'll use a black background
background(0)
# The data has 0,0,0 at the center and we want to draw that point at the center of our screen
translate(width/2, height/2)
# Lets adjust our center slightly
translate(-150, -150)
# Lets draw things bigger
scale(2)
raws = loadStrings(str(frameCounter)+".csv")
for raw in raws:
x, y, z, intensity = [float(elem) for elem in raw.split(',')]
stroke(intensity*1.1, intensity*1.6, 200, 255)
line(x,y,z,x+1,y+1,z+1)
frameCounter += 1
if frameCounter > 2101:
exit()
print "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment