Fireship · @fireship

Build a Mindblowing 3D Portfolio Website // Three.js Beginner’s Tutorial

Uploaded May 21, 2021 · Length 15:38

Build a Mindblowing 3D Portfolio Website // Three.js Beginner’s Tutorial

Summary

Learn how to build a 3D portfolio website using Three.js and JavaScript, with a beginner-friendly tutorial that covers cameras, lighting, and geometry.

  • threejs
  • javascript
  • 3d graphics
  • portfolio website
  • web development
  • beginner tutorial

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    The most visually mind-blowing websites in the world all seem to follow a similar pattern.

  2. 0:06

    They use 3D animations that bring the content to life when the page is scrolled.

  3. 0:10

    A website like Mav.farm doesn't have a scroll bar, but instead animates a whole 3D world as you scroll through the page.

  4. 0:16

    This may look impossibly difficult, but in today's video, you'll learn how to create your own 3D animations with JavaScript using 3JS.

  5. 0:24

    By the end of this video, you will have built a personal portfolio website that's so impressive it's guaranteed to get you a job or your money back.

  6. 0:30

    And you might be shocked at how easy it really is when you understand a few concepts related to cameras, lighting, and geometry.

  7. 0:37

    This tutorial is beginner-friendly, and I'll assume you're brand new to 3JS and 3D graphics in general.

  8. 0:42

    What we'll build today is a website that uses CSS Grid for its main content, and has a 3D animated background that changes the camera perspective as the user scrolls down.

  9. 0:52

    Looking closer, we have an avatar image that is actually a 3D cube that rotates as we scroll down.

  10. 0:57

    Then we have a big 3D ring that rotates continuously.

  11. 1:00

    You'll also notice a bunch of 3D stars in the background that change their position as the camera moves.

  12. 1:05

    And at the bottom, we have a rotating moon animation.

  13. 1:08

    It doesn't look perfect, but it's about as realistic as the official moon landings.

  14. 1:12

    The inspiration for this video came from atlie.net, which is a great example of an amazing website that uses both CSS Grid and 3JS.

  15. 1:19

    But what is 3JS exactly?

  16. 1:21

    Well, basically, it's just a library for drawing 3D graphics in the browser with JavaScript and WebGL.

  17. 1:27

    In any 3D scene, whether it's on the web, a movie, or video game, you have a bunch of geometries or shapes that get styled with textures,

  18. 1:35

    which might be done with math or just a regular raster image.

  19. 1:38

    A scene will also have one or more lights to make the shapes visible.

  20. 1:41

    And finally, there needs to be a camera to give the end user perspective on the screen.

  21. 1:45

    Now when animation comes into play, we can set up an infinite loop or some other trigger like the scroll bar to change the properties on these objects to animate them.

  22. 1:53

    3.js makes this process very developer-friendly, as you'll see throughout the video, but I would like to point out that it's not really a tool for modeling or drawing complex 3D shapes.