简体   繁体   English

我可以限制X3DOM中的视口操纵以防止缩放吗?

[英]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. 我有一个3D模型,需要使用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. 转台类型具有我尝试过的typeParams功能。 But it doesn't seem to restrict zoom. 但这似乎并没有限制缩放。 Thanks for any thoughts on how I can allow for rotation, while preventing zoom. 感谢您对我如何允许旋转同时防止缩放的任何想法。

将速度= 0添加到navigationInfo应该可以做到这一点。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM