【发布时间】:2019-09-26 21:21:22
【问题描述】:
在 Autodesk Forge Viewer 中,我无法在同一页面上实例化超过 6 个查看器 (Autodesk.Viewing.ViewingApplication)。
我尝试过这里提出的解决方案,但它不起作用: There are too many active WebGL contexts on this page, the oldest context will be lost. [dedup.min.js]
我使用的函数:
Autodesk.Viewing.Initializer(options, function onInitialized(){
this.viewerApp = new Autodesk.Viewing.ViewingApplication(this.div_id);
this.viewerApp.registerViewer(this.viewerApp.k3D, Autodesk.Viewing.Private.GuiViewer3D, { extensions: ['PropertyInspectorExtension']});
this.viewerApp.loadDocument(documentId, onDocumentLoadSuccess, onDocumentLoadFailure);
}.bind(this));
显然,有一种方法*可以使用 Three.js 来实现,但它是否以某种方式在 Autodesk Forge 中实现?不然我自己都不知道怎么弄。
*答案: Display multiple instances of three.js in a single page Is it possible to enable unbounded number of renderers in THREE.js?
*结果示例: https://threejs.org/examples/webgl_multiple_elements.html
【问题讨论】:
-
Autodesk Forge Viewer 中未实现。也许您可以考虑设计您的页面,以便一次只有一个视图处于活动状态。您也可以尝试使用virtual-webgl。您可能应该像自述文件中提到的那样禁用 webgl2。
标签: webgl autodesk-viewer