Coding Challenge #20: 3D Cloth with toxiclibs

  Рет қаралды 94,533

The Coding Train

The Coding Train

Күн бұрын

Пікірлер: 77
@feliperibeirosilva900
@feliperibeirosilva900 4 жыл бұрын
I compleated this video in 2021 you need to here are all the fixes: - get toxiclibs inside software sketch>Import library>add library > type "Toxiclibs" - when he mentions the ambiguity you need to type 2D or 3D at the end of the words to fix every time. everything else should work exactly as he mentioned great tutorial cheers.
@CarlosRoxo
@CarlosRoxo 3 жыл бұрын
Thx man, that rly helped a ton
@AdrienDepaillat
@AdrienDepaillat 7 жыл бұрын
The last diagonal springs should not have a resting length of "w", but rather w*sqrt(2), otherwise they'll induce a "diagonal tension" to the whole thing, making this a weird hammock-like shape. You can easily add this in the Spring constructor you added. Thanks so much for the videos! It's really great to follow along and learn!
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
Great tips, thank you!!!
@paladin1147
@paladin1147 5 жыл бұрын
Nice, that is an amazing tip, how can one think like how you thought out w*sqrt(2)
@AdrienDepaillat
@AdrienDepaillat 5 жыл бұрын
@@paladin1147 I just had in mind the characteristic lengths of a square. You get the sqrt(2) with Pythagore's theorem for a square of side length 1. That plus the feeling that there were tension induced as if the diagonal springs were not in their resting position from the beginning. Cheers!
@ScarlettNour
@ScarlettNour 8 жыл бұрын
(TLDR;) Thanks so much for posting, and being passionate about coding, and for taking the time to share it around the web! I've started learning to cod because of you, and never thought this could be so cool! (The full story) I found the Purple Rain challenge completely by accident a few weeks ago. Google just put it there on my recommended pages god knows why. I've always wanted to learn to code, because it seemed like a nice skill to have, or just to have some fun, but everyone makes it look so BORING. And there's so much stuff out there about it, I was just completely lost. I learned a tiny bit of html when I was, I don't know, 13, but that's it. It was a bit of a disaster, in fact. After that I always thought "Blergh, maybe it's not for me, you know? I know shit about maths and stuff like that, anyway, and people say to code you need to know math or something?". But after watching that challenge you were so fun, and you made it all look so easy, even if I wasn't understanding sh*t of what you were saying. So I just kept watching. And before I knew I'd watched half the playlist of coding challenges and I was starting to understand a tiny bit of what you were doing. And then I looked up Processing, because why not, and I feel in love, a little bit. Now I'm following the playlists to learn how to code with it, and I'm so, so, so glad I've watched that first vid! Thanks for everything!
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
I red the full story, because I just love hearing stuff like this. Thank you for watching and the nice feedback!
@Jimanator
@Jimanator 8 жыл бұрын
i noticed the unconnected corner when you first did the springs in 2d, i'm glad you found the problem before the end of the video, even if it was very close.
@041e71
@041e71 8 жыл бұрын
thank you so much for these entertaining videos. i usually watch while drinking my morning coffee and its always a good start for the day! plus i learn a lot of stuff !
@nmkloster
@nmkloster 8 жыл бұрын
I was literally waiting for 27:25 ever since 18:40 - "Yeah, yeah. This is gonna work." I fully acknowledge that this is a weird thing to get excited about :)
@ABaumstumpf
@ABaumstumpf 8 жыл бұрын
Yeah. always a bitch when you have to think about the start/end of such constructions.
@sparks2994
@sparks2994 8 жыл бұрын
I absolutely lost it. Thank you.
@HaLo2FrEeEk
@HaLo2FrEeEk 8 жыл бұрын
Me too! Literally as soon as he said it I thought about the right and bottom sides.
@ryanzarmbinski7446
@ryanzarmbinski7446 7 жыл бұрын
Lol me too
@reaktormannen
@reaktormannen 3 жыл бұрын
I have never seen anyone so high on coding ;-) Keep up the good work, your tuts are excellent!
@Ardavan47
@Ardavan47 8 жыл бұрын
Love you and your channel, PLEASE make a video about your daily work routine and how you can keep focus
@ReevansElectro
@ReevansElectro 8 жыл бұрын
And now we are going to add a happy little spring here.
@hazengalilei2643
@hazengalilei2643 4 жыл бұрын
Pixar Spring: Destroyer of Worlds COMING TO THEATERS THIS DECEMBER
@quicksanddiver
@quicksanddiver 8 жыл бұрын
I love your Coding Challenges! They are so exciting! Me watching you code must be about the equivalent of normal people watching baseball :D
@xnick_uy
@xnick_uy 8 жыл бұрын
I'd say toxiclibs has also added some damping force to the springs by default. Otherwise the "cloth" would keep bouncing forever.
@gloubiboulgazeblob
@gloubiboulgazeblob 5 жыл бұрын
wow...that's very impressive !
@ABaumstumpf
@ABaumstumpf 8 жыл бұрын
The strange form of the "cloth" at the end does not come form forgetting the last row, but from the last diagonal spring you added: It now makes it harder for the square to change the shape along that diagonal, but not the second one.
@mollykaplanoflos
@mollykaplanoflos 7 жыл бұрын
If you get the error > Cannot find a class or type named "GravityBehavior" < change all instances of "GravityBehavior" to "GravityBehavior2D" and that should give you the green!
@barryryan5187
@barryryan5187 2 жыл бұрын
thank you!
@Итальянец1945
@Итальянец1945 2 жыл бұрын
Thanks, I got similar errors, but i just added 2D/3D everywhere there was one and it worked.
@swaleedkhalid
@swaleedkhalid 7 жыл бұрын
you make me love programming. I wonder how easily you creates things and make formulas to work... great work
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
Thanks for watching!
@Illusionaire1
@Illusionaire1 8 жыл бұрын
Every time you say "The Grid" I hear it as being spoken by Jeff Bridges in Tron
@timeslongpast
@timeslongpast 8 жыл бұрын
Illusionaire1 I feel like not many people appreciate this joke as much as I do
@Dong_Harvey
@Dong_Harvey 8 жыл бұрын
by simply using the same code for the mousePressed, Dragged, and Released functions in the DraggableParticles example from the toxiclibs example library, you can actually drag the cloth around and have functioning code.. you will have to import a java-iterator library and initialize a few variables though..
@moiquiregardevideo
@moiquiregardevideo 5 жыл бұрын
Only 56 comments after almost 3 years. Apparently, no teacher forced their class to look at this video with as proof the request to click "like" and write a comment. This simulation looks surprisingly natural the way the cloth bounces and fold.
@MihirrPanchaal
@MihirrPanchaal 7 жыл бұрын
That was so cool!!!
@HekoBoii
@HekoBoii 8 жыл бұрын
You are my hero.
@SimonK91
@SimonK91 7 жыл бұрын
Reasons why it behaved oddly: #1 - locking particle[cols-1][rows-1]: You connected all the springs from [0][0] to [cols-2][rows-2] with the one to its right and below. This means that [cols-1][0] to [cols-1][rows-1] will not be connected with the one below it, and [0][rows-1] to [cols-1][rows-1] will not be connected to the one to its right, thus [cols-1][rows-1] have no springs #2 - diagonal springs: The springs going diagonal had the length 1 instead of sqrt(2), thus they were pulling the cloth to the top left corner (since the corner was locked and the diagonal spring was in that direction)
@SimonK91
@SimonK91 7 жыл бұрын
Whoops, just now saw that it's a very old video. :D
@adrmetal
@adrmetal 7 жыл бұрын
Could you do a Challenge to visualize Crochet patterns? Like Crochet and Knitting, maybe a scarf or a sphere. I see much of what you did here useful for that. Maybe even possible to apply to "Cloth design simulation", who knows.
@paladin1147
@paladin1147 5 жыл бұрын
Amazing video, thanks for making a not so interesting topic for me so fun and interesting :D
@MertHakim-ns9os
@MertHakim-ns9os 11 ай бұрын
bu gidişle son oyuncu gibi çökerler
@yowojtas
@yowojtas 8 жыл бұрын
wow - thats the word i'm looking for
@asston712
@asston712 6 жыл бұрын
This is easy: makeCloth(); Cloth.animate(); Done.
@stebs01
@stebs01 8 жыл бұрын
is it possible to recreate this by using vertices and perlin noise like you did in your video on randomly generating terrain?
@Shockszzbyyous
@Shockszzbyyous 8 жыл бұрын
I Really like this vid :)
@FredoCorleone
@FredoCorleone 6 жыл бұрын
Here you do with a 2D array and in the GitHub repo you did it with a flat array... Kinda confused, why? I've just made up the same blanket simulation and I've also added mouse interaction using an AcctractionBehavior, but I don't understand why when I interact with the blanket it destroys in pieces :/ Any suggestion? Thanks in advance
@stephenmcconnell7868
@stephenmcconnell7868 4 жыл бұрын
I’m running processing via a straight Java implementation and would like to just pull in the “jar” file or do it through Maven. However, there Is no Maven Artifact AND the last update I find in GitHub is 2014, with the "official" Bitbucket site the toxiclibs.org points to not existing any more. Where do I get the toxiclibs now? Is it an active project?
@stephenmcconnell7868
@stephenmcconnell7868 4 жыл бұрын
@Karsten Schmidt Thanks. They guy who wrote Toxiclibs has changed it over to Clojure. This is an interesting language, so I will be downloading toxiclibs from your link, but I will be learning Clojure and maybe doing your stuff in Clojure..... for fun (Ins’t being retired a gas?).
@feliperibeirosilva900
@feliperibeirosilva900 4 жыл бұрын
@Karsten Schmidt thanks for the link ,lifesaver -- I am not sure if it works but nwo you can actually instal form the contribution manager sketch>Import library>add library > type "Toxiclibs"
@eleazarherrera9268
@eleazarherrera9268 7 жыл бұрын
Hi Daniel! I like your videos! I have a problem with toxiclibs library in the sketch. I have an error: The package "toxi.physics3d" does not exist. You might be missing a library. I downloaded the library, the sketch in 2D run correctly but not in 3D.
@TF2Gaming101
@TF2Gaming101 6 жыл бұрын
This reminds me of bridge builder games
@alexlutz2221
@alexlutz2221 6 жыл бұрын
I challenge you to make a simple 3d modeling software
@BoaZosen
@BoaZosen 6 жыл бұрын
When I change the Particle ArrayList into Particle[ ] [ ] i get an error saying that the class does not exist. How do I fix that?
@ritageraghty4404
@ritageraghty4404 6 жыл бұрын
You are freakin' awesomest! 😳 (Joking) I wish I could kidnap you and steal your brain for transplant. Thank you for making this tutorial.
@ankitaaarya
@ankitaaarya 5 жыл бұрын
Weird but ok
@yakov9ify
@yakov9ify 8 жыл бұрын
is there a way to change the mass of a particle
@ling6701
@ling6701 5 жыл бұрын
Is there any p5js code version of this tutorial ?
@dannyshf1993
@dannyshf1993 8 жыл бұрын
what about downloading the toxiclib folder in window 8, i attempted to put the folder shortcut to the processing library but i fail, help?
@dannyshf1993
@dannyshf1993 8 жыл бұрын
nvm i ve got it
@Holycrabbe
@Holycrabbe 3 жыл бұрын
I know im 5 years late, but it seams like toxiclibs has moved to github and there i dont find any "complete files", leaving me a little clueless as to how i can integrate it in my web build. I would for one love if you would make a video showing how to download and apply toxiclibs today
@DD-vc7fq
@DD-vc7fq 8 жыл бұрын
which font is that in your code?
@knowledgemagnet4077
@knowledgemagnet4077 6 жыл бұрын
The GravityBehaviour is Ambiguous still.
@knowledgemagnet4077
@knowledgemagnet4077 6 жыл бұрын
In 2D.
@paladin1147
@paladin1147 5 жыл бұрын
@@knowledgemagnet4077 physics.addBehavior(new GravityBehavior2D(new Vec2D(0,0.1))); write this instead
@knowledgemagnet4077
@knowledgemagnet4077 5 жыл бұрын
@@paladin1147 thank u
@Happ1ness
@Happ1ness 5 жыл бұрын
Does it work on android?
@natanaelbara3294
@natanaelbara3294 5 жыл бұрын
Does not work ( toxi could not be resolved) Hello from Romania
@moiquiregardevideo
@moiquiregardevideo 5 жыл бұрын
Effectively, a forth spring should be added between b1 and b2 to make the cloth elasticity symetrical. Ideally, strength of the two diagonal springs should be 0.707 weaker to avoid the clothes to wrinkle too much in diagonal direction.
@graham4159
@graham4159 8 жыл бұрын
What language is that?
@christianegutter2339
@christianegutter2339 8 жыл бұрын
Procressing. It's like javascript, but...easier you might say.
@jmfairlie
@jmfairlie 8 жыл бұрын
Graham it's Java
@tmeekins42
@tmeekins42 3 жыл бұрын
btw, it's pronounced "ver-lay."
@rashmysajin4520
@rashmysajin4520 3 жыл бұрын
Coderr
@chrisanderson5527
@chrisanderson5527 8 жыл бұрын
It's pronounced vur-lay not vur-let.
@aliatabak7315
@aliatabak7315 7 жыл бұрын
ne işşizsiniz ya. adam kodla elbise çiziyor anime ediyor. helal olsun. ama anlatımını çok begenmedim.
@EliSmith
@EliSmith 6 жыл бұрын
The coding style you use is not a good one to teach people, it's very hard coded and messy, please work on having clean code, proper use of variables and repetitive code. It feels like code that's written once and never touched again(I know it isn't touched again, but it's not a good way to teach people). One thing I can't stand while watching is the really pointless variable names, a1, b1, b2? It's not descriptive at all! I know you have the skills and the mindset, but it's so messy and sloppy, it makes it really hard to watch as a programmer who tries hard to write clean code.
@hazengalilei2643
@hazengalilei2643 4 жыл бұрын
i actually like the way he codes. He also explains his code out loud. I learned processing straight from this guy through these vids.
5.17: Introduction to Matter.js - The Nature of Code
32:25
The Coding Train
Рет қаралды 212 М.
Coding Challenge 63.2: Texturing Cloth Simulation
23:02
The Coding Train
Рет қаралды 40 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
Coding Challenge 181: Weighted Voronoi Stippling
28:59
The Coding Train
Рет қаралды 180 М.
Coding Challenge #7: Solar System in Processing - Part 1 (2D)
30:47
The Coding Train
Рет қаралды 243 М.
Coding Challenge 160: Spring Forces
32:43
The Coding Train
Рет қаралды 105 М.
Coding Challenge 93: Double Pendulum
31:11
The Coding Train
Рет қаралды 922 М.
Coding Challenge #50.1: Animated Circle Packing - Part 1
28:32
The Coding Train
Рет қаралды 252 М.
How Games Simulate Cloth & Ropes
12:16
DepthBuffer
Рет қаралды 79 М.
Coding Adventure: Chess
29:22
Sebastian Lague
Рет қаралды 3,8 МЛН
Coding Challenge #138: Angry Birds with Matter.js
41:36
The Coding Train
Рет қаралды 219 М.
Coding Challenge 183: Paper Marbling Algorithm
32:10
The Coding Train
Рет қаралды 80 М.
When Optimisations Work, But for the Wrong Reasons
22:19
SimonDev
Рет қаралды 1,1 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН