未验证 提交 6c051346 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #18189 from WestLangley/dev_pmrem_test_2

Examples: more PMREM test cleanup
...@@ -66,13 +66,13 @@ ...@@ -66,13 +66,13 @@
// controls // controls
controls = new OrbitControls( camera, renderer.domElement ); controls = new OrbitControls( camera, renderer.domElement );
controls.addEventListener( 'change', render ); // use if there is no animation loop
controls.minDistance = 4; controls.minDistance = 4;
controls.maxDistance = 20; controls.maxDistance = 20;
controls.update();
// light // light
var directionalLight = new THREE.DirectionalLight( 0xffffff, 1 ); var directionalLight = new THREE.DirectionalLight( 0xffffff, 0 ); // set intensity to 0 to start
var x = 597; var x = 597;
var y = 213; var y = 213;
var theta = ( x + 0.5 ) * Math.PI / 512; var theta = ( x + 0.5 ) * Math.PI / 512;
...@@ -101,6 +101,8 @@ ...@@ -101,6 +101,8 @@
} ); } );
render();
} ); } );
document.body.addEventListener( 'mouseout', function () { document.body.addEventListener( 'mouseout', function () {
...@@ -116,6 +118,8 @@ ...@@ -116,6 +118,8 @@
} ); } );
render();
} ); } );
} }
...@@ -158,6 +162,8 @@ ...@@ -158,6 +162,8 @@
} }
render();
} ); } );
} }
...@@ -172,6 +178,8 @@ ...@@ -172,6 +178,8 @@
renderer.setSize( width, height ); renderer.setSize( width, height );
render();
} }
function updateCamera() { function updateCamera() {
...@@ -183,12 +191,6 @@ ...@@ -183,12 +191,6 @@
} }
function animate() {
renderer.setAnimationLoop( render );
}
function render() { function render() {
renderer.render( scene, camera ); renderer.render( scene, camera );
...@@ -198,7 +200,7 @@ ...@@ -198,7 +200,7 @@
Promise.resolve() Promise.resolve()
.then( init ) .then( init )
.then( createObjects ) .then( createObjects )
.then( animate ); .then( render );
</script> </script>
</body> </body>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册