x3dom

How to change X3DOM mouse model for rotating camera


Currently X3DOM handles camera movement like all scene is in a sphere, dragging mouse left to right moves the sphere (thus the scene) around the center of that sphere, like this.

Can we change this behaviour like in Blender's, as the same left to right dragging rotates the scene around Z axis (in other words, changes the azimuth without changing the current elevation) and dragging from up to down changes the elevation, without changing azimuth, like this one?


Solution

  • There are some navigation modes available: https://doc.x3dom.org/tutorials/animationInteraction/navigation/index.html. However I think you will have to create your own navigation mode if you want to have exact behaviour as in Blender.

    For example you could activate the "Turntable" mode adding the following to your scene node:

    <NavigationInfo type= 'turntable' ></NavigationInfo>
    

    You can also find some discussion regarding more control over the navigation on mailing list and within the issues of X3DOM: https://github.com/x3dom/x3dom/issues/454 and https://github.com/x3dom/x3dom/issues/486