MENU

Fun & Interesting

Coding Challenge #24: Perlin Noise Flow Field

The Coding Train 369,309 9 years ago
Video Not Working? Fix It Now

In this coding challenge, I use Perlin noise to create a two-dimensional flow field with the p5.js library. Code: https://thecodingtrain.com/challenges/24-perlin-noise-flow-field ๐Ÿ•น๏ธ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/vDcIAbfg7 ๐ŸŽฅ Previous video: https://youtu.be/ksRoh-10lak?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH ๐ŸŽฅ Next video: https://youtu.be/RkuBWEkBrZA?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH ๐ŸŽฅ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH References: ๐Ÿ—„ p5.js noise() reference: https://p5js.org/reference/#/p5/noise Videos: ๐Ÿ”ด Livestream Archive: https://youtu.be/sor1nwNIP9A ๐ŸŽฅ My videos about Perlin Noise: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6bgPNQAdxQZpJuJCjeOr7VD Related Coding Challenges: ๐Ÿš‚ #11 3D Terrain Generation with Perlin Noise in Processing: https://youtu.be/IKB1hWWedMk ๐Ÿš‚ #132 Fluid Simulation: https://youtu.be/alhpH6ECFvQ ๐Ÿš‚ #C4 - Coding in the Cabana Worley Noise: https://youtu.be/4066MndcyCk Timestamps: 0:00 Introduction 0:35 Two dimensional Perlin noise 2:02 Scale 5:08 Create a vector 5:45 Draw vector as a line 7:09 Random angle 8:10 Flow field 9:24 N-dimensional Perlin noise 9:53 Add zoff 11:56 Add Particle class 15:26 Add particles 16:26 Add edges() 17:34 Have particles be affected by vectors 18:34 Flowfield array 21:00 Follow() 22:56 Set magnitude of vectors 26:42 Add alpha 27:36 Store particle's previous position 27:56 Draw line between current and previous position 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://discord.gg/hPuGy2g ๐Ÿ’– 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 #perlinnoise #arrays #p5js

Comment