Methods
Navigation

setNavigationMode

sets the navigation mode for the viewer example usage const navigationmode = "orbit"; viewer3d setnavigationmode(navigationmode); parameters navigationmode the navigation mode to use type required string or map\[array\[object]] yes some predefined navigation modes are available value description orbit default, orbit camera around a point on drag pan pan camera on drag pivot pivot camera around a point on drag advanced usage you can also set a custom navigation mode by providing a map of device to list of event actions the mapping provided replaces all default navigation and interaction actions example usage const navigationmode = { mouse \[ { event "click", action "select", filter { button 0, }, }, { event "doubleclick", action "fittoview", filter { button 0, }, }, { event "drag", action "orbit", filter { button 0, }, }, ], }; viewer3d setnavigationmode(navigationmode); event action name type description action string the action to perform event string the event to listen for filter object filter the event scale number scale the action device valid values are mouse touch action valid values are click doubleclick select contextmenu fittoview zoom zoommove rotatez rotatex moveleft moveup moveforward orbit pivot pan event valid mouse device values are click doubleclick wheel drag valid touch device values are tap doubletap longpress pinch pan actions are executed in the order specified by the event actions list if you have cancelled an action (e g a viewer3d click event has preventdefault set to true ), the rest of the matching actions are not executed filter type map\[number or boolean] filter mouse button events with the button key, valid values are 0 for left button 1 for middle button 2 for right button mouse \[ { event "click", action "contextmenu", filter { button 2, }, }, ]; filter touch events by number of active pointers and long press with the pointers and longpress keys touch \[ { event "tap", action "select", filter { pointers 2, longpress true, }, }, ]; scale scale the movement of the action by a factor, default value is 1 0 increase the value to make the movement from the action more sensitive providing a negative value will invert the movement