| | |
| | | |
| | | let PI_2 = Math.PI / 2; //used by controls below |
| | | |
| | | // let cameraInfoElement = document.getElementById('cameraInfo'); |
| | | // cameraInfoElement.style.cursor = "default"; |
| | | // cameraInfoElement.style.userSelect = "none"; |
| | | // cameraInfoElement.style.MozUserSelect = "none"; |
| | | |
| | | let mouseControl = true; |
| | | let pointerlockChange; |
| | | let fileLoader = new THREE.FileLoader(); |
| | |
| | | } // end function onWindowResize( event ) |
| | | |
| | | |
| | | |
| | | function init() |
| | | { |
| | | |
| | |
| | | // gui = new g(); // same as gui = new GUI(); |
| | | |
| | | // pixel_ResolutionController = gui.add(pixel_ResolutionObject, 'pixel_Resolution', 0.5, 1.0, 0.05).onChange(handlePixelResolutionChange); |
| | | if (!mouseControl) |
| | | orthographicCamera_ToggleController = gui.add(orthographicCamera_ToggleObject, 'Orthographic_Camera', false).onChange(handleCameraProjectionChange); |
| | | // if (!mouseControl) // todo: 是否能够点击 |
| | | // orthographicCamera_ToggleController = gui.add(orthographicCamera_ToggleObject, 'Orthographic_Camera', false).onChange(handleCameraProjectionChange); |
| | | |
| | | // gui.domElement.style.userSelect = "none"; |
| | | // gui.domElement.style.MozUserSelect = "none"; |
| | |
| | | document.addEventListener('webkitpointerlockchange', pointerlockChange, false); |
| | | |
| | | } // end if (mouseControl) |
| | | |
| | | |
| | | /* // Fullscreen API (optional) |
| | | document.addEventListener("click", function() |
| | | { |
| | | if ( !document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement ) |
| | | { |
| | | if (document.documentElement.requestFullscreen) |
| | | document.documentElement.requestFullscreen(); |
| | | else if (document.documentElement.mozRequestFullScreen) |
| | | document.documentElement.mozRequestFullScreen(); |
| | | else if (document.documentElement.webkitRequestFullscreen) |
| | | document.documentElement.webkitRequestFullscreen(); |
| | | } |
| | | }); */ |
| | | |
| | | |
| | | initTHREEjs(); // boilerplate: init necessary three.js items and scene/demo-specific objects |
| | |
| | | initSceneData(); |
| | | |
| | | // pixel_ResolutionController.setValue(pixelRatio); |
| | | if (!allowOrthographicCamera && !mouseControl) |
| | | { |
| | | orthographicCamera_ToggleController.domElement.hidden = true; |
| | | orthographicCamera_ToggleController.domElement.remove(); |
| | | } |
| | | // if (!allowOrthographicCamera && !mouseControl) |
| | | // { |
| | | // orthographicCamera_ToggleController.domElement.hidden = true; |
| | | // orthographicCamera_ToggleController.domElement.remove(); |
| | | // } |
| | | |
| | | |
| | | |