通过GLTF文件中的材料和网格(和动画)循环并导入三个JS

发布于 2025-02-11 08:06:19 字数 797 浏览 1 评论 0原文

我敢肯定,这可能是以前曾经问过的,但是我是三j(和反应纤维)的新手,所以我的问题的一部分并不是真正知道如何用我需要的东西。.

我知道我想做什么必须有可能,因为可以在此处拖放任何GLTF文件: https:// https:// gltf-viewer。 donmccurdy.com/ 看到它正确呈现。

因此,我想做的是创建一个带有/没有动画的GLTF模型的循环(,例如此),并将其作为网页的一部分输出。

目前,我发现自己乏味地试图为模型的每个部分添加< mesh>,而且我知道必须有一种更简单的方法。

我找到了“ nofollow noreferrer”> source-code a>在这里,但是如前所述,我仍然是该库的新手,因此将不胜感激的是任何帮助(或链接到类似问题)。

I'm sure this has probably been asked before, but I'm fairly new to threejs (and React Fiber), so part of my problem here is not really knowing how to phrase what I need..

I know what I want to do must be possible, because it is possible to drag and drop any gltf file here: https://gltf-viewer.donmccurdy.com/ and see it rendered correctly.

So, what I want to do, is create a loop which will traverse all parts (nodes?) of a gltf model with/without animations (such as this one) and output it as part of a webpage.

Currently, I find myself tediously trying to add a <mesh> for each and every part of a model, and I know there must be an easier way.

I have found the source-code for the viewer here, but as mentioned, I'm still quite new to this library, so any help (or link to a similar question), would be appreciated.

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

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

发布评论

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