Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

192
Views
Load gltfs from firebase

I have a gltf file which exist in firebase storage folders and related textures are also located in that folders. I want to load that object into my view. I using THREE js for do this.

screenshot

I tried get download url of gltf file and pass it it GLTFLoader. But model was not loaded to view. I tried with this :

const loader = new GLTFLoader()
    loader.load(
      url,
         (gltf) => {
            gltf.scene.traverse(  ( child ) => {
              if ( child instanceof THREE.Mesh ) {                  
                  console.log(child.material.metalness)
                  if(child.material.metalness){
                    child.material.envMap = texture;
                  }                      
              }            
          } );            
            var parent = gltf.scene;
            var box = new THREE.Box3().setFromObject(parent)
            var center = box.getCenter(new THREE.Vector3())
            var size = box.getSize(new THREE.Vector3())
            var maxAxis = Math.max(size.x,size.y,size.z)            
            parent.scale.multiplyScalar(1/maxAxis)
            box.setFromObject(parent);
            box.getCenter(center)
            box.getSize(size)
            parent.position.copy(center).multiplyScalar(-1)           
            scene.add(gltf.scene)           
        },
        (xhr) => {
            console.log((xhr.loaded / xhr.total) * 100 + '% loaded')
        },
        (error) => {
            console.log(error)
        }
    )

If I load this file from local device, it is works fine and model display in view(all textures are load properly).

If anyone can help me how to load gltf file from firebase storage

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

I believe you should use getDownloadURL() from firebase like any other file. check this out Firebase Cloud

about 4 years ago · Juan Pablo Isaza Report

0

May not be the best solution but if you save the file as a .glb (binary version of .gltf), then there is only one file with textures already wrapped up in it. If not, you will need to store all the gltf data in one folder and load the whole lot including textures.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!