gpt4 book ai didi

archilogic - 如何通过存储 API 从我上传的 3d 模型中获取 .data3d.buffer

转载 作者:行者123 更新时间:2023-12-02 01:08:29 25 4
gpt4 key购买 nike

我可以通过存储 api 上传我的 3d 模型。但我无法从存储 api 获取 .data3d.buffer。我发现 .data3d.buffer 是 aframe 加载 3d 模型所必需的。如何通过存储 api 获取 .data3d.buffer??

最佳答案

如果你有存储 key ,你可以直接从storage.3d.io下载模型。

例子:

io3d.storage.put(myFile).then(function (storageKey) {
console.log('the data3d.buffer is now at', 'https://storage.3d.io' + storageKey)
})

请注意,该文件将有一个 .gz.data3d.buffer,因为浏览器将在下载时解压缩打包的 Assets 。您可能必须删除 .gz 才能直接使用该文件。

Storage API可以直接使用,但是会自动帮你把二进制文件解析成JSON。

要在 A-Frame 中使用模型,您只需要存储 key (在浏览器中):

io3d.storage.put(myFile).then(function (storageKey) {
var model = document.createElement('a-entity')
model.setAttribute('io3d-data3d', 'key: ' + storageKey)
document.querySelector('a-scene').appendChild(model)
})

关于archilogic - 如何通过存储 API 从我上传的 3d 模型中获取 .data3d.buffer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46459928/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com