1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

add fbx model

This commit is contained in:
Kevin Levron 2021-03-13 16:59:41 +01:00
parent 444060b91d
commit a283ac7c8f

17
src/models/FBX.js Normal file
View File

@ -0,0 +1,17 @@
import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader.js';
import Object3D from '../core/Object3D.js';
export default {
extends: Object3D,
emits: ['loaded'],
props: {
src: String,
},
created() {
const loader = new FBXLoader();
loader.load(this.src, (fbx) => {
this.$emit('loaded', fbx);
this.initObject3D(fbx);
});
},
};