-
Notifications
You must be signed in to change notification settings - Fork 633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
通过Three加载的gltf模型,打包后显示异常 #1772
Comments
要不录一个视频,全方位看一下 🐴 怎么显示异常的 |
打包部署和本地开发环境,依赖版本都是一致的吗? |
是的,是在本地开发环境直接打包部署的。 |
这主要是由于baseLayer.ts中根据函数构造器名字来判断面剔除(gl.cullFace),然而,打包时通常会进行代码压缩混淆,函数名字随之改变,所以得到了错误的函数名字,面剔除判断随之错误。 public renderModels() {
// ...
// 获取到 L7 的 gl
const gl = this.rendererService.getGLContext();
this.rendererService.setCustomLayerDefaults();
const cullFace =
this.mapService.constructor.name === 'AMapService' ? gl.BACK : gl.FRONT;
gl.cullFace(cullFace);
// ...
} 解决办法之一是修改库函数,使之不判断函数构造器名字 |
此处应是个BUG,考虑修复 |
请教一下 你们怎么销毁threejs的模型 |
this.mapService.constructor.name === 'AMapService' 这个判断吗? |
是的 |
正常显示:
异常显示,从背后可以看到马脸:
在vue2中引入antv-l7,通过threejs加载gltf(参照官方示例),本地dev启动运行显示正常,打包部署后显示异常。
The text was updated successfully, but these errors were encountered: