Coding Challenge 177: Soft Body Physics @TheCodingTrain
Coding Challenge 177: Soft Body Physics  @TheCodingTrain
Uploaded April 2023 | Updated September 2026, 1 week ago
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: thecodingtrain.com/challenges/177-soft-body-character

πŸš€ Watch this video ad-free on Nebula nebula.tv/videos/codingtrain-coding-challenge-177-soft-body-character

p5.js Web Editor Sketches:
πŸ•ΉοΈ Soft Body Character: editor.p5js.org/codingtrain/sketches/2PInK4yQ2
πŸ•ΉοΈ Soft Body Character Enhanced: editor.p5js.org/codingtrain/sketches/6hhdl9omt
πŸ•ΉοΈ Soft Body Dancing Skeleton: editor.p5js.org/codingtrain/sketches/dg1wrHrpg
πŸ•ΉοΈ Soft Body Letters: editor.p5js.org/codingtrain/sketches/8MyUnoi13
πŸ•ΉοΈ Blank Canvas: editor.p5js.org/codingtrain/sketches/ccwlnhtji

πŸŽ₯ Previous video: youtu.be/h5ZNcAPXxew?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ All videos: youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH

References:
πŸ”— Nature of Code: https://nature-of-code-2nd-edition.netlify.app/
πŸ”— ToxicLibs.js: haptic-data.com/toxiclibsjs
πŸ”— ToxicLibs Java Reference: 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: youtube.com/watch?v=E67e0RX-7Ew&list=PLRqwX-V7Uu6aiaU4s30tXvUmwGMlb9UUS
πŸš‚ Matter.js playlist: youtube.com/watch?v=urR596FsU68&list=PLRqwX-V7Uu6bLh3T_4wtrmVHOrOEM1ig_
πŸŽ₯ Physics of JellyCar: youtu.be/3OmkehAJoyo
πŸŽ₯ The Making of Nokia and Friends: youtube.com/watch?v=g20QOQP6kSU

Related Coding Challenges:
πŸš‚ 20 3D Cloth with Toxiclibs: youtu.be/jrk_lOg_pVA
πŸš‚ 63 Texturing Cloth Simulation: 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: thecodingtrain.com
πŸ‘Ύ Share Your Creation! thecodingtrain.com/guides/passenger-showcase-guide
🚩 Suggest Topics: github.com/CodingTrain/Suggestion-Box
πŸ’‘ GitHub: github.com/CodingTrain
πŸ’¬ Discord: thecodingtrain.com/discord
πŸ’– Membership: youtube.com/thecodingtrain/join
πŸ›’ Store: standard.tv/codingtrain
πŸ–‹οΈ Twitter: twitter.com/thecodingtrain
πŸ“Έ Instagram: instagram.com/the.coding.train

πŸŽ₯ Coding Challenges: youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ Intro to Programming: youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

πŸ”— p5.js: p5js.org
πŸ”— p5.js Web Editor: editor.p5js.org
πŸ”— Processing: processing.org

πŸ“„ Code of Conduct: github.com/CodingTrain/Code-of-Conduct

This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecodingtrain.com/issues/new

#softbody #toxiclibs #verletphysics #p5js #javascript
Coding Challenge 177: Soft Body Physics3.6 Graphing Sine Wave - Nature of CodeA promise is a promise… Jamming with Your Tunes! 🎡 #programming #music #shortsWhat is Transformers.js?Coding Challenge Session: Local Browser Conversational Chatbot (STT, TTS, and more?)Coding Challenge 4: Purple Rain in ProcessingCoding Challenge 180: Falling SandCoding Challenge 171! #shortsMarbling Ink Simulation #javascript #fluidsimulationCoding Challenge 185: Unfolding Fractals16.17: Inheritance in JavaScript - Topics of JavaScript/ES6Coding Challenge #159: Simple Pendulum Simulation
The Coding Train |

Coding Challenge 177: Soft Body Physics

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER