tubeshowcase●867,023 videos♡ My collection 0
← Learn to Code

Learn to Code39:10

Coding Challenge #13: Reaction Diffusion Algorithm in p5.js

The Coding Train ↗

From the creator

In this coding challenge, I visualize a Reaction Diffusion simulation using the Gray Scott model in JavaScript (with the p5.js library). Code: https://thecodingtrain.com/challenges/13-reaction-diffusion 🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/govdEW5aE 🎥 Previous video: https://youtu.be/f0lkz2gSsIk?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH 🎥 Next video: https://youtu.be/0jjeOYMjmDU?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH 🎥 All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH References: 📖 Karl Sims' Reaction Diffusion Tutorial: http://karlsims.com/rd.html 📓 2D Array Tutorial: https://processing.org/tutorials/2darray/ 📕 My NOC class on Kadenze: https://www.kadenze.com/courses/the-nature-of-code/info Videos: 🔴 Livestream Archive: https://youtu.be/FYRINCEDVKI?t=6697s Related Coding Challenges: 🚂 #85 The Game of Life: https://youtu.be/FWSR_7kZuYg 🚂 #90 Floyd-Steinberg Dithering: https://youtu.be/0L2n8Tg2FwI 🚂 #103 Fire Effect: https://youtu.be/X0kjv0MozuY Timestamps: 0:00 Introducing today's topic 0:36 The Gray-Scott model 1:41 Key pieces of the algorithm 4:24 Convolutions 7:01 2D arrays 9:00 The grid stores the amount of a and b chemicals across every pixel 10:30 Create another array to store the next generation 11:37 Dealing with the pixel array 12:55 Set the pixel colors based on the amount of a and b 16:14 Write a function to swap the current and next grid 19:30 Add the reaction diffusion formulas to the cod

Published 2016-05-26 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code