Coding Challenge 177: Soft Body Physics
Embark on a squishy adventure as I attempt to create a soft body physics simulation for a character with toxiclibs.js and p5.js! Code: https://thecodingtrain.com/challenges/177-soft-body-character
π Watch this video ad-free on Nebula https://nebula.tv/videos/codingtrain-coding-challenge-177-soft-body-character
p5.js Web Editor Sketches:
πΉοΈ Soft Body Character: https://editor.p5js.org/codingtrain/sketches/2PInK4yQ2
πΉοΈ Soft Body Character Enhanced: https://editor.p5js.org/codingtrain/sketches/6hhdl9omt
πΉοΈ Soft Body Dancing Skeleton: https://editor.p5js.org/codingtrain/sketches/dg1wrHrpg
πΉοΈ Soft Body Letters: https://editor.p5js.org/codingtrain/sketches/8MyUnoi13
πΉοΈ Blank Canvas: https://editor.p5js.org/codingtrain/sketches/ccwlnhtji
π₯ Previous video: https://youtu.be/h5ZNcAPXxew?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
π Nature of Code: https://nature-of-code-2nd-edition.netlify.app/
π ToxicLibs.js: http://haptic-data.com/toxiclibsjs/
π ToxicLibs Java Reference: https://shiffman.github.io/toxiclibs-javadocs/
π Advanced Character Physics: http://www.cs.cmu.edu/afs/cs/academic/class/15462-s13/www/lec_slides/Jakobsen.pdf
π Thi.ng: https://thi.ng/
Videos:
π Toxiclibs Verlet Physics playlist: https://www.youtube.com/watch?v=E67e0RX-7Ew&list=PLRqwX-V7Uu6aiaU4s30tXvUmwGMlb9UUS
π Matter.js playlist: https://www.youtube.com/watch?v=urR596FsU68&list=PLRqwX-V7Uu6bLh3T_4wtrmVHOrOEM1ig_
π₯ Physics of JellyCar: https://youtu.be/3OmkehAJoyo
π₯ The Making of Nokia and Friends: https://www.youtube.com/watch?v=g20QOQP6kSU
Related Coding Challenges:
π 20 3D Cloth with Toxiclibs: https://youtu.be/jrk_lOg_pVA
π 63 Texturing Cloth Simulation: https://youtu.be/JunJzIe0hEo
Timestamps:
0:00 Introduction
2:51 Physics libraries
5:30 Elements in ToxicLibs
5:47 Start coding
7:04 Object destructuring
8:10 Add gravity
9:00 Adding elements to the world
10:35 Updating the physics world
11:40 Adding a spring
15:23 Refactor code
18:07 Inheritance
18:57 Super class
23:31 Spring length
25:44 Create a closed-filled shape to draw the character
26:49 Suggestions for variations
27:07 Other types of springs
27:36 Update about the Nature of Code book!
28:56 Outro
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
π Website: https://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
#softbody #toxiclibs #verletphysics #p5js #javascript