【问题标题】:three js sphere device controls limit camera rotation三个js球体设备控制限制相机旋转
【发布时间】:2015-02-23 09:54:19
【问题描述】:

使用三个js创建一个球体并在里面添加一个360度的图片。 现在,照片底部有一个黑洞。

有没有办法限制相机旋转并防止用户看到球体的最底部?

我有这个用于相机:

this.controls = new THREE.DeviceOrientationControls(this.camera, true);
  • 也在寻找使用 OrbitControls 的解决方案。

this.controls = new THREE.OrbitControls(this.camera, this.element);

目标设备:手机支持 webgl。

【问题讨论】:

  • 嗨,你有想过这个吗?

标签: three.js


【解决方案1】:

来自THREE.OrbitControls 的来源。如您所见,您可以限制控件的旋转。

// How far you can orbit vertically, upper and lower limits.
// Range is 0 to Math.PI radians.
this.minPolarAngle = 0; // radians
this.maxPolarAngle = Math.PI; // radians

// How far you can orbit horizontally, upper and lower limits.
// If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ].
this.minAzimuthAngle = - Infinity; // radians
this.maxAzimuthAngle = Infinity; // radians

【讨论】:

  • 谢谢!知道这是否可以在 DeviceOrientationControls 上实现?
  • 没有在 DeviceOrientationControls 上看到任何此类属性。
猜你喜欢
  • 2015-04-18
  • 2014-01-27
  • 2015-04-26
  • 2020-05-10
  • 2021-04-15
  • 2013-01-22
  • 2015-07-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多