Hello,
When zooming with a mouse having the smooth scroll mode on, the zoom is too sensitive and the model is zooming in and out too fast.
Is there any option to help me fixing this issue ?
Many thanks
Hello,
When zooming with a mouse having the smooth scroll mode on, the zoom is too sensitive and the model is zooming in and out too fast.
Is there any option to help me fixing this issue ?
Many thanks
Hello @pdesert,
As this is your first post, welcome to the forum!
For certain hardware manufacturers, such as Logitech, the smooth scrolling effect creates additional intermediate events. However, the Communicator operators process mouse events as they are passed through the Web Viewer. You can try adjusting the delta to, say 0.5 or smaller, via the function setMouseWheelZoomDelta. While this may mitigate the effects somewhat, there is still the possibility of “overshooting” the target.
We are cognizant that Communicator is used in a very wide variety of applications and industries. And as such, greater customization to the operators can be a huge benefit to developers – allowing them to fine-tune them to their specific requirements. To that end, as a reference, we do publish the TypsScript code for the operators which can be found in the directory:
HOOPS_Communicator_2024.8.0\web_viewer\deprecated\typescript\operators
Thanks,
Tino
Hello @tino,
Thank you for reply.
Indeed I already tried to adjust the zoom delta but it does not suit the two mouse wheel sensitivity modes.
Following your answer, I tried replacing the Zoom operator but both operators seem to work simultaneously and OperatorManager.indexOf(OperatorId) returns -1. How can I remove or replace the default operator ?
Hello @pdesert,
By default, the first operator in the stack is the Navigate operator which combines pan, zoom, orbit into one special operator. The discrete Zoom operator is not actually in the operator stack. Thus, when calling the following, the result is -1
:
let om = hwv.operatorManager;
om.indexOf(Communicator.OperatorId.Zoom);
So if you wanted to put your own Zoom operator in the stack, you can replace Navigate with Zoom via:
let om = hwv.operatorManager;
om.replaceOperator(Communicator.OperatorId.Navigate, Communicator.OperatorId.Zoom);
But by doing so, you will lose the pan and orbit feature. To avoid this, you can keep the Navigate operator in the stack and just adjust the zoom wheel delta to your liking:
let om = hwv.operatorManager;
let operatorZoom = om.getOperator(Communicator.OperatorId.Zoom);
let currentValue = operatorZoom.getMouseWheelZoomDelta();
//Change value
operatorZoom.setMouseWheelZoomDelta(newValue);
Thanks,
Tino