king2088 / vue-3d-loader

VueJS and threeJS 3d viewer plugin
https://king2088.github.io/vue-3d-loader-docs
MIT License
222 stars 38 forks source link

在html中引入vue进行代码书写后,无法使用vue-3d-loader #91

Closed TECNB closed 8 months ago

TECNB commented 8 months ago

html页面使用vue-3d-loader时

如果采用符合vue2的1.3.0的版本,那么就会直接无法找到vue-3d-loader, 报错: Uncaught SyntaxError: The requested module '../../plugins/node_modules/vue-3d-loader/dist/vue-3d-loader.umd.min.js' does not provide an export named 'default' (at list.html:167:14)

如果采用不符合vue2的2.2.0的版本,那么这样就可以找到vue-3d-loader,上面的报错消失,但是出现新的报错,这次是直接找不到vue

报错:

Uncaught TypeError: Failed to resolve module specifier "vue". Relative references must start with either "/", "./", or "../".

部分代码如下: 截屏2023-10-23 21.50.46

king2088 commented 8 months ago

请设置版本号后再试,如:https://unpkg.com/vue-3d-loader@1.3.0/dist/vue-3d-loader.umd.min.js

TECNB commented 8 months ago

版本号修改后报错如下,不知道怎么解决: Uncaught SyntaxError: The requested module 'https://unpkg.com/vue-3d-loader@1.3.0/dist/vue-3d-loader.umd.min.js' does not provide an export named 'vue3dLoader' (at list.html:167:15)

king2088 commented 8 months ago

看似并不支持再html中引入

TECNB commented 8 months ago

另外我很想知道是怎么实现多个texture渲染同一个模型的,我自己采用three.js就只能采用子节点的方法,但是有时候模型就只有一个节点,但是下载下来的模型材质图却有很多张 截屏2023-10-23 21.50.46

king2088 commented 8 months ago

另外我很想知道是怎么实现多个texture渲染同一个模型的,我自己采用three.js就只能采用子节点的方法,但是有时候模型就只有一个节点,但是下载下来的模型材质图却有很多张 截屏2023-10-23 21.50.46

此问题我并未深究过,可能需要你去threeJS官方查看相关实例或文档

TECNB commented 8 months ago

那组件中的textureImage是怎么实现渲染的呢 截屏2023-10-23 21.50.46

king2088 commented 8 months ago

image 采用TextureLoader实现的,官方文档:https://threejs.org/docs/index.html?q=text#api/en/loaders/TextureLoader