In this coding challenge, I implement a "Poisson-disc Sampling" algorithm to evenly (but randomly) distribute a set of seed points throughout a canvas. The algorithm is implemented in JavaScript using p5.js. Code: thecodingtrain.com/challenges...
🕹️ p5.js Web Editor Sketch: editor.p5js.org/codingtrain/s...
🎥 Previous video: • Coding Challenge #32.1...
🎥 Next video: • Coding Challenge #34: ...
🎥 All videos: • Coding Challenges
References:
🔗 Poisson Disc: www.jasondavies.com/poisson-d...
📄 Paper on Fast Poisson Disc Sampling in Multiple Dimensions: www.cs.ubc.ca/~rbridson/docs/b...
Live Stream Archive:
🔴 Coding Train Live 56: • Live Stream #56: Poiss...
Related Coding Challenges:
🚂 #98 Quadtree: • Coding Challenge #98.1...
🚂 #70 Nearest Neighbors Recommendation Engine: • Coding Challenge #70: ...
🚂 #95 Approximating the Value of Pi: • Coding Challenge 95: A...
Timestamps:
0:00 Introduction to Poisson Disc Sampling!
1:30 Starting to code!
3:00 Creating a 2D background grid
6:52 Inserting initial sample into a random position in the grid
10:25 Creating an active list of points
14:40 Generating up to k points
19:18 Checking neighboring samples
25:40 Removing inactive points from list
27:30 Debugging
36:50 Playing with the code!
41:25 Things you can do!
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
🚂 Website: thecodingtrain.com/
👾 Share Your Creation! thecodingtrain.com/guides/pas...
🚩 Suggest Topics: github.com/CodingTrain/Sugges...
💡 GitHub: github.com/CodingTrain
💬 Discord: thecodingtrain.com/discord
💖 Membership: ru-vid.comjoin
🛒 Store: standard.tv/codingtrain
🖋️ Twitter: / thecodingtrain
📸 Instagram: / the.coding.train
🎥 Coding Challenges: • Coding Challenges
🎥 Intro to Programming: • Start learning here!
🔗 p5.js: p5js.org
🔗 p5.js Web Editor: editor.p5js.org/
🔗 Processing: processing.org
📄 Code of Conduct: github.com/CodingTrain/Code-o...
This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...
#poissondiscsampling #simondenispoisson #p5js #processing
30 июл 2024