Three.JS如何使用GLTFLoader从字符串变量加载bin GLB(GLTF)?

时间:2019-02-28 08:26:00

标签: javascript three.js gltf

ThreeJS如何使用GLTFLoader从字符串变量加载bin GLB(GLTF) 加载程序脚本中没有任何修改?

GLTFLoader(https://threejs.org/docs/index.html#examples/loaders/GLTFLoader) 加载前RAW信息bin-GLB是否已存储在var str中?但是加载程序等待bin文件的URL,然后加载并对其本身进行解析:

str="glTF 9 0 JSON{"accessors":[{"bufferView":0,"componentType":5121,"count":456,
    "max":[85],
    "min":[0],"type":"SCALAR"},{"bufferView":1,"componentType":5126,"count":86,
    "max":[0.28029435873031616,0.2851730287075043,-0.5903046131134033],
    "min":[-0.2780577540397644,-0.27945515513420105,-1.1599042415618896],"type":"VEC3"},{"bufferView":2,"componentType":5126,"count":86,
    "max":[0.9879146814346313,0.9945066571235657,0.999969482421875],
    "min":[-0.9674672484397888,-0.9902645945549011,-0.999176025390625]"

更新:我知道loader的.parse方法,但是我在当前.load函数周围有一个函数,因此会产生其他混杂,并且与普通文件加载具有兼容性,因此无法更改此函数(((因为尝试将此二进制字符串加载为URi这是我的测试代码笔,具有正常的.load功能CODEPEN EXAMPLE

0 个答案:

没有答案