Learn Three.js from Scratch: Crash Course Tutorial

Sdílet
Vložit
  • čas přidán 28. 05. 2024
  • Add star fields, click-activated camera movements, and seamless transitions with the full course at chriscourses.com/threejs-bundle
    Practical three.js development is rarely taught these days, but let's see if we can fix that-this course aims to demystify the process of developing an interactive 3D environment in the browser.
    🔗Links
    Finished Project - codepen.io/chriscourses/pen/G...
    Three.js Installation Page - threejs.org/docs/index.html#m...
    Three.js unpkg CDN - unpkg.com/three@0.126.1/build...
    Orbit Controls CDN - unpkg.com/three@0.126.1/examp...
    📃Table of Contents
    00:00 - Install three.js & vite
    17:41 - Create a scene, camera, and renderer
    24:26 - Add a box mesh to the scene
    30:43 - Animating and rotating the box
    33:22 - Add a plane mesh
    40:08 - Add directional lights
    42:17 - Add depth / jaggedness to plane
    52:23 - Modify to taste with dat.gui
    1:07:23 - Rotate scene with OrbitControls
    1:12:13 - Add hover effect
    1:43:08 - Tailor hover effect to exact colors
    1:44:54 - Fade out hover effect over time with GSAP
    1:50:32 - Begin to set plane to exact dimensions
    1:55:21 - Add randomized vertice movement
    2:11:43 - Finishing exact plane dimensions
    2:17:51 - Add interface with HTML and CSS

