0

I would like to basically know how do I access the list of vertices and triangular faces from the scene of gltf file. What I have currently is this.

return from(fetch(targetUrl.toString(), {
                method: 'GET',
                headers: {
                  'Content-Type': 'application/json'
                }
              }).then(response => {
                  response.arrayBuffer()
                    .then(data => {
                      const loader = new GLTFLoader();
                      loader.parse(data, "", gltf => {
                        this.scene.add(gltf.scene);
                      })
                    })
                })).pipe(
                    map((surfaceMesh) => {
                        this.surfaceMeshes.set(surfaceMeshKey, surfaceMesh);
                    }
                ))
        }  

I would like to have the array of vertices and triangular faces in this regard, not the count! Can somebody please help me out in this case? It would mean a lot to me if you guys do the syntax of how the modified code would look like?

Willow555
  • 13
  • 4
  • If you're trying to look at the structure of your `gltf` file, just use `console.log(gltf)`, then look at your developer console. You can dig through its properties, and you'll get a good understanding of how all the data is structured inside of it. – M - Jun 21 '22 at 16:06
  • I get what you're saying but how do I get the list of vertices and trig_faces in the gltf file from the scene? – Willow555 Jun 22 '22 at 06:32

0 Answers0