Start here!

This week we were introduced to the p5 editor (first time for me!) and its basics.

I learnt how p5 is set up and how to make simple shapes:


Also how to make those shapes move:

*comments can be found in code


Some things I learnt:

  • function setup ( ) is for defining environment properties (such as canvas size and bg colour), which will only run once
  • function draw ( ) is for the ‘main’ part of the sketch, which automatically runs next and will continually loop at 60 frames per second
  • ( ) specifies the argument, while { } specifies the function’s scope

When we were given the task to explore p5 on our own and create a square in the middle, I originally tried placing the square in the setup function and the global scope- when this didn’t work, we found that it could only execute within the scope of the draw function.

We also talked a bit about colour and frameRate ( ), which helps us keep track of how many times the draw function has been looping. This is how we started making our squares move around- super cool! Thomas also taught us how to change the opacity of fill using RGBA, where the A (alpha channel) controls how opaque the colour is, from 0-1.



I’ve since been browsing through the p5 Libraries and examples to get inspiration for my own project. The p5 Reference page also has so many interesting things to try out, like this cute flower made from rotated ellipses that I played around with:

Challenges

We also had to set up our Github blogs which proved to be a lot more challenging than first thought. I ran into some issues such as being unable to install Homebrew because my Mac didn’t have the Xcode software. Then it took a very long time to install chruby and ruby because my computer didn’t want to install the latest version needed for Jekyll. This is where I was able to actively learn from my community of practice (CoP) as my peers and I worked together to figure out how we could overcome these issues. My fellow friend and Mac-user Vivian showed me an extremely helpful tutorial playlist by Bill Raymond, who walked us through the entire process of setting up the blog. Now we’re up and running!


Next

Back to home