CCI Diploma 2020/2021: Unit 1: Lecture 3: Deciding.
Back to slide index.
Hi!
I'm going to start every lecture with a promise and an artist to reference.
I promise that by the end of this lecture you'll be able to use digital logic to allow your software to make decisions.
The artist of the day is Sol LeWitt. Sol was a pioneer in minimalist and conceptual art, drawing up rules or algorithms that then could be carried out by anyone - "The system is the work of art; the visual work of art is the proof of the system". See Solving Sol for JavaScript implementations of his works.
History of Design Systems by Rune Madsen has a series of references on Sol LeWitt and others.
Great recent article on Generative Art by Jason Bailey.
I think alot of Sol's work is about rules, which is why he's perfect for today's lecture - which is on exactly those things!
Today's lecture is titled: Deciding.
By the end of this lecture, you'll know more about:
The main thing I want you keep in mind today is that computers use something called logic to decide what to do. Coding is all about refining sets of rules and consequences to tell a computer how to decide what to do and what do once the decision has been made.
This example: demonstrates the use of an if statement. Let's try it cut and pasted into the p5.js editor. It's important to use { and } to enclose both functions AND if (or switch) statements. Those curly brackets help the computer decide something called scope, which is all about what values variables have.
Let's look at a p5.js numbers example to refresh our memory on the use of if statements and logical comparisons to decide how a program should behave.
Let's take a look at a p5.js example that makes use of three new functions - noLoop(), mousePressed() and redraw().
Before moving on to thinking about three dimensions, let's take a look at a drawing continuous lines p5.js example - what does this new === thing mean? And what about pmouseX? If you ever see something unknown in p5.js, where do you look it up?
Let's take a look at this p5.js example on 1 dimensional distance that makes a simple but pleasing mouse interaction.
To finish up with, let's work through the p5.js tutorial on interactivity - combining all we've learned about using variables and logic to make experiences that react to users in real time. As I always say, "real time or it didn't happen" - or if that was pre-rendered, it's not interactive, it's just a film!
Thanks!
Back to slide index.