如何在以下代码中访问顶点和三角形面的列表?

发布于 2025-02-09 18:16:43 字数 853 浏览 1 评论 0原文

我基本上想知道如何从GLTF文件的场景中访问顶点和三角形面的列表。我目前拥有的。

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 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文