threejs加载带材质的fbx格式模型

threejs加载带材质的fbx格式模型

        loadFBX() {
            let manager = new LoadingManager();
            manager.addHandler(/\.tga$/i, new TGALoader());
            const fbxLoader = new FBXLoader(manager);
            this.modelPath = this.getModelPath();
            fbxLoader.load(this.modelPath, (object) => {
                console.log(object,'object')
                object.name = "person";
                this.fbxData = object;
                this.initFbxData = JSON.parse(JSON.stringify(object));
                // this.isPlayAnimation(object);
                this.changeTexture(object);
                this.scene.add(object);
                this.modelTexure();
                this.changeCamera()
            });
        },

  有不懂的可以加qq学习群:910316886

posted @ 2023-03-24 18:34  web与webGL  阅读(956)  评论(0编辑  收藏  举报