Uploaded October 2025 | Updated November 2026, 17 hours ago
LET'S CONNECT
β¨ Sign up for my newsletter at pattvira.com
β¨ Instagram: instagram.com/pattvira
β¨ Twitter: twitter.com/pattvira
--
Links:
π p5.js editor: editor.p5js.org
π Interactive Hexagonal Truchet Tiles (w matter.js) Code:
- Starter Code: editor.p5js.org/pattvira/sketches/04cpjnyON
- Final Code: editor.p5js.org/pattvira/sketches/DSuwlZX6p
π Introduction to Creative Coding Playlist: youtube.com/playlist?list=PL0beHPVMklwgMz4Z-mNp4_udo9mjBk7pn&si=XhvQaojd6cIrxvdn
Inspiration:
π RubΓ©n MedellΓn's sketch: openprocessing.org/sketch/2137842
References:
π Truchet Tiles Playlist: youtube.com/playlist?list=PL0beHPVMklwjwHNjK5V1XXnMFKKG9PZOy
π Shoelace formula for finding centroid: en.wikipedia.org/wiki/Shoelace_formula
Timestamps:
0:00 Intro
1:01 Approach (Turning thin strips into pipe geometry)
3:19 PART 1: Begin with a starter code
4:24 Create a pipe for a straight line segment
12:32 Create a pair of pipes for a straight line segment
15:00 Create a pipe for an arc segment
26:26 Create a pair of pipes for an arc segment
30:23 Refactor code by creating a method to keep vertex points
38:00 PART 2: Add matter.js
39:13 Create rectangular bodies
56:23 Approach (Creating matter.js for pipe geometry)
58:48 Calculate centroids
1:01:22 Create a method that creates matter.js pipe bodies
1:08:55 Update bodiesβ position and angle
1:11:11 Glimpse of hope aka FIRST REVEAL!!!
LET'S CONNECT
β¨ Sign up for my newsletter at pattvira.com
β¨ Instagram: instagram.com/pattvira
β¨ Twitter: twitter.com/pattvira
--
Links:
π p5.js editor: editor.p5js.org
π Interactive Hexagonal Truchet Tiles (w matter.js) Code:
- Starter Code: editor.p5js.org/pattvira/sketches/04cpjnyON
- Final Code: editor.p5js.org/pattvira/sketches/DSuwlZX6p
π Introduction to Creative Coding Playlist: youtube.com/playlist?list=PL0beHPVMklwgMz4Z-mNp4_udo9mjBk7pn&si=XhvQaojd6cIrxvdn
Inspiration:
π RubΓ©n MedellΓn's sketch: openprocessing.org/sketch/2137842
References:
π Truchet Tiles Playlist: youtube.com/playlist?list=PL0beHPVMklwjwHNjK5V1XXnMFKKG9PZOy
π Shoelace formula for finding centroid: en.wikipedia.org/wiki/Shoelace_formula
Timestamps:
0:00 Intro
1:01 Approach (Turning thin strips into pipe geometry)
3:19 PART 1: Begin with a starter code
4:24 Create a pipe for a straight line segment
12:32 Create a pair of pipes for a straight line segment
15:00 Create a pipe for an arc segment
26:26 Create a pair of pipes for an arc segment
30:23 Refactor code by creating a method to keep vertex points
38:00 PART 2: Add matter.js
39:13 Create rectangular bodies
56:23 Approach (Creating matter.js for pipe geometry)
58:48 Calculate centroids
1:01:22 Create a method that creates matter.js pipe bodies
1:08:55 Update bodiesβ position and angle
1:11:11 Glimpse of hope aka FIRST REVEAL!!!










![p5.js Coding Tutorial | Habit Tracker (Data Visualization)
LETS CONNECT
β¨ Sign up for my newsletter at https://www.pattvira.com
β¨ Instagram: https://www.instagram.com/pattvira
β¨ Twitter: https://twitter.com/pattvira
Links:
π p5.js editor: https://editor.p5js.org/
π Habit Tracker - Data Visualization Code: https://editor.p5js.org/pattvira/sketches/H9ZGHN8od
π Introduction to Creative Coding Playlist: https://youtube.com/playlist?list=PL0beHPVMklwgMz4Z-mNp4_udo9mjBk7pn&si=XhvQaojd6cIrxvdn
References:
π p5.js p5.Table: https://p5js.org/reference/p5/p5.Table
π findIndex method: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex#syntax
π The Ring of Time by He Yuxuan: https://whynotdesign.cc/The-Ring-of-Time-Typography-Calendar-2022
Timestamps:
0:00 Intro
0:31 Prepare the data
0:58 Upload and preload data into the sketch
2:06 Learn about the p5.Table class
5:31 Create a dates[] array to store all the years dates
7:35 Create a runningDates[] array to store matching date indices
12:40 Draw a spiral
19:32 Add ellipses on the spiral using data from runningDates[]
22:46 Final touches p5.js Coding Tutorial | Habit Tracker (Data Visualization)](https://i.ytimg.com/vi/mQ4Cst7o4Ek/mqdefault.jpg)