Add an Interactive 3D Model to Your Website // Three.js Tutorial for Beginners

  Рет қаралды 16,478

Coffee Code Create

Coffee Code Create

Күн бұрын

In this Three.js tutorial, I'll teach you how to add an interactive 3D model to your website!
Like my videos? Support the channel on Patreon ❤️ / coffeecodecreate
✅ GITHUB REPOSITORY: github.com/dgreenheck/threejs...
✅ LIVE DEMO: dgreenheck.github.io/threejs-...
✅ THREE.JS DOCS: www.threejs.org
✅ MILLENIUM FALCON MODEL: sketchfab.com/3d-models/mille...
0:00 Intro
0:15 File Formats
0:54 Finding a 3D Model
1:37 Project Structure
3:27 Setting up the Scene
8:18 Adding 3D Model
10:17 Orbit Camera Controls
12:19 Shadows
14:38 Final Product

Пікірлер: 34
@Araknidu92
@Araknidu92 5 ай бұрын
Really good tutorial, well explained. Was a bit confused at first because I did not see my model, but then figured out it was just too big. Thanks a lot !
@losrobbosful
@losrobbosful 8 ай бұрын
Excellent tutorial. Finally I got my shadows in the scene! Thanks a ton! Turned out, ambient lighting is a silly idea when trying to cast shadows :D Thank you for bringing me on track with the SpotLight
@coffeecodecreate
@coffeecodecreate 8 ай бұрын
Glad it helped!
@shahinshahbazi7541
@shahinshahbazi7541 5 ай бұрын
Perfect. thank you sooooo much. I have searched to find a way to import, and I could find in this tutorial 😍
@mayaahmed
@mayaahmed 23 күн бұрын
Thank you. Simply superb.
@ManojChauhan-kl3dh
@ManojChauhan-kl3dh 8 ай бұрын
hi sir I watch your videos they all are very useful and I liked it so much .would you please post very long video for that cover whole process from start to end .like how gltf model export from 3ds max or blender with individual animation clip for the same model and then transfer to threejs work with multiple animation clip and then apply highlighting on individual part with labeling feathure when mouse hover on individual part that means when mouse hover on idividual part it shows higlight part and also shows label .If not possible then make a tutorial series for same please sir !!!
@pondokkoding5023
@pondokkoding5023 7 ай бұрын
how to load collada file .dae in three js?
@subhashmandal9525
@subhashmandal9525 3 ай бұрын
How to open glb file by QR code in any website? Please guide me.
@NikhilHande030490
@NikhilHande030490 5 ай бұрын
This is soo good. Have been searching over internet for a good overview, I dont think is any other which gives this much clear explanation. Had a quick query: I wanted to build a 3D viewer which is inside a container of a flutter web application. Is it possible to embed this viewer inside a flutter web app? I have tried using packages like model viewer and babylon dart and they dont work on flutter web app. Could you guide here please if this is possible?
@coffeecodecreate
@coffeecodecreate 5 ай бұрын
Thanks for the feedback. Sorry, I am not familiar with Flutter.
@bestapps4709
@bestapps4709 7 ай бұрын
Hello buddy, I have made a model in nomad sculpt app, model.gltf and this model has PBR painting materials. With three js can I see these materials? Can your code in this video help?❤
@coffeecodecreate
@coffeecodecreate 7 ай бұрын
It should. Three.js supports PBR materials (see MeshStandardMaterial)
@bestapps4709
@bestapps4709 7 ай бұрын
I will try it💖 Thanks buddy! 💓
@KnOtoUt
@KnOtoUt 7 ай бұрын
So i want to create a helper function that returns the loaded model and put that function in a separate file. But the returned value of the function is always undefined... help ?
@coffeecodecreate
@coffeecodecreate 7 ай бұрын
Models are loaded asynchronously so that approach will not work. The model is returned in the `onLoad` callback function (threejs.org/docs/?q=gltf#examples/en/loaders/GLTFLoader).
@KnOtoUt
@KnOtoUt 7 ай бұрын
@@coffeecodecreate So, can we wait for the load function to complete and on the onLoad callback store the loaded asset into different globally scoped variable? nvm the implementation might make the code complex and defeat the purpose of separating the function in the first place, right?
@coffeecodecreate
@coffeecodecreate 7 ай бұрын
@@KnOtoUt Something like that! Doesn’t need to be globally scoped if you are using ES6 modules.
@igoreksazonov
@igoreksazonov 6 ай бұрын
great tutorial! Im try to add an functional to hover on mesh and highlight and on click on a mesh store a mesh info to console. Is it possible? Thanks in advance!
@coffeecodecreate
@coffeecodecreate 6 ай бұрын
Yes. Checkout out the “Implementing Raycasting” chapter of my 3D paint app video: kzbin.info/www/bejne/pX-7qGiwhs58mLs
@user-op7bz3ig4y
@user-op7bz3ig4y 2 ай бұрын
HI Dan. Watched your helpful tutorial. What is the website url to see the finished site?
@coffeecodecreate
@coffeecodecreate 2 ай бұрын
You can find the links to the source and demo in the video description.
@TR360O
@TR360O 4 ай бұрын
Great tutorial! However I'm running into one problem. Almost all of the gltf files I want to use stay completly black, even after adding the lights. One of the models I'm using doesn't have this problem. Do you know what could be causing this problem?
@coffeecodecreate
@coffeecodecreate 4 ай бұрын
It's difficult to know without looking at the files. Do they appear correctly in another tool, like Blender? I always start with MeshBasicMaterial to make sure the mesh is coming in correctly, then switch to a material that supports lighting after. If one mesh appears fine and another does not (and you are using identical lighting for both), then it's likely an issue with the mesh itself. For example, the normals could be flipped. The spotlights are also finnicky to setup (e.g., intensity too low, pointing in wrong direction, etc.). Hope this helps!
@unrealopenworld
@unrealopenworld 6 ай бұрын
It's all on my PC. How do I get it online to my website? Is it enough to upload the project to the web server?
@coffeecodecreate
@coffeecodecreate 6 ай бұрын
You use Vite to create a build and you deploy that on your server.
@unrealopenworld
@unrealopenworld 6 ай бұрын
@@coffeecodecreate Thanks for the reply. How does that work exactly? Do you have instructions?
@elchungo7055
@elchungo7055 25 күн бұрын
Is anyone else having trouble loading the model? I downloaded the project from github, but the webpage seems to get stuck and only shows 'LOADING 0/100'
@coffeecodecreate
@coffeecodecreate 24 күн бұрын
Thanks for your comment. There was a breaking change in Three.js v155 that changed how spotlight intensities work. I've updated the code and the demo. I also reduced the textures so it should load faster.
@elchungo7055
@elchungo7055 24 күн бұрын
@@coffeecodecreate Thank you so much!!
@elchungo7055
@elchungo7055 18 күн бұрын
@@coffeecodecreate I'm really sorry too keep annoying you with this, but could it be possible that there's still a mistake? I'm now getting a screen that says "Engaging hyperdrive...". Could it be an error on my side?
@coffeecodecreate
@coffeecodecreate 16 күн бұрын
Both the demo and a fresh local copy are working for me.
@AmOnGUs-gy8ql
@AmOnGUs-gy8ql 8 күн бұрын
@@elchungo7055 i have the same problem
@Sportshub1135
@Sportshub1135 10 ай бұрын
Where is the next ep of sim city?
@coffeecodecreate
@coffeecodecreate 10 ай бұрын
Stay tuned…
Creating a 3D Paint App in JavaScript | Three.js Raycasting Tutorial
20:16
Coffee Code Create
Рет қаралды 1,5 М.
MINHA IRMÃ MALVADA CONTRA O GADGET DE TREM DE DOMINÓ 😡 #ferramenta
00:40
[실시간] 전철에서 찍힌 기생생물 감염 장면 | 기생수: 더 그레이
00:15
Netflix Korea 넷플릭스 코리아
Рет қаралды 38 МЛН
Лизка заплакала смотря видео котиков🙀😭
00:33
React Three Fiber (R3F) - The Basics
1:10:56
rithmic
Рет қаралды 42 М.
I found more incredible 3D personal portfolios!!!
19:12
Developer Filip
Рет қаралды 143 М.
Three.js Importing Models Tutorial | How to Import GLTF Models in Three.js
6:59
Create the Earth with THREE.js
20:27
Robot Bobby
Рет қаралды 21 М.
Getting Started with Three.js: A Beginner's Tutorial
17:44
Robot Bobby
Рет қаралды 2,3 М.
Reacting to a NO-CODE Three.js 3D WEBSITE BUILDER! WOW!
10:53
Developer Filip
Рет қаралды 138 М.
Adding a 3D model to a website using THREE.JS
5:55
Gabriel Molter
Рет қаралды 103 М.
🔥Новый ЛИДЕР РЫНКА СМАРТФОНОВ🤩
0:33
Нужен ли робот пылесос?
0:54
Катя и Лайфхаки
Рет қаралды 851 М.
🤯Самая КРУТАЯ Функция #shorts
0:58
YOLODROID
Рет қаралды 1,9 МЛН