23: More Useful Functions in p5.js: How to Code Generative Art

Subscribers:
6,240
Published on ● Video Link: https://www.youtube.com/watch?v=lNxMKPGSpBQ



Category:
Guide
Duration: 15:10
633 views
31


Another video in the series on How to Code Generative Art using p5.js. In this video, I'm going over a bunch of different things that I couldn't fit in the other videos, but that I think are useful. This includes several filters for modifying color, a shadow effect, a gradient effect, resizing the canvas, getting the time it takes for parts of your code to work, using a Gaussian distribution to make shadow edges, and some other useful functions. # beginner's guide to coding, getting started generative art p5js.

The playlist: https://www.youtube.com/playlist?list=PLnJOmsprq3bE0QLbe7wZ8yb1-Dt0FBcP5

Grid art with blur and posterize:
https://editor.p5js.org/StevesMakerspace/sketches/yUiK195H5

Reference for linear gradient:
https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient

Easy canvas resize:
https://editor.p5js.org/StevesMakerspace/sketches/OAPpXMTC_

Getting time passed:
https://editor.p5js.org/StevesMakerspace/sketches/5YxtfMBDR

Gaussian distribution edges:
https://editor.p5js.org/StevesMakerspace/sketches/m1xg_A6nZ

Video on shadow edges:
https://youtu.be/IY9bYwWiGLs?si=Wca7ka__khiiDjii

Here is the syntax to go with some of the native JavaScript functions:
drawingContext.filter = `hue-rotate(${hueShift}deg)`;
drawingContext.filter = 'blur(12px)';
drawingContext.filter = 'drop-shadow(10px 15px 10px black)'; //offsetX offsetY shadowBlur shadowColor

See the code links above for examples of each.

https://p5js.org/

Join my Discord: https://discord.gg/FSW6zzU

Follow me on Twitter: https://twitter.com/SteveMakerspace

Steve's Patreon page: https://www.patreon.com/steves_makerspace




Other Videos By Steve's Makerspace


2024-01-0724: Where to go from here; the creative process; big list of resources: How to Code Generative Art
2024-01-0523: More Useful Functions in p5.js: How to Code Generative Art
2024-01-0322: Deeper Dive into Color in p5.js: How to Code Generative Art
2024-01-0121: Return, Break & Continue in p5.js: How to Code Generative Art
2023-12-3020: Intro to WEBGL-3D Graphics in p5.js: How to Code Generative Art
2023-12-2819: Clipping Function in p5.js: How to Code Generative Art
2023-12-2618: Perlin Noise Flow Fields in p5.js: How to Code Generative Art
2023-12-2417: Perlin Noise Grid Project in p5.js: How to Code Generative Art
2023-12-2216: Introduction to Perlin Noise in p5.js: How to Code Generative Art
2023-12-2015: Sine and Cosine to make wonky circles and meandering lines in p5.js: How to Code Generative Art
2023-12-1814: Array Examples from Steve's Projects in p5.js: How to Code Generative Art
2023-12-1813: Basics of Arrays in p5.js: How to Code Generative Art
2023-12-1611: Using a Buffer Canvas - createGraphics, Get, Image, Tint in p5.js: How to Code Generative Art
2023-12-1410: Creating Functions in p5.js: How to Code Generative Art
2023-12-139: On Being a Generative Artist - How to Code Generative Art - p5.js
2023-12-128: Translate and Rotate in p5.js: How to Code Generative Art
2023-12-117: Custom Shapes - Vertex and curveVertex in p5.js: How to Code Generative Art
2023-12-096: If - Else plus AND, OR, and NOT in p5.js: How to Code Generative Art
2023-12-075: For Loops and While Loops in p5.js: How to Code Generative Art
2023-12-064: Variables plus Math Shortcuts in p5.js: How to Code Generative Art
2023-12-053: Shapes plus Random function in p5.js: How to Code Generative Art



Tags:
getting started coding p5js
getting start p5js
how to code p5js
how to code generative art
learn generative art
beginner's guide p5.js
beginner's guide generative art
p5js filter
javascript filter
p5js gradient
javascript gradient
p5js posterize
p5js shadow
p5js drop shadow
javascript shadow
javascript drop shadow
p5js gaussian
p5js time
p5js canvas resize