Examples and stories... static visual arts, animations, interactive art
Writing code FOR creating cool stuff
Meta level understanding
The concept of writing commands to the computer. Coding
The sandbox called Processing or it's child - P5JS
Related languages - Java, Javascript
p5js.org --> our work environment
Concepts
Pixels in the screen are called by their X and Y.. starting from the top-left corner
"Default" / "By default" - things that have their own "basic" behavior in case I didn't specifically say what to do.
Coding:
Processing program structure
setup() & draw() where draw() repeats itself constantly
Primitives
point(x,y);
circle (x,y, diameter);
ellipse (x,y,width, height);
Comments
// lines of text that start with "//" are ignored by the computer and are aimed for "people" // (or for temporarily hiding code instead of deleting it)
Assignments
Simple primitives placement
Babushka
of circles
note - smaller on top of larger...
Week 2
Lesson 2 - 7/3/2022
Content
A good long summary of lesson1
2 more primitives:recatngle and line
rect (x,y, width, height);
line(x1,y1,x2,y2);
Assignments
Babushka of rectangles
lines from top left corner, spread to the right side from top to bottom
Lesson 3 - 9/3/2022
Content
COLORS!
We saw 3 ways to describe colors:
1. Simplest: - just use the name of the color:
'red', 'green', 'yellow', 'black', ........
2. Use RGB - 3 numbers: Red value, Green value, Blue value and mix them together:
(255,0,0) is hard red (255,40,0) is red, with a little bit of green in it.. and so on
3. Add transparency - use 4 numbers - R,G,B, Transparency:
(10,10,255,100) is a strong BLUE with tiny red and green in it with transparency of 100 where 255 - is not transparent at all and 0 is completely transparent
We learned that the computer expects to know which colors to use for FILL and STROKE of the shape, BEFORE going to paint it. So we would first pick colors and only then command it to paint
If I don't tell it which color it will use be default black for stroke and white for fill
We saw that when searching google for "RGB online" we can get websites which show us all the colors that can be reached via RGB and allows us to select colors nicely
We also saw:
noFill(); noStroke(); strokeWeight(5); // means: set the width (or the weight) of the stroke brush to 5. (de default is 1)
Inspiration
A more advanced code (in Processing) but inspirational results - A recursive tree. We'll talk about it further later... just wanted to show for now. There are quite a few concepts there which you haven't learned yet.
We learned a few ways to plan on a paper beforehand: by calculations and just by looking at a drawing
Week 3
Lesson 4 14/2/2022
Content
2 (or 3) big new concepts we STARTED to tackle:
Variables
A box with content for me:
Step 1: Declare:
let a;
Step 2: Assign value:
a=30;
a=a+1;
a=a-3;
a = b+12; // assuming b was declared before, and already has an initial value
Note: you can also declare and assign on the same command:
let x = 100;
WHERE AND HOW TO USE IT!? - We've just started to see...
Loops
As mentioned before - the function draw() is called repeatedly by the computer. This is ONE WAY for "looping". (we'll learn other ways to loop soon)
we started to understand the power of something that happens again and again with a slight change.
Variables within loops
We started to understand that variables within loop can change themselves repeatedly, like a=a+1 again and again and again, or x=x*0.9 or b=b-3......
Assignments
We played "freely" with variables within the function draw(): move, resize and color shapes with (and without) refreshing the background on each round getting 2 different effects
Purim vacation 16/3/2022
Week 4
Lesson 5 21/3/2022
Content
We advanced in understanding variables and what can be done with them:
variables - recap and refine...
Arguments (to a function):
circle (a. 100, 50);
use 'a' by itself , or use a+7, a*2, etc. --> as arguments circle(a*2, b-3, c/5);
"Feed" other variables:
x=y+15;
Self assign:
x=x+5; x=x/2; x=x*3.5;
Functions and variables --> arguments: expectation, internal usage, external usage
Use as arguments within functions:
function flower(x,y) { circle (x,y,40); rect(x-15,y-15,30); }
when calling flower, you MUST provide 2 raguments. they can be numbers of variables.
variables of type "string" - (we didn't mention the term. we just called it text within a variable)
let myText = "100"; let x="hi arnon";
print (x); // prints stuff to the console (useful for the developer herself)
text("hi", 10,40); //place the text "hi" in x=10. y=40 on the canvas itself !!
Administrations
Note above - your sketches folder is now publicly accessible. Please let me know if you have a problem with it, personally. I confirmed with kids in the class today that it's cool.
Methodologies
We omitted (commented out or just deleted) the function draw() for the rest of the day today
Assignments
create a flower function that takes 2 arguments x,y
maybe 3: x,y,hue or x,y,size
lesson 6 23/3/2022
Content
colors - HSB mode
//after writing: colorMode (HSB, 255); // we no longer use RGB (Red Green Blue) color mode, but rather Hue Saturation Brightness
---> This allows us convenient flow between hue גוונים of colors, for instance when creating a rainbow style gradual visuals
FOR loops.
for (let i=0; i<100; i = i+1) { //body of the loop in here }
4 parts to the FOR loop:
Loop declaration:
1. initiation
2. condition (as long as i<100 execute the body of the loop)
3. advance (i=i+1; or any other action that may be limited by the condition (i<100))
4. Loop body
Methodologies
We still tried to work without the function draw() so that we don't get confused between the FOR loop and draw() (which works as a loop by itself, as it's being called again and again by "the system")
Assignments
At class
Rainbow - we started to play with gradual color changes (using the HUE value of our drawings)
You mainly played freely with your own function and with a FOR loop
At home - a small recap homework assignment for you all, to do at the beginning of April, between 1-3 of April:
Read through my shared summary and spend a few minutes to think and share thoughts about project you'll work on in our following lesson (on 6/4/2022)
The condition can be based on math, like X>50 (which will be true if, for instance x is 100 or x is 51... but will be false if, for instance, x is 30 or x is even 50 !)
The condition can be a logical variable or a logical statement. for instance:
let x=true; if (x) { print ("YES!"); }
"Yes!" will be printed in this case
Assingments
A blip
a growing circle, until a limited radius, then starting over.
A bouncing ball
Right-left
Right-left & up-down
Lesson 9 27/4/2022
Content
Recap IF with an exercise (see "Assignment" below)