Komentáře • 194

  • @mathewdavies1480
    @mathewdavies1480 Před 8 měsíci +11

    If you are having trouble with the 'Flat Shading' property not being recognised, (at around 50 mins into the video) this is because the newer version of 3JS just takes a boolean value. Replace 'flatShading: THREE.FlatShading' with 'flatShading: true'.

  • @fieraasiatica8599
    @fieraasiatica8599 Před 2 lety +63

    The only video in the whole platform that thoroughly explains everything perfect, thank you

  • @mritz579
    @mritz579 Před 3 lety +7

    Man I have to say this tutorial is awesome! Best one I have seen so far. You are very good at explaining everything. Thank you!

  • @layeekromah4799
    @layeekromah4799 Před 3 lety +18

    Didn't intend to watch 2hours plus video but this guy's voice is soothing.

  • @calebc4395
    @calebc4395 Před 2 lety +1

    Thank you for the tutorial! A few parts moved really fast, but overall it helped a lot! I was struggling to get three.js setup but your solution with Vite fixed it! Thanks!

  • @munaboa850
    @munaboa850 Před 2 lety

    Love how you explain everything so thoroughly

  • @jwilliams6403
    @jwilliams6403 Před 3 lety +22

    Wow, great tutorial. I just finished the project, and learned an incredible amount. You explain everything clearly and fully. I hadn't used Vite before, so that was cool. This project got fairly complex (for me), but I'm confident that I can create unique projects from what I've learned. Looking forward to Part 2 of the course on your site

  • @igormen2001
    @igormen2001 Před 3 lety +2

    You're the best dude, really appreciate your work!

  • @juanantonionavarrojimenez2966

    Great tutorial. A lot of concepts of Three JS. Thank you.

  • @dylanyurjevich8927
    @dylanyurjevich8927 Před rokem +1

    Great tutorial Chris. Thanks so much! Watched the complete two hours :)

  • @godessworshipper4663
    @godessworshipper4663 Před 3 lety

    Amazing tutorial, now I get a grasp on Three.js!

  • @preciousmatos
    @preciousmatos Před 3 lety +1

    You did a really awesome job. I am very grateful!🤗

  • @NikitaRemizov
    @NikitaRemizov Před 2 lety +9

    This is a terrific explanation. I really like the way you pay attention to the little things that experienced programmers understand, but can be confusing to newcomers.

  • @in2minutesorless64
    @in2minutesorless64 Před 3 lety

    GREAT video! Really good information...thank you very much. Clear and simple

  • @meuss2976
    @meuss2976 Před 3 lety +1

    Thanks Chris, high quality tutorial!

  • @ioweb_pro
    @ioweb_pro Před 2 lety

    Chris. Thanks a lot. This is what I have been looking for since yesterday!

  • @hafizjavaid
    @hafizjavaid Před 3 lety +17

    Finally my canvas teacher is back with another amazing tutorial 😍😍

  • @patsh4596
    @patsh4596 Před 2 lety

    You're awesome! You know what you are teaching. Thanks.

  • @climbingworkouts
    @climbingworkouts Před 2 lety

    very well explained even in the first 30 seconds I was able to get a grasp of the whole concept

  • @mr.c7411
    @mr.c7411 Před 2 lety +2

    Amazing tutorial, just like always 🙌

  • @aryomuhammad8254
    @aryomuhammad8254 Před 6 měsíci +1

    Man, not gonna lie, the way you explain things is amaze me. Thanks man!

  • @sandrallancherosg
    @sandrallancherosg Před 2 lety

    Excellent video. I don't know how I missed it!

  • @fortedexe8273
    @fortedexe8273 Před 2 lety +1

    thank you, that really detail, although I know how to use threejs, but I still can learn more from your video

  • @jonilo8792
    @jonilo8792 Před 3 lety

    Awesome tutorial! Thanks!

  • @CristianAlexandruRadu
    @CristianAlexandruRadu Před 3 lety +2

    Thanks for this amazing tutorial, I watched all up!
    The most comprehensible tutorials about THREE are on your channel and DesignCourse's one :D (which started a THREE series recently)

  • @aaron95223
    @aaron95223 Před 7 měsíci

    thank you so much for the great content and for your wonderful way of teaching!

  • @pelly5742
    @pelly5742 Před rokem +1

    1:59:50 I think `originalPosition` is going to get changed along with `array` because arrays in js are passed by reference instead of by value. So whenever you change a value in `array` it's also going to change `originalPosition` since they both point to the same array in memory. To get an "independent copy" of the position, you could use the spread operator to copy all the values of `array` into `originalPosition`. But i guess the effect works just fine without it, so we probably don't need an `originalPosition` array in the first place. I tested it with `array[i] = array[i] + Math.cos(frame)` instead and it worked just fine.
    Thank you for the video, it helped me a ton to get started with three.js! :)

  • @thedocotrL
    @thedocotrL Před 2 lety

    First, I am a complete beginner at JS but know a bit of math. In asking myself what the units mean, such as width = 5, I discovered that the FOV is for one direction only. In my case it was for the vertical. The FOV for the horizontal is larger. The units interact with the FOV and camera position. If you change the camera.position.z from 5 to 10, the red plane shrinks by one-half. If you increase the field of view to 113.8 degrees, the red plane also shrinks by one-half. for the curious, 113.8 =2* arctan[2*tan(75/2)]. In some ways it is just like the real world. You can only estimate the size of an object if you know how far away you are. Our personal FOV is pretty much fixed so we don't pay much attention to it. However, if you looked down a tube (like for paper towels) your FOV would change drastically and size estimation would be most difficult.

  • @pabbuslaxman3561
    @pabbuslaxman3561 Před 2 lety

    Dude please make more tutorials on three.Js..... Guys like you are just rare
    You are just amazing

  • @mayaahmed
    @mayaahmed Před 3 měsíci

    Thanks. Simply superb.

  • @uquantum
    @uquantum Před rokem

    Fantastic! Learned a ton, thanks for delivering useful content in a fun, engaging and friendly style!

  • @johnadriandodge
    @johnadriandodge Před 2 lety

    Christopher has an amazing 🎁 for teaching.

  • @kamilkaniewski6742
    @kamilkaniewski6742 Před 2 lety

    Thank you - great tutorial!

  • @mj2758
    @mj2758 Před 2 lety

    thank you man for this priceless tuto

  • @iamasavage101
    @iamasavage101 Před 2 lety

    this is the only video that is good out off every other videos of three js on youtube

  • @Noam_Biard
    @Noam_Biard Před rokem

    Loved it, super useful !!!

  • @justinjtownsend
    @justinjtownsend Před 2 lety

    Very informative Chris for what I'm doing. Thank you for sharing your knowledge.

  • @ofirmikel5318
    @ofirmikel5318 Před rokem

    ONE OF THE BEST IF NOT THE BEST VIDEO I WACHED ON THREE JS Thank you

  • @mounir101
    @mounir101 Před 2 lety

    Liked it, subscribed, and thanks so much.

  • @mdkhaled3226
    @mdkhaled3226 Před 3 lety +6

    this content is on fire🔥🔥🔥🔥🔥

  • @pavelye1516
    @pavelye1516 Před 2 lety

    Thanks so much, Chris!

  • @JordanAF808
    @JordanAF808 Před 2 lety +3

    I wish I found your channel earlier, you got a great teaching style, and explain everything very well.

  • @ShaiVibes
    @ShaiVibes Před 2 lety

    Awesome! Thank you.

  • @edbic4223
    @edbic4223 Před 2 lety

    very detailed tutorial thanks so much! It would have been even better if you showed the npm but, thanks!

  • @shaikhsanuar5339
    @shaikhsanuar5339 Před rokem

    Learning from u a lot sir. Thanks.

  • @maxdegreat566
    @maxdegreat566 Před 3 lety

    oh my goodness thank youuuuuuuuuu. SO MUCH

  • @kientrantrung5970
    @kientrantrung5970 Před rokem

    perfect, thank you

  • @emmanuelavanzi3998
    @emmanuelavanzi3998 Před rokem

    Best three tutorial ever

  • @pfarnach
    @pfarnach Před 3 lety +10

    Nice video! Just a PSA, it's one vertex, and two vertices.

    • @sicfxmusic
      @sicfxmusic Před 2 lety +1

      three vectors and four horsemen

  • @papelsarkar8117
    @papelsarkar8117 Před 3 lety

    Thanks sir..I love your all vides.

  • @soonkpaik2037
    @soonkpaik2037 Před 3 lety

    Really amazing Thanks a lot

  • @reinieltredes8306
    @reinieltredes8306 Před 3 lety +5

    Intersects 1:22:39

  • @manukyanq
    @manukyanq Před 3 lety +1

    You are legend !

  • @mjoong-ki4487
    @mjoong-ki4487 Před 3 lety +4

    Thank you for the tutorial, totally love it.
    Btw. Vite is prononce as "Veet" (it mean "Fast" in French)

    • @TwstedTV
      @TwstedTV Před 3 lety +1

      To me it looks like Bite, Site, Kite... Vite.... I pronounce it like might,......lol

    • @skylinefx049
      @skylinefx049 Před 2 lety +1

      @@TwstedTV You pronounce it wrong

  • @jeannieg4440
    @jeannieg4440 Před 2 lety +1

    This was an excellent tutorial! I learn so much. Great step by step teacher!

  • @maxdegreat566
    @maxdegreat566 Před 3 lety

    this information is too good to be on here

  • @philipperanoke5665
    @philipperanoke5665 Před 3 lety

    Great tutorial thanks Chris ! I would like to add html after/under the "" however it only seems to add above. Anyone got the same issue ?

  • @madurograziano
    @madurograziano Před 2 lety

    u are amazing dude it is very accurate

  • @antoinefortin1386
    @antoinefortin1386 Před 2 lety

    Thanks for this

  • @arvindersingh9863
    @arvindersingh9863 Před 3 lety +2

    👍👍
    Can you make more videos on threejs?

  • @MustafaSalaheldin
    @MustafaSalaheldin Před 7 měsíci

    Really nice work, quick question, how can I make the surface smooth so it appears like bubbles pool?

  • @xinyanqiu3601
    @xinyanqiu3601 Před 3 lety

    THX A LOT!

  • @art1co
    @art1co Před rokem

    this is so cool buddy

  • @codehabit5655
    @codehabit5655 Před 2 lety

    Please please make a tutorial on how to deploy/publish this project, please Thank You!

  • @MccZerk
    @MccZerk Před 2 lety

    2:00:09 Any reason you didn't need to use the Three.js API setAttribute like you did previously?

  • @VozdOfUsce
    @VozdOfUsce Před 2 lety

    well done.

  • @jarmadax
    @jarmadax Před rokem

    Cool tutorial. But wouldnt it make a ton more sense to animate vertices in a vertex shader instead of editing the mesh?

  • @Coding_Asmr_PraDev
    @Coding_Asmr_PraDev Před 3 lety +1

    You got me bro

  • @orionnft5960
    @orionnft5960 Před 2 lety

    Hi Chris, how can I add 3d obj to this scene ???
    I did Bought your course last week but I'm trying to add some stuff, planets, jets 3d etc.

  • @rikfomiharbi6077
    @rikfomiharbi6077 Před 3 lety +1

    NIIIICE !!!

  • @Noam_Biard
    @Noam_Biard Před rokem

    1:22:38 Nice
    (also best beginner friendly tuto man)

  • @xMaxcraftx
    @xMaxcraftx Před rokem +5

    flatShading: THREE.FlatShading in the current version needs to be flatShading: true (release 146)

  • @flatpaper6
    @flatpaper6 Před 3 lety

    Does anyone know what theme is he using for Sublime Text? It looks cool.

  • @BrunoSilva-mx1ut
    @BrunoSilva-mx1ut Před 9 měsíci

    Hey Chris, instead of using vitae I could you the vscode extension like live server right?

  • @xtaylor7142
    @xtaylor7142 Před 2 lety

    btw if you want the button to make a new tab when opening the site add after the href add this target = "_blank"

    • @ChrisCourses
      @ChrisCourses  Před 2 lety +1

      This is the way to do it, good advice 👍

    • @xtaylor7142
      @xtaylor7142 Před 2 lety

      @@ChrisCourses thanks also do you know how I could view this website through the index.html instead of having to start a server

  • @baileychittle9850
    @baileychittle9850 Před 2 lety +1

    npm installation for three js is super simple, same as doing dat.gui, you just run `npm install --save three` and then import three js by doing `import * as THREE from 'three';`

    • @baileychittle9850
      @baileychittle9850 Před 2 lety

      I found that I could not import modules after building though unfortunately. Error says: Failed to resolve module specifier "gsap"

    • @thedocotrL
      @thedocotrL Před 2 lety

      I had to specify the path. Not sure why, but I wasn't using Vite.

  • @sandrallancherosg
    @sandrallancherosg Před 2 lety

    Will you give feedback on a website? does it have a cost (if you do)?

  • @Trickolo
    @Trickolo Před 2 lety

    Clear

  • @ChrisCourses
    @ChrisCourses  Před 3 lety +20

    first

  • @nicksampah880
    @nicksampah880 Před 2 lety +1

    bro are you the God? thank you

  • @autocadbd.2023
    @autocadbd.2023 Před 2 lety

    Thank you

  • @sealuke2724
    @sealuke2724 Před 2 lety

    best course huh

  • @shubhammaurya9633
    @shubhammaurya9633 Před 8 měsíci

    The threejs tutorial are very helpful but can you also start building in react or next framework

  • @kabkee
    @kabkee Před 2 lety

    I'd like to know what Visual Code Extension is the todo one in the video.

  • @sergiojhdz
    @sergiojhdz Před 2 lety

    Is there a way to create a fish eye camera like lens? Like making the entire website in a fish eye lens perspective

  • @rawadabdallah9381
    @rawadabdallah9381 Před rokem

    Hi Chris, I'm using the latest version of ThreeJS and there's no mesh.geometry.attributes. I've changed the vertices location by accessing mesh.geometry.vertices, but I want to know how to change the vertices' color in this version.

  • @9427gyan
    @9427gyan Před 2 lety +1

    at timeline 1:32:20 , when i removed initial color settings from MeshPhongMaterial still my plane was black

  • @jasoncubic3097
    @jasoncubic3097 Před 2 lety +2

    is there a way to organize the code better? Break up the code into different files that handle single responsibilities somehow?

    • @elissitdesign
      @elissitdesign Před rokem

      Yes I’ve seen people break it up into a materials file, camera controls, geometry, etc. ThreeJS gets pretty lengthy fast!

  • @davidadu-tenkorang3186

    Genius

  • @piyushtiwari4453
    @piyushtiwari4453 Před 3 měsíci

    Hey Chris, can you make a tutorial on Web XR with Three.js , i want to learn about VR on the web

  • @abhinav9469
    @abhinav9469 Před 3 lety +2

    Out of few videos having 0.dislikes. Lets keep it like this 😇

  • @jenlis527
    @jenlis527 Před 3 lety

    Hi Chris!!

  • @jacklo56
    @jacklo56 Před 3 lety +1

    How do you deploy this project on a website?

  • @pewterhacker
    @pewterhacker Před rokem

    The docs for the latest version of vite (v16.17.0 LTS) now say to use the command "npm create vite@latest". With this command, the user is asked for a "package name" after being asked for the "project name". What should we enter for the package name?

  • @emmanuelsamuel1434
    @emmanuelsamuel1434 Před 5 měsíci

    please what is the nam eof the extension you use for your todo list

  • @salmansayeed79
    @salmansayeed79 Před 3 lety

    Finally😭😭😭😭

  • @snudge763
    @snudge763 Před rokem

    how to overlay html elements on top of three js without using position absolute?

  • @plasticsamalt6633
    @plasticsamalt6633 Před rokem

    Does someone know how I can use Visual Studio Code's Live Server extension instead of Vite to run three.js stuff?

  • @meowymeowy8656
    @meowymeowy8656 Před 2 lety

    Hi, I follow up and why the blackdomelement not showing ( 21:57)

  • @AndrewTSq
    @AndrewTSq Před 2 lety +1

    geometry.positions.array at 45:13 does not seem to exist anymore? But I find almost the same data in planemesh.geometry.vertices but its an array with objects instead like [{ x : -2.5, y: 2.5 ,z:0 }, {...]... edit: ok seems like my theejs was an older version.. v119 did not have position, but 126 has it

    • @Dardasha_Studios
      @Dardasha_Studios Před 2 lety +3

      planeGeometry.geometry.attributes.position and planeGeometry.geometry.vertices are both no working. What people are saying online is that geometry is outdated and now BufferGeometry is in use.