My first interactive sketch in Processing made as an assignment for the course
INTRODUCTION TO COMPUTATIONAL ARTS, State University of New York on Coursera.
INTRODUCTION TO COMPUTATIONAL ARTS, State University of New York on Coursera.
The code written in Processing allows to draw lines and circles, based on mouse input.
Here is an example of what it does.
Enjoy ;)
Here is an example of what it does.
Enjoy ;)
For those who are interested in code)
/*
1,2,3 to change line thickness
1,2,3 to change line thickness
ENTER to clean the screen
S (s) to make a screenshoot
S (s) to make a screenshoot
*/
float y = random (20, 700);
color c = color(0, 10);
float h = random (0, 360);
int w = 1;
float e = 4;
void setup ()
{
size(720, 720);
colorMode (HSB, 360, 100, 100);
background(#FFFFFF);
smooth();
noFill ();
}
void draw ()
{
if (mousePressed) {
stroke(c);
strokeWeight (1);
beginShape();
vertex(0, 0);
bezierVertex(mouseX+mouseY, mouseY+mouseX, mouseX-mouseY, mouseY-mouseX, y, y);
bezierVertex(mouseX, mouseY, mouseY, mouseX, width, height);
endShape();
}
}
void mouseReleased() {
stroke (h, mouseY/10, mouseY/10);
strokeWeight (w);
ellipse (y, y, (mouseX-mouseY)/1.5, (mouseX-mouseY)/1.5);
}
void keyReleased() {
if (key==ENTER) background (360);
if (key == 's' || key == 'S') saveFrame("screenshoot_###.png");
switch (key) {
case '1':
c = color (0, 10);
w = 1;
break;
case '2':
c = color (0, 50);
w = 3;
break;
case '3':
c = color (0, 100);
w = 5;
break;
}
}
//Nataliya Sinelshchikova
float y = random (20, 700);
color c = color(0, 10);
float h = random (0, 360);
int w = 1;
float e = 4;
void setup ()
{
size(720, 720);
colorMode (HSB, 360, 100, 100);
background(#FFFFFF);
smooth();
noFill ();
}
void draw ()
{
if (mousePressed) {
stroke(c);
strokeWeight (1);
beginShape();
vertex(0, 0);
bezierVertex(mouseX+mouseY, mouseY+mouseX, mouseX-mouseY, mouseY-mouseX, y, y);
bezierVertex(mouseX, mouseY, mouseY, mouseX, width, height);
endShape();
}
}
void mouseReleased() {
stroke (h, mouseY/10, mouseY/10);
strokeWeight (w);
ellipse (y, y, (mouseX-mouseY)/1.5, (mouseX-mouseY)/1.5);
}
void keyReleased() {
if (key==ENTER) background (360);
if (key == 's' || key == 'S') saveFrame("screenshoot_###.png");
switch (key) {
case '1':
c = color (0, 10);
w = 1;
break;
case '2':
c = color (0, 50);
w = 3;
break;
case '3':
c = color (0, 100);
w = 5;
break;
}
}
//Nataliya Sinelshchikova