3

i am importing obj into vue using plugin vue-babylonjs , but i cant seem to get the obj into it , can anyone give me some tips or pin point what wrong with my code ?

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>

the obj model should be in the stage but i cant seem to import it.

0 Answers0