Coding Challenge #60: Butterfly Generator
Inspired by Everest Pipkinโs Moth Generator, I use trigonometry and perlin noise to procedurally generate butterfly wing designs with p5.js. Code: https://thecodingtrain.com/challenges/60-butterfly-generator
๐น๏ธ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/tKBc2fP8r
๐ฅ Previous video: https://youtu.be/4hA7G3gup-4?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ฅ Next video: https://youtu.be/0dwJ-bkJwDI?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ฅ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
๐๏ธ Moth Generator: https://twitter.com/mothgenerator
๐ Rose (mathematics) on Wikipedia: https://en.wikipedia.org/wiki/Rose_(mathematics)
Videos:
๐ฅ Trigonometry and Polar Coordinates - The Nature of Code: https://youtu.be/znOBmOrtz_M
๐ฅ What is Perlin Noise?: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6bgPNQAdxQZpJuJCjeOr7VD
๐ด Live Stream Archive #80: https://youtu.be/bMOv5vTC9uE?t=3431s
Related Coding Challenges:
๐ #36 Blobby!: https://youtu.be/rX5p-QRP6R4
๐ #55 Mathematical Rose Patterns: https://youtu.be/f5QBExMNB1I
๐ #134 Heart Curve: https://youtu.be/oUBAi9xQ2X4
๐ #136 Polar Noise Loops: https://youtu.be/ZI1dmHv3MeM
Timestamps:
0:00 Introduce coding challenge
0:17 Highlight project which inspires the coding challenge
1:13 Explain symmetrical drawing and polar coordinates
2:45 Let's code
3:04 Draw one of the butterfly's wings
4:09 Translate canvas to center the drawing
4:41 Draw points
5:25 Draw the wing with a line
6:18 Introduce Perlin Noise
7:08 Implement Perlin Noise
8:23 Experiment with noise arguments
9:06 Draw the other wing symmetrically
10:55 Draw a continous shape
13:20 Highlight math to draw roses with polar coordinates
13:49 Include math in the coding challenge
14:44 Reintroduce noise
15:26 Experiment with different values
16:06 Animate drawing changing the noise values
16:45 Implement Perlin Noise in multiple dimensions
18:00 Conclude coding challenge
18:40 Consider comments from the chat
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
๐ Website: http://thecodingtrain.com/
๐พ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
๐ฉ Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
๐ก GitHub: https://github.com/CodingTrain
๐ฌ Discord: https://thecodingtrain.com/discord
๐ Membership: http://youtube.com/thecodingtrain/join
๐ Store: https://standard.tv/codingtrain
๐๏ธ Twitter: https://twitter.com/thecodingtrain
๐ธ Instagram: https://www.instagram.com/the.coding.train/
๐ฅ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ฅ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
๐ p5.js: https://p5js.org
๐ p5.js Web Editor: https://editor.p5js.org/
๐ Processing: https://processing.org
๐ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new
#butterflywings #perlinnoise #polarcoordinates #javascript #p5js