我们的一个用户有这个请求来模仿不同软件的用户体验。
目前,我们创建一个截面平面,并移动黄色箭头与鼠标。是否可以用键组合(shift +鼠标滚动事件)沿着箭头的方向移动创建的区段平面。
如果是的话,有人能给我指明正确的方向吗?
发布于 2020-10-15 14:19:28
您可以通过编程控制当前区段平面,如下所示:
function moveSectionPlaneByDelta(viewer, delta) {
// Assuming that section tool is active
const sectionTool = viewer.toolController.getActiveTool();
const sectionPlanes = sectionTool.getSectionPlanes();
if (sectionPlanes.length === 1) {
const normal = new THREE.Vector3(sectionPlanes[0].x, sectionPlanes[0].y, sectionPlanes[0].z);
const position = normal.clone().multiplyScalar(-sectionPlanes[0].w + delta);
sectionTool.setSectionPlane(normal, position);
}
}
// ...
moveSectionPlaneByDelta(viewer, 5.0); // move in the direction of the plane normal
moveSectionPlaneByDelta(viewer, -5.0); // move against the direction of the plane normal
https://stackoverflow.com/questions/64372916
复制相似问题