This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<script language="javascript" src="p5.js"></script> | |
<script language="javascript" src="sketch.js"></script> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Trilateration | |
// from: http://en.wikipedia.org/wiki/Trilateration | |
// Daniel Shiffman <http://www.shiffman.net> | |
// April 2006 | |
// Updating for Processing 2.1, Jan 2014 | |
PVector p1,p2,p3; | |
float d1,d2,d3; | |
PVector it; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Perlin Noise Blob | |
// Polar to Cartesian Coordinates | |
// Daniel Shiffman | |
// Nature of Code, Spring 2014 | |
float yoff = 0.0; | |
void setup() { | |
size(640,360); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setup() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
[ { | |
"name": "Morgan", | |
"age": "30", | |
"location": "Boston", | |
"desire": "Singing", | |
"fear": "Violence" | |
}, | |
{ | |
"name": "Joss", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
color c = color(0); | |
void setup() { | |
size(200, 200); | |
} | |
void draw() { | |
background(c); | |
// % is the remainder http://processing.org/reference/modulo.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup () { | |
size (400, 400); | |
} | |
void draw () { | |
background (0); | |
int spacing = 10; | |
noStroke(); | |
int cols = width / spacing; | |
int rows = height / spacing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.NumberFormat; | |
String s = "256,128"; | |
int val = int(s.replaceAll(",","")); | |
println(val); | |
int val2 = 0; | |
NumberFormat nf = NumberFormat.getNumberInstance(java.util.Locale.US); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Daniel Shiffman | |
// Programming from A to Z, Fall 2014 | |
// https://github.com/shiffman/Programming-from-A-to-Z-F14 | |
// This examples builds a very simple DOM visualization of concordance | |
// It reads the text one word a a time and animates the words growing according to their counts | |
var concordance; | |
var wutang; | |
var canvas; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PGraphics canvas; | |
void setup() { | |
canvas = createGraphics(20, 20); | |
} | |
void draw() { | |
background(255); | |
canvas.beginDraw(); | |
canvas.background(0); |
OlderNewer