Add 3D Model to WebSite in 5 Minutes - Three.js Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.ค. 2024
  • How to add 3D model with 360 degrees view on website with JavaScript and Three.js in 5 minutes!
    Source Code: redstapler.co/add-3d-model-to...
    Three.js Crash Course: • Three.js Tutorial | Pa...
    GLTFLoader.js: git.io/fjRPL
    OrbitControl.js: git.io/fjRPt
    Car Model: skfb.ly/6HpEG
    === Follow us on ===
    Facebook: / theredstapler
    Website: redstapler.co/
    Twitter: / redstapler_twit
    #3DModel #ThreejsTutorial #WebDesign
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 428

  • @thes_eus
    @thes_eus 2 ปีที่แล้ว +11

    Thanks, sir. Now I'm in love with this piece of technology and willing to learn everything it offers!

  • @jessepinkman725
    @jessepinkman725 5 ปีที่แล้ว +4

    One of favourite web development channel. Thank u so much.

  • @ozoshmaharjan2016
    @ozoshmaharjan2016 5 ปีที่แล้ว

    Ooooohhhhh thank you so much. I needed this. 😊

  • @xyzabc4313
    @xyzabc4313 4 ปีที่แล้ว +1

    great tutorial!!!!! hope more to come!!!

  • @brendanyuki3784
    @brendanyuki3784 4 ปีที่แล้ว

    God-sent tutorial!!! made mine work!

  • @akshayawate7239
    @akshayawate7239 5 ปีที่แล้ว +1

    Thnks red stapler.!!love from India

  • @pavelarseyev452
    @pavelarseyev452 4 ปีที่แล้ว

    thanks a lot! This video helped me so much!

  • @chenrone935
    @chenrone935 2 ปีที่แล้ว

    very helpful! thanks!

  • @ZejtiNSRB
    @ZejtiNSRB 5 ปีที่แล้ว

    Great man !

  • @DragonStoneCreations
    @DragonStoneCreations 5 ปีที่แล้ว

    You deserve more buddy

  • @ajeeboamir
    @ajeeboamir 3 ปีที่แล้ว

    Sir, you are really great...
    What an amazing project is this... really amazing.. +!

  • @3dfrontelevation94
    @3dfrontelevation94 4 ปีที่แล้ว

    very help full, thanks ,

  • @user-bt2uz2zf1y
    @user-bt2uz2zf1y 5 ปีที่แล้ว +9

    You are awesome! Thank you for lesson, from Moscow :)

  • @danielgiustiniperez4289
    @danielgiustiniperez4289 3 ปีที่แล้ว +6

    Man deadass used "Happy Birthday" as background music, what a legend xD

  • @torytatsumaki
    @torytatsumaki 4 ปีที่แล้ว +1

    Happy birthday !

  • @k0r114
    @k0r114 2 ปีที่แล้ว +3

    Hey man! Great job! I have a question: Once I have my the model uploaded, how can I add a button that activates an animation when clicked it, like opening the doors for example. Thanks!

  • @Evitaschannel
    @Evitaschannel 3 ปีที่แล้ว +3

    In blender or other 3D software you can often place lights as well, will these show up? Or do you always need to add the lights yourself?

  • @karthikraja4024
    @karthikraja4024 5 ปีที่แล้ว

    Great video super tutorial

  • @hyvlog5476
    @hyvlog5476 ปีที่แล้ว

    like it, long time no see make about threejs....

  • @RinoMoen
    @RinoMoen 2 ปีที่แล้ว

    I dude enjoy it!

  • @chris40104010
    @chris40104010 5 ปีที่แล้ว

    like your three js series.

  • @nileshgurung9437
    @nileshgurung9437 5 ปีที่แล้ว

    Awesome 🤗

  • @JohannesLauesen
    @JohannesLauesen 5 ปีที่แล้ว

    Thanks!!

  • @marquisegbunike5773
    @marquisegbunike5773 11 หลายเดือนก่อน

    best takes is to update this link on this project for easy accessibility. Keep the good work.

  • @karenmujicarangel8745
    @karenmujicarangel8745 4 ปีที่แล้ว +1

    i have a question in the model scene, can i add buttons and markers in the model from visual studio?
    i need do a model but with tooltips in diferents ubications similar to google maps. what do you recomend me for my proyect? i tried incrust the model but i dont know how put the markers and tooltips in the model

  • @Lbmaniak
    @Lbmaniak 5 ปีที่แล้ว

    Thx for work

  • @fura999
    @fura999 4 ปีที่แล้ว +5

    Thank you sir.
    One more question, how to do dynamic 3d model? I mean, input on website few parameters and output 3d model,
    something like online product configurator
    is it possible?

  • @everestgjonaj
    @everestgjonaj 5 ปีที่แล้ว

    Looking down for more threejs tutorials.

  • @issamkazmouz2387
    @issamkazmouz2387 4 ปีที่แล้ว +7

    Thank you, I try for doing the same code but there is no result ou output ... the same for example pikachu ...??

  • @nefstories9333
    @nefstories9333 2 ปีที่แล้ว

    Thanks for the video! Did anyone noticed that the song playing is happy birthday to you?

  • @bramstultjens9735
    @bramstultjens9735 3 ปีที่แล้ว +6

    I love the Christmas piano music in the background

    • @arthurjimmy9388
      @arthurjimmy9388 2 ปีที่แล้ว

      I know Im asking randomly but does anybody know a method to get back into an Instagram account..?
      I was dumb forgot the account password. I appreciate any assistance you can give me!

    • @daltonwill4218
      @daltonwill4218 2 ปีที่แล้ว

      @Arthur Jimmy instablaster =)

    • @arthurjimmy9388
      @arthurjimmy9388 2 ปีที่แล้ว

      @Dalton Will I really appreciate your reply. I found the site on google and Im in the hacking process atm.
      Seems to take quite some time so I will reply here later with my results.

    • @arthurjimmy9388
      @arthurjimmy9388 2 ปีที่แล้ว

      @Dalton Will it did the trick and I now got access to my account again. I'm so happy:D
      Thank you so much, you really help me out :D

    • @daltonwill4218
      @daltonwill4218 2 ปีที่แล้ว

      @Arthur Jimmy no problem :D

  • @andreanomorango
    @andreanomorango 4 ปีที่แล้ว +1

    Will it be possible to have the models have areas that when they pass the mause are activated or change color or add a link to another model?

  • @user-ns2lf2xi7c
    @user-ns2lf2xi7c 10 หลายเดือนก่อน

    ありがとう❤

  • @congiola3968
    @congiola3968 4 ปีที่แล้ว

    good job ^^

  • @Slokingseba
    @Slokingseba 2 ปีที่แล้ว

    One question. Is it possible to call the "car object" from outside the load function? Here you set a scale inside of it. would it be possible to do soemthing like this:
    loader.load(...,function(gltf){
    car=gltf.scene.children[0]
    });
    car.scale.set(...)
    What would I need to do to make this possible? I need this because I want to rotate the object depending on where my mouse is, so it can follow it

  • @anantavikatan
    @anantavikatan 4 ปีที่แล้ว +9

    How to replace GLTFloader with OBJloader ? Please guide with the code for the same webpage

  • @fredyrivas
    @fredyrivas 4 ปีที่แล้ว

    I had some issues since Im using parcel, when loading the .gltf file, before I needed to use "parcel-plugin-static-files-copy" in order to serve static files. Following issue came when I didn't add /textures folder and .bin file. Finally OrbitControls needs now the renderer as a second argument and there's no need anymore to add the event listener. Thanks for this tutorial

  • @SAL73VFX
    @SAL73VFX 2 ปีที่แล้ว +3

    Excellent tutorial. Do you know how to put this 3d model in a responsive HTML document in order to make a website that can be viewed in every mobil device?

  • @camilo9713
    @camilo9713 4 ปีที่แล้ว +3

    Hi, thank you! Great tutorial. I have a question, any of you guys know how to add text on a 3d model in threejs? I would really appreciate if someone helps me with that.

  • @mariolopes6262
    @mariolopes6262 5 ปีที่แล้ว

    Threejs is sensational.

  • @MACH_SDQ
    @MACH_SDQ 5 ปีที่แล้ว

    Very gooood !!!!

  • @vtshreeram
    @vtshreeram 4 ปีที่แล้ว

    Can we do selection on a specific portion in the 3D model, is that possible via three.js? Eg: I select the eye, nose, ears and like that?

  • @paras5197
    @paras5197 ปีที่แล้ว

    amazing

  • @jitendrakumar8187
    @jitendrakumar8187 4 ปีที่แล้ว +1

    I am getting error in OrbitControl.js file. and the error is "Uncaught TypeError : Cannot read type property 'addEventListener' of Undefined". Please suggest what to do?

  • @apoorvareddy
    @apoorvareddy 4 ปีที่แล้ว +2

    can we upload a 3D model and add different functions to different parts of the model?

  • @adriandeveraaa
    @adriandeveraaa 4 ปีที่แล้ว

    Is it possible to add Text that has a raycast line at a certain point of the 3d model? And the text uses a billboard effect to always face the camera?

  • @luckymigs012
    @luckymigs012 3 ปีที่แล้ว +4

    How can I add the 3D on WP? Can you share some tutorials to it?

  • @HuynhLuong227
    @HuynhLuong227 4 ปีที่แล้ว

    link demo please? and if i made new product (ex: horse) then i must have a horse gltf 3D?

  • @KaiBuskirk
    @KaiBuskirk 3 ปีที่แล้ว

    searching for a wordpress solution thanks for the demo!!

    • @dabbopabblo
      @dabbopabblo 2 ปีที่แล้ว

      the solution would be not to use inferior software like word press cause it sucks so much

  • @TriLe-zx8ub
    @TriLe-zx8ub 2 ปีที่แล้ว

    Thank for your videos. I have a question.
    I have a obj and hdri background. I can not keep obj when rotate background. Can you help me resolve my issue?

  • @rachaelconcessio3019
    @rachaelconcessio3019 4 ปีที่แล้ว +3

    I copied your code exactly, but I got an error saying
    ' Cannot read property Itemstart of undefined '

  • @fadhelalsuwaidi1221
    @fadhelalsuwaidi1221 2 ปีที่แล้ว

    Hi Sir, Great Work
    Which version of three js u use?

  • @promise4599
    @promise4599 5 ปีที่แล้ว +84

    Bro, you took my development skills to the next level, thank you ♥️

    • @doniwirawan7191
      @doniwirawan7191 2 ปีที่แล้ว

      i got blank screen, do you mind to share the source code?

    • @promise4599
      @promise4599 2 ปีที่แล้ว +2

      @@doniwirawan7191 sorry brother, I no longer develop websites and no longer have the source code.

    • @doniwirawan7191
      @doniwirawan7191 2 ปีที่แล้ว +2

      Okay, because of you are the top commenters i hope anybody else will read this, please share your source code link, i wanna look at them🙏

    • @darkerthansuede2439
      @darkerthansuede2439 ปีที่แล้ว +3

      @@promise4599 I'm so curious, why did you stop developing?

    • @promise4599
      @promise4599 ปีที่แล้ว +1

      @@darkerthansuede2439 Became a day trader :)

  • @Giovanni00831
    @Giovanni00831 3 ปีที่แล้ว

    Ok I have an issue, I'm at 2:56 and my programm give the error: "TypeError: this.textureLoader.setRequestHeader is not a function
    at new GLTFParser (GLTFLoader.js:1762)
    at GLTFLoader.parse (GLTFLoader.js:209)
    at Object.onLoad (GLTFLoader.js:95)
    at XMLHttpRequest. (three.min.js:742)"
    even copying the full code I have this problem, what can I do?

  • @u.tassinari2916
    @u.tassinari2916 2 ปีที่แล้ว

    maybe stupid question but is the .glb ok ? When I export from blender, the file has a .glb extension

  • @ricardogoro
    @ricardogoro 3 ปีที่แล้ว +1

    awesome! you could integrate an example of these into a real site!Saludos desde Colombia! :)

  • @aluuffysv4643
    @aluuffysv4643 3 ปีที่แล้ว +7

    Great stuff, is there a way to add customization option to the model? i.e, have colors change and stuff while the model is being panned/rotated around?

  • @xavier96122
    @xavier96122 2 ปีที่แล้ว

    Nice Brother

  • @JoseMiguel-em2pi
    @JoseMiguel-em2pi 4 ปีที่แล้ว

    Run the code but I get this message, THREE.WebGLRenderer: OES_texture_float_linear extension not supported. help!

  • @andreanomorango
    @andreanomorango 4 ปีที่แล้ว

    Uncaught SyntaxError: The requested module './GLTFLoader.js' does not provide an export named 'default'

  • @OskarPrice
    @OskarPrice 4 ปีที่แล้ว

    hi sir! follow you tutorial but occur issue THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera. if i connect three.js file and TypeError: "node.applyMatrix4 is not a function" if i coonect cdn file. What do you think it could be ?

  • @ashishjaiswal3886
    @ashishjaiswal3886 3 ปีที่แล้ว +2

    did u jst played happy bday to u background music in three.js tutorial video ? xD

  • @sabeetspongiinchowdhury3965
    @sabeetspongiinchowdhury3965 4 ปีที่แล้ว +8

    Hey Red Stapler!
    Thanks to your tutorial, I was able to get this running. I really appreciate that and I hope your sub count goes up even more!
    One question though, how would you modify the background so that it's completely transparent? I would like to manipulate the background using CSS.

    • @harthgornaltrask5957
      @harthgornaltrask5957 4 ปีที่แล้ว +3

      I am probably too late, since it has been 3 months since this question has been asked, but I'll answer as there may be other people who have the same question.
      To set the canvas's background to transparent, you simply need to add the line "alpha: true" (without quotation marks) to the object passed as parameter to WebGLRenderer. This property controls wether the canvas's background is to display alpha transparency or not. Default value is false, so that would result in a black background (or whatever is the color you chose for your Scene)

    • @sabeetspongiinchowdhury3965
      @sabeetspongiinchowdhury3965 4 ปีที่แล้ว +1

      @@harthgornaltrask5957 Hey there! Thanks for replying. I figured it out myself. It had something to do with the body element in Javascript but I think i used your solution too when i was trying to solve it myself 3 months ago. I'll link my github.
      github.com/sabeet/earthPort

    • @pratikgk9384
      @pratikgk9384 3 ปีที่แล้ว +1

      @@harthgornaltrask5957 Can I Know where to add this?

    • @harthgornaltrask5957
      @harthgornaltrask5957 3 ปีที่แล้ว +1

      @@pratikgk9384 You put it inside the WebGLRenderer constructor, like this:
      const renderer = new WebGLRenderer({
      alpha: true
      })

    • @ujjwalrustagi8690
      @ujjwalrustagi8690 3 ปีที่แล้ว

      @@sabeetspongiinchowdhury3965 I tried to download your repo contents. I can only see black screen. Is there any way to correct this problem? Even the same problem occurs when I tried out this tutorial.
      Any help would be appreciated

  • @chrisfillmore6812
    @chrisfillmore6812 3 ปีที่แล้ว

    I got my car to render but it is very tiny on init() and is very far back using the camera using the default source code. Any Idea why this is happening?

  • @abazur7742
    @abazur7742 5 ปีที่แล้ว +121

    could you make a whole series about three js ?

    • @Omar-vz9el
      @Omar-vz9el 5 ปีที่แล้ว +9

      From beginner to advanced. I would definitely be watching them all!

    • @Kaybe23
      @Kaybe23 5 ปีที่แล้ว +2

      Here for ya bra:
      th-cam.com/video/ABV1mK1CGOY/w-d-xo.html

    • @abazur7742
      @abazur7742 5 ปีที่แล้ว +2

      but its very basic

  • @lCebolitosl
    @lCebolitosl ปีที่แล้ว

    I got stuck in the getting GLTF Loader part. Your link destination doesn't exist anymore. I'm a noob trying to figure things out still. I'm practicing a lot of html and css but javascript I didn't even touched yet.

  • @tiantianliu5958
    @tiantianliu5958 4 ปีที่แล้ว

    It is a nice example, but I have a question. What kind of browser are you using? I am using Chrome, but I can't use the GLTFLoader to load the glb model from my local filesystem on my computer. The XMLHttpRequest is blocked by 'CORS policy'. It returned the error: from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

    • @atomicgiupyno3039
      @atomicgiupyno3039 ปีที่แล้ว

      i am very late and i have the same problem have you solved that?

  • @vikramcool7647
    @vikramcool7647 3 ปีที่แล้ว

    having a issue not able to view the GLTF in the web any suggestion

  • @saleemahmad5083
    @saleemahmad5083 ปีที่แล้ว

    i have been triying to do exactly what you are doing in the video but i am unable top see the 3D model in the browser.

  • @Dz0nas
    @Dz0nas 4 ปีที่แล้ว +1

    I get this error :
    Uncaught TypeError: Cannot read property 'addEventListener' of undefined
    at new THREE.OrbitControls (OrbitControls.js:1100)
    at init (VM112 threejs.html:27)
    at VM112 threejs.html:69
    THREE.OrbitControls @ OrbitControls.js:1100
    init @ VM112 threejs.html:27
    (anonymous) @ VM112 threejs.html:69

  • @errinwright
    @errinwright 3 ปีที่แล้ว

    is it possible to do this in react file structures? All in one js file?

  • @babybook84
    @babybook84 2 ปีที่แล้ว

    so json file is no longer supported as an exporting option from blender?

  • @mukulchoudhury6859
    @mukulchoudhury6859 4 ปีที่แล้ว

    Orbit Controls gives an error while adding addEventListener to controls. Can someone help?
    " Uncaught TypeError: Cannot read property 'addEventListener' of undefined at new THREE.OrbitControls "

  • @JYFilm-gf8yb
    @JYFilm-gf8yb 4 ปีที่แล้ว

    How could I possibly add labels for doors and engines and such?

  • @robodev6033
    @robodev6033 4 ปีที่แล้ว

    Hello I'm now having little problem to ask you my model can't loadup i think i have problem with textures can you help me how to solve this problem ?

  • @cubedev4838
    @cubedev4838 4 ปีที่แล้ว

    Can you make tutorial how to setup for fbx format?is it same?

  • @shin-cy3th
    @shin-cy3th ปีที่แล้ว +2

    the github links are not working, can someone teach me another way?

  • @DanielRamos-zx1kh
    @DanielRamos-zx1kh 4 ปีที่แล้ว +1

    Why the background music is a jazz version of happy birthday? 😂

  • @user-bx3cv3ck3y
    @user-bx3cv3ck3y 6 หลายเดือนก่อน

    these are not being read :
    import {OrbitControls} from 'three/addons/controls/OrbitControls.js';
    import {GLTFLoader} from 'three/addons/loaders/GLTFLoader.js'; please help

  • @azenahlen08
    @azenahlen08 2 ปีที่แล้ว

    Did you publish it using a live server?

  • @harrisonlong644
    @harrisonlong644 2 ปีที่แล้ว

    All works great up untill I swap out renderer.render(scene,camera); for the animate function. any help? Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'render')
    at animate

  • @rakeshnayak2072
    @rakeshnayak2072 3 ปีที่แล้ว

    Uncaught TypeError: Cannot read property 'addEventListener' of undefined at new THREE.OrbitControls
    How to fix it?

  • @globalautolado6497
    @globalautolado6497 2 ปีที่แล้ว +1

    can some of the parts of the model be clickable?

  • @FarhanAli-yi1mz
    @FarhanAli-yi1mz 3 ปีที่แล้ว

    can we rotate object with gsap scroll-trigger. can you please make video on it?

  • @javifontalva7752
    @javifontalva7752 ปีที่แล้ว

    I have problem loading importing the files. Any idea how I can fix the issue?

  • @dodgycable2095
    @dodgycable2095 4 ปีที่แล้ว +2

    Hi and thanks for the tutorial. I get an error and I was wondering if you can help me fix it. The object doesn't load and in the console it's written: TypeError: THREE.OBJLoader is not a constructor (I used OBJLoader as I didn't have a GLTF, it should be supported anyways) I don't understand why it doesn't work. Thanks in advance!

    • @darshilshankar7661
      @darshilshankar7661 4 ปีที่แล้ว

      Go to your code and put the block o code “renderer = new THREE.WebGL ... (renderer.domElement);” after the block of code about “camera” and before “controls”. Explanation of the error: the renderer object is used before itself is declared. Go to the browser console and you can notice that.

  • @Doyweb
    @Doyweb ปีที่แล้ว

    can you kindly tell me where I can get GLTFLoader.js

  • @ashishbasukala7105
    @ashishbasukala7105 11 หลายเดือนก่อน

    fbx 3D object have been open thats gr8, how to add this on web browser, can u help me?

  • @supragyaykaval8096
    @supragyaykaval8096 10 หลายเดือนก่อน +2

    the github link doesn't work anymore, help

  • @nazarchernetskuy7266
    @nazarchernetskuy7266 3 ปีที่แล้ว

    Where did you get the "three.min.js"?

  • @huzaifashoaib7340
    @huzaifashoaib7340 2 ปีที่แล้ว

    If we want want to add own image how we insert animation on it?

  • @danielradosa
    @danielradosa 3 ปีที่แล้ว

    how can i put such model into div instead of body please?

  • @jongi2003
    @jongi2003 4 ปีที่แล้ว

    How to add control to this car? I mean i want to steer it with arrows or WASD

  • @abdulbasitsalah2918
    @abdulbasitsalah2918 4 ปีที่แล้ว

    how your vs codd can auto complete method and function name of three. js

  • @filiodjordjevic1039
    @filiodjordjevic1039 4 ปีที่แล้ว +7

    when i use this code i get a unexpected token error on the first line of the code, not sure why? can anyone help?

  • @mohammedkasmi9307
    @mohammedkasmi9307 5 ปีที่แล้ว

    how can i load the three.main.js file in angular?

  • @darshanmaruda2092
    @darshanmaruda2092 3 ปีที่แล้ว

    from where i have to download three min js file ??
    you can provide any link ??

  • @akongas
    @akongas 4 ปีที่แล้ว +1

    cant get it working on both computer and hosted

  • @manikanthgrepthor6284
    @manikanthgrepthor6284 2 ปีที่แล้ว

    where did you link the car
    file texture and all

  • @iamfpsk8648
    @iamfpsk8648 4 ปีที่แล้ว +29

    This isn't working anymore as Three.js changes frequently, can you please upload an updated video please?

    • @pradiptasarkarekagga1970
      @pradiptasarkarekagga1970 3 ปีที่แล้ว

      exactly....m completely new to this...and I was ripping my hairs off...I did exactly as this tutorial....and now all it shows is a grey colored screen...dats it

    • @iamfpsk8648
      @iamfpsk8648 3 ปีที่แล้ว +2

      @@pradiptasarkarekagga1970 bro I was doing my final year project on it, one thing I learnt about three.js is no video will help you, go ask your problems in forums of three.js and read the docs and find your desired syntax or problem in docs.

    • @tharaniv6267
      @tharaniv6267 2 ปีที่แล้ว +1

      @@iamfpsk8648 I also see this video for my project😂😅

    • @iamfpsk8648
      @iamfpsk8648 2 ปีที่แล้ว +1

      @@tharaniv6267 don't go for it, read docs.