无法将.babylon文件加载到Babylon(导入未定义场景)

现在,我在将.babylon文件加载到vue-babylonjs场景时遇到问题。我不是专业人士,所以如果我不熟悉所有方面,我必须提前道歉。

这是我在组件中的代码。我的components文件夹中也有.babylon文件。

<template>
  <div>
      <canvas id="renderCanvas"></canvas>
</div>
</template>

export default {
  import * as BABYLON from 'babylonjs'
  import 'babylonjs-loaders'
  data: function() {
    return {
      scene: null,engine: null,canvas: null,mainCamera: null,};
  },methods: {
        init: function () {
          const _this = this
          this.canvas = document.getElementById("renderCanvas")
          this.engine = new BABYLON.Engine(this.canvas,true)
          this.scene = new BABYLON.Scene(this.engine)

          this.mainCamera = new BABYLON.ArcRotateCamera("ArcRotateCamera",1.5,1.3,20,BABYLON.Vector3.Zero(),this.scene)
          this.scene.beforeRender = function () {

          }
          this.engine.runRenderLoop(function () {
            _this.scene.render()
          })
          BABYLON.SceneLoader.Append("./","fox.babylon",this.scene,function (scene) {

});


        },mounted() {
    this.init()
}
}

我还尝试将.babylon文件加载到沙箱中,并且工作正常。

但是我收到以下错误消息:

  

JS-[23:04:48]:无法从/fox.babylon加载:importScene   来自未定义版本的未定义:未定义,导出程序的版本:   undefinedimportScene JSON解析失败e._ErrorEnabled @   webpack-internal:///../node_modules/babylonjs/babylon.js:16

在我的网络中,我收到304错误,由babylon.js在第16行中初始化。 我可以在这里添加该行中的代码,但是它只有几页,所以我不确定这会有多大用处...

我真的很感谢您的宝贵时间,如果有人可以帮助您,我们将非常高兴!

jzllong 回答:无法将.babylon文件加载到Babylon(导入未定义场景)

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3163302.html

大家都在问