Jupyter at Bryn Mawr College |
|||
Public notebooks: /services/public/dblank / CSEdWeek2015 |
Instructor: Professor Doug Blank, dblank@cs.brynmawr.edu
This URL: https://athena.brynmawr.edu/jupyter/hub/dblank/public/CSEdWeek2015/Schedule.ipynb
Goals: Create drawings, animations, and games using Java with Processing.
Survey: http://www.goo.gl/gJw9WY
Internet:
Time | Activity |
---|---|
1pm | Welcome! |
1:15 - 1:30 | Graph Paper Drawing; 0,0 is upper left hand corner, 500 x 500 |
1:30 - 2:00 | Computing with Jupyter! Put graph paper drawing on sketch |
2:00 - 2:30 | Adding a character to the scene: graph-paper-it with 0,0 in center |
2:30 - 2:45 | Break |
2:45 - 3:45 | Animation and Games; functions, mouse, distance |
3:45 | End of TechShop |
Shape Functions:
ellipse(x, y, width, height);
- x,y is centerline(x1, y1, x2, y2);
rect(x, y, width, height);
- x,y is upper left hand cornertriangle(x1, y1, x2, y2, x3, y3);
quad(x1, y1, x2, y2, x3, y3, x4, y4);
arc(x, y, width, height, start, stop);
- x,y is centerLine thickness:
strokeWidth(SIZE);
Color:
color(RED, GREEN, BLUE);
- values are 0 to 255stroke(COLOR);
- change the line colorfill(COLOR);
- change the fill colorCode:
Processing Reference:
void setup() {
// This is where one-time setup code goes
}
void draw() {
// this is where code that is redrawn over and over goes
}
The distance between x1, y1 to x2, y2 is: the square root of the sum of the differences squared of each dimension.
float distance(int x1, int y1, int x2, int y2) {
return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
}