I have an object and I can drag the camera all around. To avoid to move the camera too far I have added some check inside the render method:
render() {
if (this.camera.position.x>4) this.camera.position.x = 4;
if (this.camera.position.y>4) this.camera.position.y = 4;
if (this.camera.position.z>4) this.camera.position.z = 4;
if (this.camera.position.x<-4) this.camera.position.x = -4;
if (this.camera.position.y<-4) this.camera.position.y = -4;
if (this.camera.position.z<-4) this.camera.position.z = -4;
...
}
This works. But how to avoid the camera to go to near the object? Have I to set some data range or there is some special property?
Thanks for any suggestion!