我可以为两个查看者使用Autodesk forge中的停靠面板吗? [英] Can i use docking panel in Autodesk forge for both viewers?
问题描述
我有两个查看者来比较模型.我为属性创建了一个停靠面板,我希望该面板在两个查看器中浮动.有可能,谁会告诉你怎么做?
I have two viewers to compare models. I created a docking panel for properties, and I want this panel to float in two viewers. Is it possible and who will tell you how to do it?
推荐答案
好的,还有两个选择:
选项A: 如果第二张图片是静态" ...为什么不只是拍摄一张截图"并将其放在右侧面板中呢? 您可以使用viewer.getScreenShot()命令来检索PNG博客,并将其绘制到画布上.
option A: if the second image is 'static'... why not just take a 'screenshot' and place it in the right side panel? You can use the viewer.getScreenShot() command to retrieve a PNG blog, and paint it into the canvas.
// Get the full image
viewer.getScreenShot(viewer.container.clientWidth, viewer.container.clientHeight, function (blobURL) {
screenshot.src = blobURL;
});
有关在画布上绘制图像的更多详细信息,请参见此处: https://forge. autodesk.com/blog/screenshot-markups
For more details on drawing images to a canvas, see here: https://forge.autodesk.com/blog/screenshot-markups
选项B: 如果两个面板可以独立控制,则可以尝试通过某种按钮的按下(或操作)来同步摄像机的状态.
option B: if the two panels can be independently controlled, then perhaps try to sync the camera state, with some kind of button press (or action).
在这些博客文章的帮助下:
with the help of these blog articles:
- https://forge.autodesk.com/blog/map-forge-viewer-camera-back-navisworks
- 获取相机位置并将其恢复到Forge Viewer中以进行虚拟访问
- https://forge.autodesk.com/blog/map-forge-viewer-camera-back-navisworks
- Get the Camera position and restore it in Forge Viewer for a virtual visit
例如:
viewer.getState();
viewer.restoreState();
或使用导航对象恢复摄像机位置:
or restore camera position using navigation object:
const nav = this.navigation;
nav.getTarget();
nav.getPosition();
nav.getCameraUpVector();
这篇关于我可以为两个查看者使用Autodesk forge中的停靠面板吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!