【问题标题】:Understanding the difference between a Viewer and a ViewingApplication了解 Viewer 和 ViewingApplication 之间的区别
【发布时间】:2019-10-30 20:29:41
【问题描述】:

这个问题与我之前的问题(How to implement a Forge Autodesk model-aggregating viewer?)有关。我现在的查看器是基于http://learnforge.autodesk.io/#/教程的,有一部分代码我看不懂:

var options = {
  env: 'AutodeskProduction',
  getAccessToken: getForgeToken
};
var documentId = 'urn:' + urn;
console.log(documentId)
Autodesk.Viewing.Initializer(options, function onInitialized() {
  viewerApp = new Autodesk.Viewing.ViewingApplication('forgeViewer');
  viewerApp.registerViewer(viewerApp.k3D, Autodesk.Viewing.Private.GuiViewer3D);
  viewerApp.loadDocument(documentId, onDocumentLoadSuccess, onDocumentLoadFailure);
});

据我所知,前面的代码初始化了查看器。但是我不知道viewerApp 是什么类型的对象。确实:

【问题讨论】:

    标签: autodesk-forge autodesk-viewer


    【解决方案1】:

    我建议不要使用 ViewingApplication,因为它在即将推出的 Viewer v7.*(下周 GTA)中已被弃用(尽管 ployfill 可用于旧版支持)。

    使用Autodesk.Viewing.Private.GuiViewer3DAutodesk.Viewing.Private.Viewer3D 并查看here,了解如何初始化和加载模型。

    AAutodesk.Viewing.Document.load(相当于loadDocument)上查看doc

    【讨论】:

    • 非常感谢!它解决了我的问题,现在我有了一个基本的查看器!
    猜你喜欢
    • 2011-10-26
    • 2011-05-16
    • 1970-01-01
    • 2020-03-22
    • 1970-01-01
    • 1970-01-01
    • 2023-03-03
    • 2017-07-26
    • 2016-03-16
    相关资源
    最近更新 更多