我正在使用插件vue-babylonjs将obj导入vue,但是我似乎无法将obj导入其中,有人可以给我一些提示或指出我的代码有什么问题吗?
codesandbox
https://codesandbox.io/s/8p289q2lwl
<template>
<div>
<Scene v-model="productScene">
<Property
name="clearColor"
color="#fff"/>
<Camera
v-model="camera"
:radius="2500"
type="arcRotate" />
</Scene>
</div>
</template>
<script>
import Vue from 'vue';
import vb from 'vue-babylonjs';
import 'babylonjs-loaders';
import 'babylonjs-inspector';
Vue.use(vb);
export default {
data() {
return {
productScene: null,
camera: null,
};
},
watch: {
productScene() {
const scene = this.productScene;
this.BABYLON.SceneLoader.ShowLoadingScreen = false;
this.BABYLON.SceneLoader.Append(
'src/assets/3d/',
'femaletest.3d',
scene,
(newScene) => {
this.produceScene = newScene;
this.productScene.createDefaultCameraOrLight(true, true, true)
this.productScene.activeCamera.alpha += Math.PI
}
)
}
}
}
</script>
<style>
html,
body {
padding: 0px;
margin: 0px;
}
</style>
obj模型应该处于阶段,但是我似乎无法导入它。