Drawing Machines | week 6 | Hand Drawing Machine 1
posted by md1660
Friday, February 29, 2008



*This is a collaboration project with Marlon.

//This is the code:
void setup() {
size(650, 450);
}
void draw() {
background(255);
for (int x = -100; x < width; x += 50) {
for (int y = -100; y < height; y += 50) {
for (int t = 50; t < 250; t += 50) {
stroke(0);
DMBezier(x, y, x, y+t, x+t, y, x+t, y+t);
DMBezier(x, y+t, x, y, x+t, y+t, x+t, y);
}
}
}
}
void DMBezier(float p0x, float p0y, float cp0x, float cp0y,
float cp1x, float cp1y, float p1x, float p1y) {
float delta = 0.01;
float lx = p0x, ly = p0y;
float cx, cy;
for (float t = 0; t <= 1.0; t += delta) {
cx = (pow(1-t,3)*p0x) + (3*t*pow(1-t,2)*cp0x) +
(3*pow(t,2)*(1-t)*cp1x) + (pow(t,3)*p1x);
cy = (pow(1-t,3)*p0y) + (3*t*pow(1-t,2)*cp0y) +
(3*pow(t,2)*(1-t)*cp1y) + (pow(t,3)*p1y);
line(lx, ly, cx, cy);
lx = cx;
ly = cy;
}
}
We made this with Alex and Marlon, and we talk about the how the pieces are connected and in which order … It was a good task because I had never thought about Lego in this way …
Click HERE to see some images
This was a really great come back to ITP
Click HERE to see some images