模型放大时如何设置枢轴



发现BIM360查看器在缩放时设置了枢轴,但本机查看器不提供此功能。我尝试使用viewer.navigation.setPivotPoint(point);,但我不知道如何在鼠标位置后缩放。

BIM360演示

只需调用vieewr.navigation.setWheelSetsPivot(true)来激活此行为

如果你想让它成为你的查看器应用程序的默认行为,你可以在查看器配置文件设置中更改它。

let viewer = new Autodesk.Viewing.GuiViewer3D(document.getElementById('forgeViewer'), config3d);
let startedCode = viewer.start();
if (startedCode > 0) {
console.error('Failed to create a Viewer: WebGL not supported.');
return;
}
const profileSettings = Autodesk.Viewing.ProfileSettings.clone(Autodesk.Viewing.ProfileSettings.AEC);
profileSettings.settings.wheelSetsPivot = true;
const profile = new Autodesk.Viewing.Profile(profileSettings);
viewer.setProfile(profile);
//Autodesk.Viewing.Document.load(documentId, onDocumentLoadSuccess, onDocumentLoadFailure);

最新更新