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:
parent
444060b91d
commit
a283ac7c8f
17
src/models/FBX.js
Normal file
17
src/models/FBX.js
Normal 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);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user