I recently incorporated first person controls into my three.js scene. I am now seeking a way to restrict the camera views in order to prevent the ends of the scene from being displayed. My implementation utilizes the firstpersoncontrols.js from the three.js library, which offers mouse, W, A, S, D, and arrow controls. How can I achieve this limitation of camera views using these controls? I have already attempted to restrict the control distance. Here is the current setup for the camera and controls:
camera = new THREE.PerspectiveCamera( 55, window.innerWidth / window.innerHeight, 1, 20000 );
camera.position.set( 30, 30, 100 );
//
controls = new THREE.FirstPersonControls( camera );
controls.movementSpeed = 100;
controls.enabled=true;
controls.maxDistance=50; // no change
controls.minDistance=10;
controls.enablezoom=false;