Examples updates to 640 x 360 pixels

This commit is contained in:
Casey Reas
2011-08-05 18:26:51 +00:00
parent f1c7aabf14
commit 9b7de8d6b7
52 changed files with 295 additions and 302 deletions
+9 -7
View File
@@ -7,21 +7,23 @@
* the same pushMatrix() and popMatrix() group.
*/
float x = 50;
float y = 100;
float x, y;
float angle1 = 0.0;
float angle2 = 0.0;
float segLength = 50;
float segLength = 100;
void setup() {
size(200, 200);
size(640, 360);
smooth();
strokeWeight(20.0);
stroke(0, 100);
strokeWeight(30);
stroke(255, 160);
x = width * 0.3;
y = height * 0.5;
}
void draw() {
background(226);
background(0);
angle1 = (mouseX/float(width) - 0.5) * -PI;
angle2 = (mouseY/float(height) - 0.5) * PI;
@@ -13,16 +13,15 @@ float angle;
float jitter;
void setup() {
size(200, 200);
size(640, 360);
smooth();
noStroke();
fill(255);
rectMode(CENTER);
frameRate(30);
}
void draw() {
background(102);
background(51);
// during even-numbered seconds (0, 2, 4, 6...)
if (second() % 2 == 0) {
@@ -32,5 +31,5 @@ void draw() {
float c = cos(angle);
translate(width/2, height/2);
rotate(c);
rect(0, 0, 115, 115);
rect(0, 0, 180, 180);
}
@@ -11,16 +11,15 @@
float a = 0.0;
float s = 0.0;
void setup()
{
size(200,200);
void setup() {
size(640, 360);
noStroke();
rectMode(CENTER);
frameRate(30);
}
void draw()
{
void draw() {
background(102);
a = a + 0.04;
@@ -8,17 +8,14 @@
*/
float x, y;
float size = 40.0;
float size = 80.0;
void setup()
{
size(200,200);
void setup() {
size(640, 360);
noStroke();
frameRate(30);
}
void draw()
{
void draw() {
background(102);
x = x + 0.8;
@@ -5,23 +5,21 @@
* Using rotate() and triangle() functions generate a pretty
* flower. Uncomment the line "// rotate(rot+=radians(spin));"
* in the triBlur() function for a nice variation.
*
* Updated 27 February 2010.
*/
PVector[] p = new PVector[3];
float shift = 1.0;
float shift = 0.2;
float fade = 0;
float fillCol = 0;
float rot = 0;
float spin = 0;
void setup() {
size(200, 200);
size(640, 360);
background(0);
smooth();
fade = 255.0 / (width/2.0/shift);
spin = 360.0 / (width/2.0/shift);
fade = 255.0 / (width*0.5 / shift);
spin = 360.0 / (width*0.5 / shift);
p[0] = new PVector(-width/2, height/2);
p[1] = new PVector(width/2, height/2);
p[2] = new PVector(0, -height/2);
@@ -34,13 +32,11 @@ void triBlur() {
fill(fillCol);
fillCol += fade;
rotate(spin);
// another interesting variation: uncomment the line below
// rotate(rot+=radians(spin));
triangle(p[0].x += shift, p[0].y -= shift/2,
p[1].x -= shift, p[1].y -= shift/2,
p[2].x, p[2].y += shift);
if (p[0].x < 0) {
// recursive call
// ecursive call
triBlur();
}
}