【问题标题】:Loading .fbx file from URL – Is that possible?从 URL 加载 .fbx 文件 - 这可能吗?
【发布时间】:2019-10-07 09:19:59
【问题描述】:

我处理过这个: https://threejs.org/examples/webgl_loader_fbx.html

如果我将 »models/fbx/Samba Dancing.fbx« 替换为 »https://github.com/mrdoob/three.js/raw/master/examples/models/fbx/Samba%20Dancing.fbx«,代码将停止工作。

从其他网络空间加载 .fbx 文件对我来说很重要。有没有办法解决这个问题?

谢谢!

【问题讨论】:

    标签: javascript three.js fbx


    【解决方案1】:

    由于 CORS 政策,您的网址无效。例如,Chrome 在浏览器控制台中报告以下错误:

    从源“http://localhost:8080”访问“https://github.com/mrdoob/three.js/raw/master/examples/models/fbx/Samba%20Dancing.fbx”处的 XMLHttpRequest 已被 CORS 策略阻止:“Access-Control-Allow-Origin”标头的值“https://render.githubusercontent.com”不等于提供的来源。

    尝试使用此 URL,而不是设置所需的 HTTP 标头:

    https://threejs.org/examples/models/fbx/Samba%20Dancing.fbx

    【讨论】:

    • 非常感谢!
    猜你喜欢
    • 2016-02-07
    • 2019-11-02
    • 2013-07-19
    • 1970-01-01
    • 2011-02-16
    • 2011-02-24
    • 2021-06-25
    • 2021-01-15
    • 2018-10-06
    相关资源
    最近更新 更多