Programming Challenge No. 2: Menger Sponge Fractal

Programming Challenge No. 2: Menger Sponge Fractal

HomeThe Coding TrainProgramming Challenge No. 2: Menger Sponge Fractal
Programming Challenge No. 2: Menger Sponge Fractal
ChannelPublish DateThumbnail & View CountDownload Video
Channel AvatarPublish Date not found Thumbnail
0 Views
In this programming challenge I try to program the Menger Sponge (fractals) using Processing. Code: https://thecodingtrain.com/challenges/2-menger-sponge

️ p5.js Web Editor sketch: https://editor.p5js.org/codingtrain/sketches/5kcBUriAy

Previous video: https://youtu.be/17WoOqgXsRM?listPLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
Next video: https://youtu.be/AaGK-fj-BAM?listPLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
All videos: https://www.youtube.com/playlist?listPLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH

References:
Menger sponge on Wikipedia: https://en.wikipedia.org/wiki/Menger_sponge
P3D Tutorial: https://processing.org/tutorials/p3d/
ArrayList in processing: https://processing.org/reference/ArrayList.html

Video:
Fractals in processing: https://www.youtube.com/playlist?listPLRqwX-V7Uu6bXUJvjnMWGU5SmjhI-OXef
Coding Train Live 31: https://youtu.be/Md5LIDW0RyY?t2738

Related coding challenges:
#18 3D Fractal Trees: https://youtu.be/JcopTKXt8L8
#123 Chaos Game: https://youtu.be/7gNzMtYo9n4
#126 Toothpick: https://youtu.be/-OL_sw2MiYw
#129 Koch Fractal Snowflake: https://youtu.be/X8bXDKqMsXE
#168 The Almond Pear: https://youtu.be/NJCiUVGiNyA

Time stamp:
0:00 Welcome to a 10-minute programming challenge!
0:26 Short calculation of the Menger sponge
1:02 Code! Drawing a 3D box in Processing
2:14 Creating a Box class
3:36 Use a Box object instead of the hard-coded Box
4:02 Divide one box into several
6:53 Modelling the Menger sponge as an ArrayList of boxes
7:41 Generate the next iteration with a mouse click
9:47 Bonus time! Add 2 more minutes
10:03 How can I determine which boxes need to be removed?
10:48 Code! Removing the extra boxes
12:12 Improving visual presentation
13:32 Done! The Menger sponge in processing

Edited by Mathieu Blanchette
Animations by Jason Heglund
Music by 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
Shop: https://standard.tv/codingtrain
️ Twitter: https://twitter.com/thecodingtrain
Instagram: https://www.instagram.com/the.coding.train/

Programming Challenges: https://www.youtube.com/playlist?listPLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
Introduction to programming: https://www.youtube.com/playlist?listPLRqwX-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 automatically generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new

#fractal #3d #processing

Please take the opportunity to connect with your friends and family and share this video with them if you find it useful.