SHARE
TWEET

Untitled

a guest Feb 19th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Add First THREE Camera
  2. camera_Main = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 10000);
  3. camera_Main.position.set(-2000, 500, 500); //Set camera position
  4. camera_Main_declared = true; //Checks if camera is declared for animate() function
  5.  
  6. orbitController_Main = new THREE.OrbitControls(camera_Main, renderer_Main.domElement);
  7. orbitController.maxPolarAngle = Math.PI / 2;  
  8. orbitController.enablePan = false;
  9. orbitController.maxDistance = 2800;
  10. orbitController.minDistance = 400;
  11. orbitController.saveState();
  12.  
  13. //Create Second Camera
  14. camera_RT = new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight, -100, -500);
  15. var helper = new THREE.CameraHelper( camera_RT );
  16. scene_Main.add( helper );
  17.      
  18. orbitController.?????????? // Set camera_RT as default
  19. orbitController.reset(); //Reset camera_RT orbit controls
  20.      
  21. var oControl_Main = new THREE.OrbitControls(camera_Main, renderer_Main.domElement);
  22. var oControl_RT = new THREE.OrbitControls(camera_RT, renderer_Main.domElement);
  23.  
  24. // Only main camera is enabled
  25. function enableMain() {
  26.     oControl_Main.enabled = true;
  27.     oControl_RT.enabled = false;
  28. }
  29.  
  30. // Swap control to RT camera
  31. function enableRT() {
  32.     oControl_Main.enabled = false;
  33.     oControl_RT.enabled = true;
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top