Getting Started with Three.js: A Beginner's Tutorial

Поділитися
Вставка
  • Опубліковано 23 січ 2025
  • Have you ever wondered how to make 3D graphics on the web?
    Today we'll cover the basics of Three.js, It helps if you have a basic understanding of javascript.
    Download the starting code on Github: github.com/bob...
    Explore using different primitive shapes, a sphere, a donut, a knot, a teapot.
    threejs.org/ma...
    Try different lights, directional, point and or spot lights.
    threejs.org/ma...
    Play with animating the position, rotation, scale and color of the mesh
    threejs.org/ma...
    Create a jsfiddle and share your creations
    jsfiddle.net/

КОМЕНТАРІ • 71

  • @eLearningTechie
    @eLearningTechie 9 місяців тому +14

    I ended up here after getting hopelessly lost in the sauce of some of the other 'beginner' tutorials out there. So many tutorial creators don't seem to realise how much background knowledge they're taking for granted! Really appreciate the clarity of what you're presenting and the fact that you explain why you're taking the steps you're taking. Thank you.

    • @robotbobby9
      @robotbobby9  8 місяців тому

      So glad to hear that this worked for you! Your feedback really helps, Thank you!

  • @migueltice
    @migueltice 10 місяців тому +3

    This is super cool Boby, good job :D

    • @robotbobby9
      @robotbobby9  10 місяців тому

      Hey, thanks @migueltice!

  • @beastlybruh3825
    @beastlybruh3825 9 місяців тому +2

    Amazing tutorial. I felt really connected with what you taught. Keep up the great work !!

  • @rhynowurhynowu
    @rhynowurhynowu 7 місяців тому +2

    Very good example for beginner and Thank you! Looking forward for more !

  • @anikrana84
    @anikrana84 Місяць тому

    This tutorial is simply great. Simple and great. loved it

  • @prashanthg7123
    @prashanthg7123 7 місяців тому +1

    Thanks for explaining so well! You are a good teacher.

    • @robotbobby9
      @robotbobby9  7 місяців тому

      Thank you @prashanthg7123

  • @DevKaiUnreal
    @DevKaiUnreal 9 місяців тому

    Good pacing, good content selection. Great Tutorial. I also liked that you addressed the z-fighting. Thank you!

    • @robotbobby9
      @robotbobby9  9 місяців тому +1

      Thank you @DevKaiUnreal !

  • @RameshBSahoo
    @RameshBSahoo 9 місяців тому +1

    Outstanding is the only word i have for now. Thank you sir!!

  • @CarlaAnneQ
    @CarlaAnneQ 8 місяців тому +1

    Thank you! Looking forward for more

  • @aaloo_ka_paratha
    @aaloo_ka_paratha 10 місяців тому +6

    Waiting for more to come.

    • @robotbobby9
      @robotbobby9  10 місяців тому

      New content uploaded every Wednesday!

  • @KartikaySrivastav
    @KartikaySrivastav 9 місяців тому

    Sir 6:39 after writing the code till here, you screen turned black but my hasn't. What could be the possible error? Please help.

    • @robotbobby9
      @robotbobby9  9 місяців тому

      Open up the console to get more information about the error (maybe there was a typo?)

  • @code-AtoZ
    @code-AtoZ 5 місяців тому +1

    Sir can we add some particles on the layer of globe and make interaction with mouse

    • @robotbobby9
      @robotbobby9  5 місяців тому

      Like in the Vertex Earth video? Yes!
      ua-cam.com/video/tBSzJstOGnM/v-deo.html

  • @guchfun
    @guchfun 6 місяців тому

    You had me at Three.js!

  • @MindEditz.
    @MindEditz. 16 днів тому

    bobby what library can i install to start, when i type like you i cannot get any suggestion, and also my code isnt working like yours, i am also in visual studio..please help

    • @robotbobby9
      @robotbobby9  15 днів тому

      This video looks like a good tutorial on code completion with Three.js:
      ua-cam.com/video/MC-3xxi9hoA/v-deo.html

  • @tammielisa
    @tammielisa 8 місяців тому +1

    Looks really cool 👏😎

  • @ambtehrani
    @ambtehrani Місяць тому

    I followed everything step by step and reviewed to ensure everything is correct but at the end it shows nothing in the browser. totally blank white.
    in tutorial and after you define the scene and camera and renderer you have the black scene appears and after you add geo you have the mesh in the scene but for me it's still white blank.
    I checked the chrome Console which shows this error
    TypeError: Failed to resolve module specifier "THREE". Relative references must start with either "/", "./", or "../".
    I don't know what that means but I check the HTML and Java file against tutorial and every line is identical.
    I tried it on two different computer and still the same, do you know how to fix this ??

    • @robotbobby9
      @robotbobby9  Місяць тому

      Sorry to hear you're having difficulty, Does your "index.js" look like this?
      github.com/bobbyroe/getting-started-with-threejs/blob/completed/index.js

  • @HuynhLuong227
    @HuynhLuong227 11 місяців тому +1

    wow, that's great tutorial, thanks for sharing

    • @robotbobby9
      @robotbobby9  11 місяців тому +1

      You are welcome!

    • @HuynhLuong227
      @HuynhLuong227 11 місяців тому

      @@robotbobby9waiting next video🎉🎉🎉

  • @kogi04
    @kogi04 7 місяців тому

    Thanks for the video.
    How do you get the autocomplete running for Three.js?
    I'm typing the const renderer = new THREE.Web... and it won't give me any suggestions.

    • @robotbobby9
      @robotbobby9  7 місяців тому +1

      Here's the directions I've used to add *intellisense* with typings for Three.js:
      shrekshao.github.io/2016/06/20/vscode-01/
      I hope this helps!

    • @kogi04
      @kogi04 7 місяців тому +1

      @@robotbobby9Thanks for the quick response 🙏

  • @mayhemavenir
    @mayhemavenir 6 місяців тому

    Hey Bobby, thank you for this perfectly simple and understandable introduction into three.js 🙂
    I only know a little bit about JS in general but it was enough to understand most of whats happening here - and its fun!
    I got one question of comprehension: You set the top and bottom lights and with the orbit controls we can move the object. But shouldnt e.g. the orange light stay on the ground? Why does it move with the orb?

    • @robotbobby9
      @robotbobby9  6 місяців тому +1

      Hi @mayhemmavinir - that's great and thank you!
      Re: Orbit Controls, it's difficult to tell with only a single Icosahedron in a black scene, but the controls move the *camera* round (not the object) - hope that makes sense

  • @online.python.dersim
    @online.python.dersim 5 місяців тому

    Great video for beginners thank you for your time

    • @robotbobby9
      @robotbobby9  5 місяців тому

      Glad to hear you enjoyed it. Cheers!

  • @irfanghyann
    @irfanghyann 9 місяців тому

    how can i add this sphere hover and also want to add onclick event

    • @robotbobby9
      @robotbobby9  9 місяців тому

      Check out ua-cam.com/video/tgwS1xxzc9s/v-deo.html

    • @Izelirfan
      @Izelirfan 9 місяців тому

      Also how can add onclick event in globe

  • @JoeMayk3D
    @JoeMayk3D 9 місяців тому

    amazing! very new to this however - Do you know what I could search for to find out how to add this to my wordpress/elementor pro website? thanks in advance!

    • @robotbobby9
      @robotbobby9  9 місяців тому

      Not sure, maybe start here: elementor.com/help/custom-code-pro/ ?

  • @ikermadariagamoreno6255
    @ikermadariagamoreno6255 9 місяців тому +1

    Awesome video, could you explain how could i add a .gltf to my website? thank you

    • @robotbobby9
      @robotbobby9  9 місяців тому

      This video walks through loading a model:
      ua-cam.com/video/Cxd2gYRrz4c/v-deo.html
      Replace the *OBJLoader* with a *GLTFLoader* and you'll be loading models!

    • @ikermadariagamoreno6255
      @ikermadariagamoreno6255 9 місяців тому

      Thank you

  • @baxtables
    @baxtables 8 місяців тому

    Should I just get started or learn some prerequisite before diving in

    • @robotbobby9
      @robotbobby9  8 місяців тому

      Hey @baxtables start here: threejs.org/manual/#en/fundamentals

  • @tenukaperera3853
    @tenukaperera3853 6 місяців тому +1

    thank you so much ur explanation is so clear

    • @robotbobby9
      @robotbobby9  6 місяців тому

      You’re welcome!

    • @tenukaperera3853
      @tenukaperera3853 6 місяців тому

      @@robotbobby9 is there a way to run without a server?

    • @robotbobby9
      @robotbobby9  6 місяців тому

      If there is, I don’t know it.

  • @HaskaSu
    @HaskaSu 11 місяців тому +1

    awesome!

  • @aru8560
    @aru8560 9 днів тому

    seems like a good tutorial, but cant seem get any response from the code. Not able to install npm scripts aswell for some reason.

    • @robotbobby9
      @robotbobby9  8 днів тому

      What part is giving you difficulty, exactly? You won't need to install any npm packages for this project.

    • @aru8560
      @aru8560 8 днів тому

      ​@@robotbobby9I'm a big knucklehead. It's working now! was missing the word "new" on line 12 :facepalm: ❤ (Tip for the next person: make sure to check ur code 10 times, if not 50 times before u proceed)

  • @razern420
    @razern420 4 місяці тому +1

    Well this is cool but its better to just make a 3d model in blender and import it using the relative path of threejs am i right?

    • @robotbobby9
      @robotbobby9  4 місяці тому

      Sure, what format do you export (for Three.js / web)?

  • @hitmeup4918
    @hitmeup4918 11 місяців тому

    very helpful video appreciate your effort

  • @Rapha_Carpio
    @Rapha_Carpio 2 місяці тому

    right now im struggling to make a web flask that works with javascript, three.js python css and with the following user-flow.
    User enters page → Zoom effect with text is displayed → User clicks or scrolls to continue → Light turns on and 3D bust appears → Rotating boxes around bust → User can interact by clicking on boxes to see more information about artists and periods.
    but i don't know why i can't get the 3d animation run T_T
    i did this animation " Rotating boxes around bust → User can interact by clicking on boxes to see more information about artists and periods." with full CSS and HTML simple.
    But now that i want to use a 3d bust and make it more complicate, I can get it run.
    i know 0 about JavaScript, i come from a python background, maybe i shouldn't use flask and python but some JavaScript framework right?
    im planning to Netflix all your content, sir. =) Thanks for sharing.

    • @robotbobby9
      @robotbobby9  2 місяці тому

      I hope you can sort it out - I'm not familiar with Flask / Python. For Web 3D I recommend Three.js always.

  • @becket4373
    @becket4373 Місяць тому

    what is jsm

    • @robotbobby9
      @robotbobby9  Місяць тому

      Try this guide:
      discourse.threejs.org/t/three-js-autocomplete-with-vs-code/1636