From a283ac7c8f60223a3105ff91d3a5b668e4ec18c7 Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Sat, 13 Mar 2021 16:59:41 +0100 Subject: [PATCH] add fbx model --- src/models/FBX.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/models/FBX.js diff --git a/src/models/FBX.js b/src/models/FBX.js new file mode 100644 index 0000000..996a084 --- /dev/null +++ b/src/models/FBX.js @@ -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); + }); + }, +};