Create JavaScript 3D World in 5 Minutes - Three.js Skybox Tutorial

Поділитися
Вставка
  • Опубліковано 1 січ 2025

КОМЕНТАРІ • 203

  • @erdemozverenn
    @erdemozverenn 5 років тому +44

    im really glad that i found this channel

    • @ankitsingh1207
      @ankitsingh1207 4 роки тому +2

      Where i can rind files like orbitcontrol.js and three.min and styles.css etc 🙄 plss tell me

  • @KubaSobecki
    @KubaSobecki 3 роки тому +4

    3:42 the moment you realize you could easily be living inside such cube without realizing it

  • @mrigankabora4835
    @mrigankabora4835 5 років тому +6

    great content as usual,would be really helpful if you guys post a long video about three.js,really excited about this!

    • @RedStapler_channel
      @RedStapler_channel  5 років тому

      I made three.js basic course a while ago. Check it out :) -> ua-cam.com/video/uzkedMF-l4Q/v-deo.html

  • @redaloui
    @redaloui 5 років тому +3

    One of my best tutorial channels.. keep up bro.. all respect ❤

  • @abanoubbenyamin1729
    @abanoubbenyamin1729 2 роки тому +1

    You had javascript files in the folder and other things. I copied exactly what you did but it won't work and the page is blank. If you could respond to me quick I would very appreciate it please

  • @abdullahsheikh4180
    @abdullahsheikh4180 3 роки тому +1

    I am getting error in my chrome browser when i run the code

    Uncaught TypeError: Cannot read properties of undefined (reading 'style')
    at new OrbitControls (OrbitControls.js:28)
    at init (index.html:25)
    at index.html:57

  • @chintannedariya2760
    @chintannedariya2760 2 роки тому +1

    Hi ,
    Uncaught SyntaxError: import declarations may only appear at top level of a module
    Uncaught TypeError: THREE.OrbitControls is not a constructor

  • @franciscososa91
    @franciscososa91 5 років тому +8

    Just amazing ! Great vid man!

  • @belugahacker3348
    @belugahacker3348 3 роки тому +1

    where is orbit controller

  • @jonbelloun1322
    @jonbelloun1322 4 роки тому +2

    Hi! Please tell me which version of THREE.JS did you work in this video.

  • @hellloooworld1124
    @hellloooworld1124 4 роки тому +1

    Hi dude I suggest u do coding pushed in git or maybe add download button at bottom of ur site which makes more reliable and easy for us to continue ur work

  • @GHOST-xj1in
    @GHOST-xj1in 5 років тому +3

    cant load the textures and got a black screen ...can some one help me plss

    • @RedStapler_channel
      @RedStapler_channel  5 років тому

      make sure the textures are hosted on the same domain

    • @TorkoTV
      @TorkoTV 5 років тому +1

      @@RedStapler_channel They are for me, still black box/window, trying to zoom out nothing

    • @GHOST-xj1in
      @GHOST-xj1in 5 років тому

      @@RedStapler_channel i just opened it in a local host "from my files"and the same problem

    • @GHOST-xj1in
      @GHOST-xj1in 5 років тому

      @@TorkoTV yeah ...like you 😢 i really want to get the skybox 😍

    • @RedStapler_channel
      @RedStapler_channel  5 років тому

      @@GHOST-xj1in strange... any error on the console? are you sure path to the textures are correct?

  • @jayanths1221
    @jayanths1221 5 років тому +7

    I'm honestly bewildered by all the things Javscript is capable of. Instant like and subscribe..

  • @lliammcbean6819
    @lliammcbean6819 4 роки тому +1

    you should rename the images and use a for each loop to push each item into the array

  • @LyleRohr
    @LyleRohr 5 років тому +8

    Thank you for putting this together! I might be on a project that would require something like this. I've never used three.js before. How would you go about adding clickable elements inside our 3d perspective cube?

    • @lliammcbean6819
      @lliammcbean6819 4 роки тому

      Raycasting is your best bet. Check and see if the mouse position intersects the object you want to click and if it does make an event listener to click the object. Look up raycastng in the three.js documentation it will be more helpful

  • @luckie6593
    @luckie6593 5 років тому +43

    Great video !! It would be extremely helpful if you make one detailed three.js tutorial 😊

    • @mustafawael8617
      @mustafawael8617 5 років тому

      I agree with you 👌

    • @RedStapler_channel
      @RedStapler_channel  5 років тому +4

      I made three.js basic course a while ago. Check it out :) -> ua-cam.com/video/uzkedMF-l4Q/v-deo.html

  • @joadva
    @joadva 4 роки тому +2

    TypeError: array[i].call is not a function :C help me :c

  • @sunshinevendetta
    @sunshinevendetta 4 роки тому +2

    I did everything on this tutorial but i get a black screen on the page that I uploaded, does anyone has the same error?

    • @deramazone276
      @deramazone276 4 роки тому +1

      same error.

    • @andrey_it
      @andrey_it 4 роки тому +2

      let controls = new THREE.OrbitControls(camera,renderer.domElement);
      instead
      let controls = new THREE.OrbitControls(camera);

    • @sunshinevendetta
      @sunshinevendetta 4 роки тому

      @@andrey_it thank you thank you

  • @ivanesamson5286
    @ivanesamson5286 4 роки тому +2

    Hi sir, How can I add buttons or images inside of that 3d view? Thanks sir!

  • @devadas7439
    @devadas7439 4 роки тому +2

    TypeError: THREE.OrbitControls is not a constructor
    and
    SyntaxError: import declarations may only appear at top level of a module :/

    • @shocked-curry-omelette
      @shocked-curry-omelette 4 роки тому +1

      There are 2 versions available in github, js and jsm. For this tutorial you should use the js version.
      github.com/mrdoob/three.js/blob/master/examples/js/controls/OrbitControls.js

    • @bencross7197
      @bencross7197 4 роки тому

      Did you manage to get this working in the end? I'm stuck as well

    • @devadas7439
      @devadas7439 4 роки тому

      @@bencross7197 Sorry but no

  • @garychap8384
    @garychap8384 5 років тому +1

    Wow, never seen someone skybox their entire scene using huge geometry... I usually just parent a tiny skybox to the camera, and use it with a simple background shader _(doesn't write to the depth buffer)_ ... it's kind of important that the skybox is always centred on the camera, otherwise it gets ugly real quick.

  • @tamaskosa4456
    @tamaskosa4456 3 роки тому

    This library is AWESOME!

  • @mohammadbelalalzoubi8102
    @mohammadbelalalzoubi8102 5 років тому +2

    Great video: simple, short, cool

  • @chasercode1349
    @chasercode1349 5 років тому +7

    Three.js have simple comand for skybox.
    scene.background=new THREE.CubeTextureLoader().setPath("images/sky/").load(["lf.jpg","rt.jpg","up.jpg","dn.jpg","ft.jpg","bk.jpg"]);

    • @ReallyGoodShit
      @ReallyGoodShit 5 років тому

      Seems a lot simpler. How would you use that command with the code from the video? Can't seem to set up the correct geometry when i tried it..

    • @chasercode1349
      @chasercode1349 5 років тому +2

      @@ReallyGoodShit For code from video u need: three.min.js, OrbitControls.js, and 6 sky textures. I run code from video and itsk working.

    • @ReallyGoodShit
      @ReallyGoodShit 5 років тому +1

      @@chasercode1349 I have those libraries. Where do you paste the code you wrote into the code from the video? I tried replacing the lines loading the textures and creating the mesh with your code but it never creates the geomery needed, that is created in the for loop in the video.

    • @chasercode1349
      @chasercode1349 5 років тому +2

      @@ReallyGoodShit Download code here drive.google.com/open?id=15eMHwvv4X9MpOpnPJ1-sMwrKcc7iPE_L

    • @luigixb1
      @luigixb1 4 роки тому

      @@chasercode1349 Very cool Idea! But I get just a blackscreen :( would really appreciate a heads up! . I downloaded your Code and changed nothing but it didnt work yet. Console says, i need to give an encoding. But if i give utf-8, it just shows a blackscreen without further errors.

  • @RKGaming747
    @RKGaming747 4 роки тому +1

    Can u make a cube inside a cube
    Like a obsticles eg.tree

  • @DAG_42
    @DAG_42 5 років тому +1

    A skybox is not a "3d world". However, Three.js will render a 3d world that looks similar to your skybox. Real-time shadow-mapping and everything. Example of a 3d scene and realtime shadows in your browser: threejs.org/examples/?q=light#webgl_lights_physical

  • @ankitsingh1207
    @ankitsingh1207 4 роки тому +1

    @redstapler where i can find those files (styles.css and orbit control.js and three.min.js etc) 🙄

  • @thecomedicdragon4707
    @thecomedicdragon4707 5 років тому +2

    Incredible and helpful video, but what was that music at the beginning of your video.

  • @seb56137
    @seb56137 5 років тому +4

    Great video! The download link for the Skybox images was amazing.

  • @razormilkyway8444
    @razormilkyway8444 4 роки тому

    Putting stickers inside glass box, making it looks liek a worldo.
    *BRILLIANT*👽

  • @EngineeringPlayway
    @EngineeringPlayway 4 роки тому

    What is the way to add the Skybox in Orthographic Camera Mode ?

  • @rolikaseventysix
    @rolikaseventysix 5 років тому +2

    Awesome as always! Thanks!

  • @Filipff
    @Filipff 5 років тому +1

    Hey, a very nice tutorial but could you please help me with an issue (tried running the very same example you provided from local files and then on a Node.js server (http-server) and nothing helped). The console still says:
    SyntaxError: expected expression, got '

    • @Filipff
      @Filipff 5 років тому +1

      Oh, silly me, I've got it finally - my OrbitControls was in fact an .html file and not a proper .js file :D

    • @alexzander2107
      @alexzander2107 4 роки тому

      @@Filipff Could you please provide a link to a full code archive? I have the same issue, but in my case .js file is ok.

  • @ummuser
    @ummuser 5 років тому +1

    No longer working, getting this error: TypeError: b[c].call is not a function

    • @ummuser
      @ummuser 5 років тому

      Okay that error wasn't the problem, I needed a server running to load the pictures so I set up a basic node server for this and it works

    • @luigixb1
      @luigixb1 4 роки тому

      @@ummuser I got the same Problem. Can you help me out? Would really appreciate the help. I already fixed like 5 Error messages and now im stranded here because i dont know how to set up a basic node server.

    • @ummuser
      @ummuser 4 роки тому

      luigixb1 look up how to set up an http server in node.js, the problem here is that the images can’t be fetched Cross-resource so you need a server to give them to your front end. There’s a pretty simple npm package available for setting up a quick server

    • @luigixb1
      @luigixb1 4 роки тому

      @@ummuser Why cross-recource? Would it be possible to send me to code of the server and what you added too, so i dont have to dive into it and learn it? Would reaally be a appreciated

    • @ummuser
      @ummuser 4 роки тому

      luigixb1 because you’re not initially sending the images up, you’re trying to fetch them with js which is protected against by default in the js engine. If you need to fetch images with ja, a server to serve them is necessary

  • @redhook777
    @redhook777 3 роки тому +3

    it's better:
    const loader = new THREE.CubeTextureLoader();
    const texture = loader.load(['1.jpg', '2.jpg','3.jpg','4.jpg', '5.jpg', '6.jpg',]);
    scene.background = texture;

  • @Akosiyawin
    @Akosiyawin 4 роки тому

    Is there a way to smooth out the movement of camera.

  • @dokomei1240
    @dokomei1240 5 років тому +1

    Im in awe. I didnt know javascript can do this!

  • @martaroncero31
    @martaroncero31 3 роки тому

    I'm am having the issue: (index):24 Uncaught TypeError: THREE.OrbitControls is not a constructor , any ideas? Thank you!

  • @haroldmcbroom7807
    @haroldmcbroom7807 4 роки тому

    Am I doing this right? All I see is a black screen that I can zoom in and out of...
    I have my skyboxes in directory, within the project folder... Do they all have to be in the same directory as the main.html file?
    let texture_ft = new THREE.TextureLoader().load('C:\tempwork/Tut01_Skybox/penguin/penguins (2)/arid2_ft.jpg');

  • @martymcflyjr89
    @martymcflyjr89 5 років тому +1

    Awesome, you make good Videos! Keep up the good work! Love it

  • @neozhan7650
    @neozhan7650 4 роки тому

    there is an error message: THREE.OrbitControls: The second parameter "domElement" is now mandatory. How to fix it?
    solved, let controls = new THREE.OrbitControls(camera,renderer.domElement);

  • @mariocalcetin7602
    @mariocalcetin7602 5 років тому +1

    Awesome tutorial maestro!!

  • @Chadderbox
    @Chadderbox 4 роки тому

    How hard would this be to port to VR?

  • @greennights2388
    @greennights2388 4 роки тому

    what editor is that, can copy vertical? - codeblocks does not, povray does.

  • @Maru-ge6jn
    @Maru-ge6jn 4 роки тому

    I have to try this, this sounds like magic!

  • @shreeshbahuguna1400
    @shreeshbahuguna1400 5 років тому

    Uncaught ReferenceError: renderer is not defined(Please Help me out of this)

  • @reeeez
    @reeeez 5 років тому +1

    how do you select text like this 2:38

    • @Hunter-em3dr
      @Hunter-em3dr 5 років тому

      holding down Shift + Alt , then click and drag with the mouse

    • @aprimic
      @aprimic 5 років тому

      thanks for asking the question I couldn't' be assed to ask :D

    • @aprimic
      @aprimic 5 років тому

      @@Hunter-em3dr Is there a name for that type of selection?

    • @RedStapler_channel
      @RedStapler_channel  5 років тому +1

      @@aprimic Column Select - really helpful with redundant work like this

  • @finnam841
    @finnam841 4 роки тому

    bro, u should make a series of three js

  • @CoolScratcher
    @CoolScratcher 4 роки тому +3

    Doesn't work.

    • @gemini3718
      @gemini3718 4 роки тому

      I should've found this comment first.

  • @michaelstat
    @michaelstat 5 років тому +2

    This is awesome, thanks!

  • @stevendevolder942
    @stevendevolder942 5 років тому +9

    line 19 let controls = new THREE.OrbitControls(camera,renderer.domElement);

    • @rkmfrt670
      @rkmfrt670 5 років тому

      thank you bro

    • @andrey_it
      @andrey_it 4 роки тому

      То же самое выбивает, почему у него работает ? :(
      THANK YOU!

    • @gustavosouza4706
      @gustavosouza4706 4 роки тому

      OMG YOU SAVED ME I ALMOST WENT CRAZY THANK YOU

  • @Dr_WFB
    @Dr_WFB 5 років тому

    Lets say I wanted to add put my portfolio in this 3d world, would I just put in my html/css as usual?

    • @RedStapler_channel
      @RedStapler_channel  5 років тому

      yes but you might have to set the 3d canvas position to absolute and lower z-index to push it to the back

  • @aravamuthangovindan1176
    @aravamuthangovindan1176 3 роки тому

    Hi i am getting Uncaught TypeError: scope.domElement is undefined

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

    why isn't my .png loading?

  • @ManojChauhan-kl3dh
    @ManojChauhan-kl3dh 4 роки тому

    how to publish on global website like google site ?

  • @joakimwretlind4016
    @joakimwretlind4016 5 років тому

    Very nice :)
    Just one thing tho, if I hold right mouse-button and drag, I can actually move outside the box. Any solution to that?

    • @thewukong4636
      @thewukong4636 5 років тому

      joakim wretlind check this out: 3:44

    • @joakimwretlind4016
      @joakimwretlind4016 5 років тому +1

      @@thewukong4636 duh, how did I miss that? Thank you very much :)

  • @TimBradleyFromOz
    @TimBradleyFromOz 5 років тому +3

    You should include load times so Devs know the overhead, and can decide whether it's worth trying to include.

    • @DAG_42
      @DAG_42 5 років тому

      The skybox jpgs are vastly larger than the Three.js library. In other words, the load time should be nearly instantaneous for almost all of your site's visitors.

  • @IAVIC
    @IAVIC 4 роки тому

    Que gran trabajo hizo el Español que creo "Three.js".

  • @mhmdalharbi2370
    @mhmdalharbi2370 5 років тому +2

    2:22 how do you rename multiple variables?

    • @sexy.big.monkey
      @sexy.big.monkey 5 років тому

      multi cursor

    • @sexy.big.monkey
      @sexy.big.monkey 5 років тому

      code.visualstudio.com/docs/editor/codebasics

    • @sexy.big.monkey
      @sexy.big.monkey 5 років тому

      For Sublime Text
      gist.github.com/dufferzafar/7673209

    • @mhmdalharbi2370
      @mhmdalharbi2370 5 років тому

      @@sexy.big.monkey thanks

    • @DrunkenUFOPilot
      @DrunkenUFOPilot 5 років тому

      I use Geany for editing source code. Hold down Ctrl while dragging the cursor along a column to cut/copy, and again when selecting text to be replaced.

  • @indranishome9003
    @indranishome9003 4 роки тому

    Setting material.side with a for-each loop would be a better code readability feature. Otherwise nice video.

  • @pavanms571
    @pavanms571 3 роки тому

    Can anyone please ping the versions or js files in which this is working

  • @briseidamontiel4777
    @briseidamontiel4777 5 років тому +6

    You're the best!

  • @karthikraja4024
    @karthikraja4024 5 років тому

    Awesome tutorial sir.

  • @NotTrigerredInsaan
    @NotTrigerredInsaan 3 роки тому

    bro vs code but your code is not working

  • @sadiaal-mamory8338
    @sadiaal-mamory8338 5 років тому +1

    Awesome ... I love it
    Goid job pro. ..thanks for sharing

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

    how did you get the three.min.js file?

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

      Run : npm i three after it : import * as THREE from 'three';

  • @hellloooworld1124
    @hellloooworld1124 4 роки тому

    Really helpful and more than that it’s just 5 mins

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

    excellent tutoriel merci !

  • @mohammadmotiwala7672
    @mohammadmotiwala7672 5 років тому

    Great dude.. hey could you please make vedio for Three js in Details ??

  • @WhyThisMedia
    @WhyThisMedia 5 років тому +8

    Why do you have 79k subs
    You should have 7.9m subs

  • @maurov6861
    @maurov6861 2 роки тому +1

    don't work

  • @abelsantosmoz
    @abelsantosmoz 4 роки тому

    ainda funciona isso????

  • @Donclion911
    @Donclion911 5 років тому

    really good 3d js-library

  • @omarl7333
    @omarl7333 5 років тому

    how to make a skybox infinite? like babylonjs do

    • @superbytgamer1014
      @superbytgamer1014 5 років тому

      Omar L ya how do yo make big open world like GTA 5

  • @themallaris5918
    @themallaris5918 4 роки тому

    Orbit Controls.js raw plz

  • @amir123786
    @amir123786 5 років тому

    Devil tech sure can do mad things.

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

    this code doesnt work but is a good intro to where we can find cool 3d landscapes

  • @Kim-learns-to-fly
    @Kim-learns-to-fly 2 роки тому +1

    Great tutorial! Short and easy to follow along!

  • @luicirsantosferraz7142
    @luicirsantosferraz7142 5 років тому

    splendid! 👏👏👏👏👏👏

  • @efegfg
    @efegfg 5 років тому +2

    Uncaught TypeError: THREE.OrbitControls is not a constructor
    I try lot of things to fix it, but i don't know why, orbitcontrols.js as bug line 1 ( i juste copy past their code github )
    i've installed npm, three, three-orbitcontrols ...
    If someone can help me, cool... !

    • @zacharyouellette1384
      @zacharyouellette1384 5 років тому

      @wgcs new error after copying the code Uncaught TypeError: Cannot read property 'ROTATE' of undefined
      at new THREE.OrbitControls (OrbitControls.js:84)

  • @MACH_SDQ
    @MACH_SDQ 5 років тому

    Just AWESOME !!!!

  • @anzy99829
    @anzy99829 5 років тому +1

    add it to wallpaper engine

  • @Bangers04
    @Bangers04 3 роки тому

    I feel like my brain is going to burn but still i can manage it

  • @HuynhLuong227
    @HuynhLuong227 5 років тому

    Amazing keep going

  • @RKGaming747
    @RKGaming747 4 роки тому +1

    Skybox inside a Skybox

  • @gcinumusaduma2112
    @gcinumusaduma2112 4 роки тому

    i love your work too but this thing aint working

  • @gimhana6916
    @gimhana6916 3 роки тому

    not work for me

  • @patrisiin7695
    @patrisiin7695 4 роки тому

    wow its so amazing

  • @TheEnde124
    @TheEnde124 4 роки тому

    Little to none explanation to what the code does?

  • @AndreaGomezJimenez
    @AndreaGomezJimenez 5 років тому

    Excelente tienes mi suscripción.

  • @CalvinHeath
    @CalvinHeath 4 роки тому

    Love the minecraft music lol

  • @josiclerlemesilva4062
    @josiclerlemesilva4062 5 років тому

    Thank you😊👏👏

  • @guabz___
    @guabz___ 5 років тому

    More more more!!! WebGL is awesome!

  • @ilhamsa01
    @ilhamsa01 5 років тому

    wow.. rare tutorial

  • @shenduxing
    @shenduxing 5 років тому

    great video

  • @woomygfx
    @woomygfx 4 роки тому

    your intro sounds similar to another intro that you might be familiar of

  • @suparthghimire1644
    @suparthghimire1644 5 років тому

    Thankyou So much! :)

  • @Dumah2007
    @Dumah2007 4 роки тому

    nice channel name

  • @HotchiwawaChronicles
    @HotchiwawaChronicles 5 років тому

    Seems simple :D

  • @KlorofilASN
    @KlorofilASN 4 роки тому

    the earth is box