Coding Challenge #20: 3D Cloth with toxiclibs
Boing! Using some particles and some springs with the Toxiclibs physics library, I create a 3D cloth simulation in Processing. Toxiclibs can now be downloaded from Processing's library manager. Code: https://thecodingtrain.com/challenges/20-3d-cloth-simulation
๐น๏ธ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/U6n24GfsD
๐ฅ Previous video: https://youtu.be/z86cx2A4_3E?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ฅ Next video: https://youtu.be/6z7GQewK-Ks?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ฅ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
๐ Toxiclibs Physics Library: http://haptic-data.com/toxiclibsjs
Live Stream Archive:
๐ด Coding Train Live 42: https://youtu.be/nfU-NqnXn1o?t=8453s
Related Coding Challenges:
๐ #62 Plinko with Matter.js: https://youtu.be/KakpnfDv_f0
๐ #159 Simple Pendulum Simulation: https://youtu.be/NBWMtlbbOag
๐ #160 Spring Forces: https://youtu.be/Rr-5HiXquhw
Timestamps:
0:00 Introduction
1:10 What is Verlet Physics?
1:54 Code! Create Particles
5:27 Add Physics to the Particles
6:17 Add Gravity
8:41 Create Springs between Particles
11:51 Lock Particles
13:26 How to make a Cloth?
14:06 Code! Create a Cloth
20:22 Add Gravity back in
21:30 Make it 3 dimensional
24:06 Pin the Cloth on 4 Corners
28:18 What you can do with Toxiclibs
28:40 Where missing some Springs
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from 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
๐ 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
#3d #cloth #physics #simulation #processing #toxiclibs