设置反向缩放方向
Set Reverse Zoom Direction
我正在练习forge的使用,从取景器入手。我目前正在使用 Forge 版本 6 ... 我想设置缩放地址。我找到了一个收到名为 setReverseZoomDirection 的 bool 的卫理公会教徒。但是我找不到关于如何使用它的信息。
本来打算在onItemLoadSuccess(viewer, item)方法中使用如下,但是没有成功
onItemLoadSuccess(viewer, item) {
console.log("onItemLoadSuccess()!");
viewerApp.myCurrentViewer.setTheme("light-theme");
console.log(viewer)
viewerApp.myCurrentViewer.navigation.SetReverseZoomDirection(true);
},
正确的方法名应该是setReverseZoomDirection
w/o开头的s
小写字母:
NOP_VIEWER.navigation.setReverseZoomDirection(true/false)
如果仍然不走运,请尝试推迟设置方向,直到加载模型 - 比如 Autodesk.Viewing.GEOMETRY_LOADED_EVENT
被触发时:
NOP_VIEWER.addEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT,()=>{
//...
})
PS:ViewerApplication
已从 v7+ 开始弃用,因此请考虑迁移到 v7 - 有关详细信息,请参阅 here。
我正在练习forge的使用,从取景器入手。我目前正在使用 Forge 版本 6 ... 我想设置缩放地址。我找到了一个收到名为 setReverseZoomDirection 的 bool 的卫理公会教徒。但是我找不到关于如何使用它的信息。
本来打算在onItemLoadSuccess(viewer, item)方法中使用如下,但是没有成功
onItemLoadSuccess(viewer, item) {
console.log("onItemLoadSuccess()!");
viewerApp.myCurrentViewer.setTheme("light-theme");
console.log(viewer)
viewerApp.myCurrentViewer.navigation.SetReverseZoomDirection(true);
},
正确的方法名应该是setReverseZoomDirection
w/o开头的s
小写字母:
NOP_VIEWER.navigation.setReverseZoomDirection(true/false)
如果仍然不走运,请尝试推迟设置方向,直到加载模型 - 比如 Autodesk.Viewing.GEOMETRY_LOADED_EVENT
被触发时:
NOP_VIEWER.addEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT,()=>{
//...
})
PS:ViewerApplication
已从 v7+ 开始弃用,因此请考虑迁移到 v7 - 有关详细信息,请参阅 here。