从 URL 加载 .fbx 文件 – 这可能吗?
Loading .fbx file from URL – Is that possible?
我处理过这个:
https://threejs.org/examples/webgl_loader_fbx.html
如果我替换 »models/fbx/Samba Dancing.fbx« with »https://github.com/mrdoob/three.js/raw/master/examples/models/fbx/Samba%20Dancing.fbx«,代码将停止工作。
从其他网站空间加载 .fbx 文件对我来说很重要。有办法解决这个问题吗?
谢谢!
由于 CORS 策略,您的 URL 不起作用。 Chrome例如在浏览器控制台报如下错误:
Access to XMLHttpRequest at 'https://github.com/mrdoob/three.js/raw/master/examples/models/fbx/Samba%20Dancing.fbx' from origin 'http://localhost:8080' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://render.githubusercontent.com' that is not equal to the supplied origin.
尝试使用此 URL 代替,它具有所需的 HTTP header 设置:
我处理过这个: https://threejs.org/examples/webgl_loader_fbx.html
如果我替换 »models/fbx/Samba Dancing.fbx« with »https://github.com/mrdoob/three.js/raw/master/examples/models/fbx/Samba%20Dancing.fbx«,代码将停止工作。
从其他网站空间加载 .fbx 文件对我来说很重要。有办法解决这个问题吗?
谢谢!
由于 CORS 策略,您的 URL 不起作用。 Chrome例如在浏览器控制台报如下错误:
Access to XMLHttpRequest at 'https://github.com/mrdoob/three.js/raw/master/examples/models/fbx/Samba%20Dancing.fbx' from origin 'http://localhost:8080' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://render.githubusercontent.com' that is not equal to the supplied origin.
尝试使用此 URL 代替,它具有所需的 HTTP header 设置: