15 February 2018

Processing Basics

Programs look like this. These are the two fundamental functions present in a processing program.

void setup()
{
    //code that runs once
}
void draw()
{
    //code that loops
}

What does line(a,b,c,d) do?

What does ellipse(a,b,c,d) do?

What does rect(a,b,c,d) do?

What does point(a,b) do?

What arguments does triangle accept? What is its action?

Let's write a program that demonstrates their action.

void setup()
{
    //code that runs once
}
void draw()
{
    //code that loops
}

What do fill and stroke do? What are all of the ways to use these? What about background?