Coding Challenge #20: 3D Cloth with toxiclibs

Поделиться
HTML-код
  • Опубликовано: 21 янв 2025

Комментарии • 77

  • @feliperibeirosilva900
    @feliperibeirosilva900 4 года назад +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 лет назад +25

    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 лет назад +6

      Great tips, thank you!!!

    • @paladin1147
      @paladin1147 5 лет назад +2

      Nice, that is an amazing tip, how can one think like how you thought out w*sqrt(2)

    • @AdrienDepaillat
      @AdrienDepaillat 5 лет назад +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!

  • @041e71
    @041e71 8 лет назад +5

    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 !

  • @ScarlettNour
    @ScarlettNour 8 лет назад +59

    (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 лет назад +20

      I red the full story, because I just love hearing stuff like this. Thank you for watching and the nice feedback!

  • @Jimanator
    @Jimanator 8 лет назад +6

    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.

  • @reaktormannen
    @reaktormannen 3 года назад

    I have never seen anyone so high on coding ;-) Keep up the good work, your tuts are excellent!

  • @nmkloster
    @nmkloster 8 лет назад +16

    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 лет назад +1

      Yeah. always a bitch when you have to think about the start/end of such constructions.

    • @sparks2994
      @sparks2994 8 лет назад +1

      I absolutely lost it. Thank you.

    • @HaLo2FrEeEk
      @HaLo2FrEeEk 8 лет назад +2

      Me too! Literally as soon as he said it I thought about the right and bottom sides.

    • @ryanzarmbinski7446
      @ryanzarmbinski7446 7 лет назад

      Lol me too

  • @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

  • @ReevansElectro
    @ReevansElectro 8 лет назад +41

    And now we are going to add a happy little spring here.

    • @hazengalilei2643
      @hazengalilei2643 4 года назад +1

      Pixar Spring: Destroyer of Worlds
      COMING TO THEATERS THIS DECEMBER

  • @Ardavan47
    @Ardavan47 8 лет назад +10

    Love you and your channel,
    PLEASE make a video about your daily work routine and how you can keep focus

  • @swaleedkhalid
    @swaleedkhalid 8 лет назад

    you make me love programming. I wonder how easily you creates things and make formulas to work... great work

  • @ABaumstumpf
    @ABaumstumpf 8 лет назад +1

    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.

  • @xnick_uy
    @xnick_uy 8 лет назад +3

    I'd say toxiclibs has also added some damping force to the springs by default. Otherwise the "cloth" would keep bouncing forever.

  • @Illusionaire1
    @Illusionaire1 8 лет назад +10

    Every time you say "The Grid" I hear it as being spoken by Jeff Bridges in Tron

    • @timeslongpast
      @timeslongpast 8 лет назад +6

      Illusionaire1 I feel like not many people appreciate this joke as much as I do

  • @gloubiboulgazeblob
    @gloubiboulgazeblob 5 лет назад +1

    wow...that's very impressive !

  • @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.

  • @Dong_Harvey
    @Dong_Harvey 8 лет назад +1

    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..

  • @mollykaplanoflos
    @mollykaplanoflos 7 лет назад +12

    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.

  • @stebs01
    @stebs01 8 лет назад +2

    is it possible to recreate this by using vertices and perlin noise like you did in your video on randomly generating terrain?

  • @paladin1147
    @paladin1147 5 лет назад

    Amazing video, thanks for making a not so interesting topic for me so fun and interesting :D

  • @MihirrPanchaal
    @MihirrPanchaal 8 лет назад

    That was so cool!!!

  • @SimonK91
    @SimonK91 8 лет назад

    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 8 лет назад

      Whoops, just now saw that it's a very old video. :D

  • @adrmetal
    @adrmetal 8 лет назад

    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.

  • @stephenmcconnell7868
    @stephenmcconnell7868 4 года назад +1

    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"

  • @HekoBoii
    @HekoBoii 8 лет назад

    You are my hero.

  • @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

  • @yakov9ify
    @yakov9ify 8 лет назад

    is there a way to change the mass of a particle

  • @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?

  • @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?

  • @yowojtas
    @yowojtas 8 лет назад

    wow - thats the word i'm looking for

  • @DD-vc7fq
    @DD-vc7fq 8 лет назад

    which font is that in your code?

  • @Shockszzbyyous
    @Shockszzbyyous 8 лет назад

    I Really like this vid :)

  • @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.

  • @Happ1ness
    @Happ1ness 5 лет назад

    Does it work on android?

  • @MertHakim-ns9os
    @MertHakim-ns9os Год назад

    bu gidişle son oyuncu gibi çökerler

  • @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.

  • @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

  • @TF2Gaming101
    @TF2Gaming101 6 лет назад

    This reminds me of bridge builder games

  • @graham4159
    @graham4159 8 лет назад

    What language is that?

    • @christianegutter2339
      @christianegutter2339 8 лет назад

      Procressing. It's like javascript, but...easier you might say.

    • @jmfairlie
      @jmfairlie 8 лет назад +1

      Graham it's Java

  • @ritageraghty4404
    @ritageraghty4404 6 лет назад +1

    You are freakin' awesomest! 😳 (Joking) I wish I could kidnap you and steal your brain for transplant. Thank you for making this tutorial.

  • @alexlutz2221
    @alexlutz2221 6 лет назад

    I challenge you to make a simple 3d modeling software

  • @asston712
    @asston712 6 лет назад +14

    This is easy:
    makeCloth();
    Cloth.animate();
    Done.

  • @knowledgemagnet4077
    @knowledgemagnet4077 6 лет назад

    The GravityBehaviour is Ambiguous still.

  • @tmeekins42
    @tmeekins42 3 года назад

    btw, it's pronounced "ver-lay."

  • @chrisanderson5527
    @chrisanderson5527 8 лет назад +4

    It's pronounced vur-lay not vur-let.

  • @rashmysajin4520
    @rashmysajin4520 3 года назад

    Coderr

  • @aliatabak7315
    @aliatabak7315 7 лет назад

    ne işşizsiniz ya. adam kodla elbise çiziyor anime ediyor. helal olsun. ama anlatımını çok begenmedim.

  • @EliSmith
    @EliSmith 6 лет назад +1

    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.