Search code examples
html3dx3dx3dom

Can I restrict viewport manipulation in X3DOM to prevent zooming?


I have a 3D model that I need to display on a webpage, using X3DOM.

I would like visitors to this page to be able to click and drag the image, rotating it on any axis, but I don't want them to have the ability to zoom. Currently I can only figure out how to give them rotational ability AND the zoom. I can't figure out how to restrict the zoom aspects of the viewport.

<x3d id='someUniqueId' showStat='false' showLog='false' x='0px' y='0px' width='1920px' height='1080px'>
  <scene>
    <navigationInfo type='"turntable"'></navigationInfo>
    <inline url='models/model.x3d' inline>
  <scene>
</x3d>

The turntable type has a typeParams feature, that I've tried. But it doesn't seem to restrict zoom. Thanks for any thoughts on how I can allow for rotation, while preventing zoom.


Solution

  • Adding speed = 0 to navigationInfo should do that.

    <navigationInfo type="turntable" speed="0"/>