So I’m making a 3d project with three.js. Everything works as expected on my laptop. I’m using OrbitControls
to allow camera movement, but i have disabled right click panning, because I want the camera just to rotate. When switching to a mobile device (iphone), using two fingers I’m able to move the camera (not rotate). Is there a way to disable this behaviour on mobile devices?
My OrbitControls:
this.controls = new OrbitControls(this.camera, this.renderer.domElement)
this.controls.enableDamping = true
this.controls.maxPolarAngle = Math.PI * 0.45
this.controls.mouseButtons = {
LEFT: THREE.MOUSE.ROTATE,
MIDDLE: THREE.MOUSE.DOLLY,
RIGHT: ''
}
Update function:
_RAF() {
requestAnimationFrame(() => {
this.water.material.uniforms[ 'time' ].value += 1.0 / 60.0
this.controls.maxDistance = 10000.0
this.controls.minDistance = 10.0
this.controls.update()
this.camera.updateProjectionMatrix()
this.renderer.render(this.scene, this.camera)
this._RAF()
})
}