Working with Three.js Particle Systems - They're AWESOME!

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

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

  • @DesignCourse
    @DesignCourse  3 года назад +49

    Enjoying the Three.js content? Subscribe up for more!

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

      Love your Three.js content

    • @Giovanni00831
      @Giovanni00831 3 года назад +1

      can I ask, I don't find the cross.png there is a link?

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

      A tip : watch movies on Kaldrostream. Me and my gf have been using them for watching all kinds of movies during the lockdown.

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

      @Chase Ray Yea, I have been watching on KaldroStream for since november myself :)

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

      I can't run the npm i and npm run dev. I kept getting error 😭

  • @Asuuri
    @Asuuri 3 года назад +15

    The three.js Series is so amazing😍👍🏻

  • @Frankslaboratory
    @Frankslaboratory 3 года назад +3

    I love particle systems, looking forward to see what you do with it, will watch later today

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

      frankieeeee is here, big fan of yours man!!! subscribed to your channel and learning alot, actually learning tons from you! you rock Frank!!!

  • @michaelvaughan2888
    @michaelvaughan2888 2 года назад

    seriously the best tutorial on particles, and trust me, I watched a lot of them because I was having a tough time getting mine to work how I wanted, this tutorial is top knotch!

  • @guillermomedel1575
    @guillermomedel1575 3 года назад +3

    32 minute video. Yet it takes me 2 hours to finish since I stare if into the particles. Good stuff

  • @romankonecny7106
    @romankonecny7106 Год назад +1

    And it all comes back down to a donut, the holy grail of frontend programming

  • @alexanderbarrera9906
    @alexanderbarrera9906 3 года назад +1

    This is exactly what I was looking for to prettify a little solar system in my portfolio. Thank you good sir!

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

    I need more! I'm studying that at the university but now finally I'm learning something!

  • @Ryskorrel
    @Ryskorrel 2 года назад +2

    18:28 not necessarily 60 times a second. It is more dependant on your screen refresh rate.
    This is why a lot of libraries include a wrapper for this which provides a delta time since the last repaint.

    • @jituraiyan
      @jituraiyan Год назад

      It'll depend on the device capacity... So, if your device has higher capacity then higher FPS wouldn't be a problem. On the other hand for low config device, the fps will be lower automatically... Also for updating staff, he uses clock so that the animation don't go faster/slower depending on the device's fps capacity.

  • @dooza
    @dooza 2 года назад

    How perfect that I discovered this video! I was literally thinking of making a particle donut as a background for my website.

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

    Please provide more three js content.your contents are amazing

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

    Thank you Sir. I have never seen like this videos onThree.js.👌🏻

  • @thelud400
    @thelud400 3 года назад +2

    It would be so cool to mix particles and some noise/random movements

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

    Thank you! This is very helpful. Looking forward for more Three.js tutorials! :)

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

    Thank you! This is an awesome and easy to follow tutorial. Learned a lot from it.

  • @rukkiecodes
    @rukkiecodes 3 года назад +1

    Can't wait for the next one

  • @neomarkdigitalsolutions1646
    @neomarkdigitalsolutions1646 2 года назад

    Wow - I learned a ton, thank you so much for sharing!

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

    Some very nice effects, thanks ! Would love to see some text exploding into particles or vice versa.

  • @먐먐-m1g
    @먐먐-m1g 2 года назад +1

    I managed to make a animating text!! Thank you! 😆

  • @MarcioMarquesdeSouza
    @MarcioMarquesdeSouza 2 года назад

    Extremely useful and well done. Thanks a lot!!!!!

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

    Thank you a lot, I'm learning this library thanks to you, maybe later I''mma doing my own tutorial to the Spanish community

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

    So interesting! I love ThreeJs 😍👍🏻

  • @orsbert
    @orsbert 2 года назад

    The keyboard sounds are satisfying

  • @LeftClickMage
    @LeftClickMage 3 месяца назад

    Using elapsed time makes the particles move faster the more time that passes.

  • @theshredguitarist25
    @theshredguitarist25 3 года назад +2

    How do we replace the cross.png with a different png?

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

    Please keep this going

  • @xNoraDestiny
    @xNoraDestiny 2 года назад

    Great job ! Can you do a tutorial to explain how to interact with particules on an image ?

  • @mariaklimenko6090
    @mariaklimenko6090 2 года назад

    love your chanel, thank you!!!!!😍

  • @timr86868
    @timr86868 3 года назад +6

    There's a logic error with the code that rotates the particle system. ElapsedTime continually grows as the program runs, so if you leave it running for a few minutes, even a small mouse movement makes the system rotate ridiculously fast.
    I solved this by changing stuff around to use clock.getDelta() instead of clock.getElapsedTime()
    particlesMesh.rotation.y -= (((mouseY + 100) * 0.0002) * deltaTime)
    Not the exact same effect, but it doesn't change over time. If anyone has a better solution, please do let me know.

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

      Appreciate this!

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

      I saw your comment thanks. Can you paste the code snippet exactly how you put it? I tried replacing "elapsedTime" with "deltaTime" as well as replacing "clock.getElapsedTime()" with "clock.getDelta" but it doesn't rotate passively at all.

    • @timr86868
      @timr86868 3 года назад +1

      @@quintonnistico9347 you also need to change the line that changes the rotation to use a += or -= instead of an = since we're now using delta time (which should stay roughly the same each frame) you have to add it to the previous value (hence += or -= depending on whether you want it to rotate left or right)

    • @nishitsarvaiya1474
      @nishitsarvaiya1474 3 года назад +3

      @Tim Wolf Hi Tim. Thanks for providing us this solution.
      I added some modifications of my own to make 2 things =>
      1. Run the initial rotation only once in the beginning.
      2. Be able to move the particles in all the 4 directions in the same speed.
      Code =>
      let mouseX = 0,
      mouseY = 0, flag = 0;
      function moveParticles(e) {
      mouseX = e.clientX / canvas.width * 20 - 10;
      mouseY = e.clientY / canvas.height * 20 - 10;
      flag = 1;
      }
      const tick = () => {
      const deltaTime = clock.getDelta();
      if(flag == 0) {
      particlesField.rotation.y += deltaTime * 0.05;
      }
      particlesField.rotation.x -= mouseY * deltaTime * 0.008;
      particlesField.rotation.y -= mouseX * deltaTime * 0.008;
      renderer.render(scene, camera);
      window.requestAnimationFrame(tick);
      };
      Here is my Codepen link you can check it out if you want. codepen.io/nishit-sarvaiya/full/gORPjwR

    • @omadden234
      @omadden234 3 года назад +1

      @@nishitsarvaiya1474 this worked for me! thanks!

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

    you're a great teacher!!!! thank you!!!

  • @GH4L
    @GH4L 3 года назад +2

    by any chance does/can anyone send me a link of the cross.png file he used for this project? i can't find any good quality ones online. the one i am currently using is a little blurry/opaque. would greatly appreciate it

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

      so yours actually loaded???? I dont get it smh

  • @SpriteTheDude
    @SpriteTheDude 2 года назад

    great tutorial, thanks !

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

    About time. I waited so long for this.
    Keep it coming 😏😏😏😏

  • @ronolds6505
    @ronolds6505 6 месяцев назад

    I downloaded using npm and when I opened the HTML file no torus was on the screen. So, I downloaded the ZIP file and the same thing happened. Not sure what I'm missing. ??

  • @quintonnistico9347
    @quintonnistico9347 3 года назад +1

    I ran into a strange issue! When I do: if (mouseX > 0) {
    particlesMesh.rotation.x = mouseY * (elapsedTime * 0.00004)
    particlesMesh.rotation.y = mouseX * (elapsedTime * 0.00004)
    }
    What happens is the mouse rotation of particlesmesh speeds up over time. It starts really slow, but as time goes on it gets faster and faster. Any ideas?

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

      Check out my comment above.

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

    Thanks for the tutorial, one quick question:
    I've used the particles for a background for a scrolling web-page. How do I prevent the page from being able to scroll upwards for eternity?
    Have tried a conditional on the mousewheel, but it makes the scrollbar get stuck at the top.

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

    make a series on react-three-fiber

  • @theman7050
    @theman7050 2 года назад

    Would using instancedBufferGeometry have further improved performance here?

  • @Rhidayah
    @Rhidayah Год назад

    Blender Guru,, proud of your donut

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

    how can I make this movements for the particlsesMesh more smoother
    BTW absolutely Love your content! Lots of Love from India

  • @khadimhusen
    @khadimhusen 3 года назад +3

    Please use bigger font so we can see it.

    • @CanDooper
      @CanDooper 3 года назад +1

      Agree, VS code seems a bit blurry in this vid so hard to read

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

    I wonder if there will be a course for custom shaders

  • @arkondigital1496
    @arkondigital1496 2 года назад

    11:43 I can feel your pain bro

  • @andrealiu5106
    @andrealiu5106 2 года назад

    Is there an advantage to adding GSAP CDN and code in html vs the js file?

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

    Great Tut. What if I have an existing project and want to use this on one of my existing pages. Is this possible?

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

      Manually imported dependencies if anyone else is wondering

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

    niceeeee that would look great on my website

  • @sakhile_nkomo
    @sakhile_nkomo 2 года назад

    "Obviously that doesn't do shit" SUBSCRIBED

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

    Hey, could someone explain to me why at 12:07 using " - 0.5" places the points on the center of the screen?
    I really like all the topics of your videos, but I find there is sometimes little or no explainations

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

      Math.random() gives you a float value between 0.0 and 1.0. He substracts 0.5 to have a value in the -0.5 to 0.5 range because the origin is in the middle of the torus.

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

      @@catalin1122 thanks a lot! Love the escape the fate pic heh

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

      @@edenmyson6401 you're welcome. Love your synthwave pic as well!

  • @lennartv.1529
    @lennartv.1529 3 года назад

    The CSS/HTML part at the end isnt working for me. Only the line is visible. I cant figure out why...

    • @lennartv.1529
      @lennartv.1529 3 года назад

      Does it still work with the newer gsap version?

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

    Do you recommend using shaders or GSAP for animation?

    • @DesignCourse
      @DesignCourse  3 года назад +1

      I recommend using both, depending on the objective. So, it all depends on what the goal is!

  • @tunahanergul9945
    @tunahanergul9945 10 месяцев назад

    how can I add a background image to an 3d object

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

    Fantastic :)

  • @safdarawn902
    @safdarawn902 3 года назад +1

    which theme for vs code are you using please bro if anybody knows reply me thanks in advancde :D

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

    does anyone have a github with the full version of this? Ive been over mine a few times and it still doesnt work, mainly when adding the if statement for the animation.

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

    i get this when i type cd code
    -
    -
    -
    -
    cd : Cannot find path 'C:\Users\Oscar\code' because it does not exist.
    At line:1 char:1
    + cd code
    + ~~~~~~~
    + CategoryInfo : ObjectNotFound: (C:\Users\Oscar\code:String) [Set-Location], ItemN
    otFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand

  • @vitusstockholm4984
    @vitusstockholm4984 2 года назад +1

    would be great if smbd could share cross.png file,

  • @igoreksazonov
    @igoreksazonov 3 года назад +1

    threejs api changing every month and dont have a stable one, so the code worked a year ago not currently working =(((

    •  3 года назад

      You can download the version you want then put it in your main files, this should help you bro , even if the code you used deprecated, your projects is gonna survive, but of course new versions can mean more security and new methods

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

    Wow cool can we use our own images

  • @neildrabinski3330
    @neildrabinski3330 Год назад

    +1 for the Akron shirt #akronthefup

  • @pranaykrmajee1432
    @pranaykrmajee1432 3 года назад +1

    where is the cross.png ? :")

  • @ozioma
    @ozioma 2 года назад

    too cool

  • @besooab8810
    @besooab8810 2 года назад

    Can we have the source code ?

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

    anyone else got the same problem where you can't add a map of the texture to the PointsMaterial?

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

      yes, i resolve it writing all in one line: const cross = new THREE.TextureLoader().load('./sound-waves.png');

  • @vxcode9536
    @vxcode9536 2 года назад

    Make three js 3D slide show cloth image

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

    Hairy Gary

  • @matthewjames-rodriguez8982
    @matthewjames-rodriguez8982 3 года назад

    mobile responsive?

  • @bkalkuz
    @bkalkuz 3 года назад +4

    excuse me to being so honest but;
    can't you put screens close to each other which you are reading the code from and you are following your code to? your looks between reading screen and coding screen feels me disturb. like you are explaining something but deeply do not know about what or how it is and just reading to tell anothers... not natural.

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

      lmao - does it really matter? There are very few folks on RUclips coding from the top of their head, and if they are, it DEFINITELY doesn't go over as smooth as this does. You calling that out really didn't make him look bad one bit - it just makes you look like the clown shoe of a prick you are. All the main RUclips creators ALL print their project tutorial code or pull it up on screen and use it for reference during the tutorials, and the ones who dont, have like hour long videos of them thinking which is cool two depending on what type of content your looking for. This video wasn't made based on what 'disturbs' you so dont watch it if that's the case - excuse me for being so honest.

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

      ​@@unrecited is it your professionality or doing this as a hobby to been so useless like this?

  • @flelfwastaken
    @flelfwastaken 3 года назад +2

    You can make your life easier if you do the posArray like this :
    const posArray = new Float32Array(5000 * 3).fill().map(() => THREE.MathUtils.randFloatSpread(10))

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

    wont change anything. No color, no picture. I even made tiny png with alpha backs. Nothing.
    h1,
    p {
    flex-basis: 0;
    flex-grow: 1;
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    }
    breaks the code.
    Anyone know why? I've watched through a few times now.

    • @ranzen2269
      @ranzen2269 3 года назад +1

      idk If you've already resolved it, but your problem it's in this line: const cross = loader.load('/cross.png'), you forgot a point -> const cross = loader.load('./cross.png'). And h1,p{} looks good to me.