通过 webgl 中的 bin 文件加载模型?

发布于 2024-09-30 03:02:35 字数 111 浏览 10 评论 0原文

我看到一个示例,其中数据位于数组内的文本中,我看到另一个示例,其中有人通过 ajax 使用 json 加载模型。

有没有办法通过二进制加载文件?我不想通过 4mb json 加载 1mb 模型

I see an example where the data was in text inside an array, i seen another where someone loads the model through ajax with json.

Is there a way to load the files via binary? i dont feel like loading a 1mb model via 4mb json

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

嗫嚅 2024-10-07 03:02:35

当然可以加载二进制文件。

http://blog.nihilogic.dk/2008/05 /reading-exif-data-with-javascript.html

但问题在那之后。您需要知道它的格式。并从那里提取所有内容。

It is certainly possible to load binary files.

http://blog.nihilogic.dk/2008/05/reading-exif-data-with-javascript.html

But the problem is after that. That you need to know what format it is in. And extract everything from there.

月依秋水 2024-10-07 03:02:35

您可以使用jQuery Binary Ajax,或者对于新浏览器,< a href="https://developer.mozilla.org/en/using_xmlhttprequest#Receiving_binary_data" rel="nofollow">ArrayBuffer

You can use jQuery Binary Ajax, or for new browsers, ArrayBuffer

梦屿孤独相伴 2024-10-07 03:02:35

如果文件使用 gzip 压缩,则 json 大小几乎与二进制文件大小相同。

无论如何,您可以使用 二进制加载器 Three.js 如果你确实需要的话。

If file is compressed with gzip then json size is almoast same as binary file size.

Anyway you can use binary loader from three.js if you really need it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文