diff --git a/examples/webgl_lines_fat.html b/examples/webgl_lines_fat.html index 2a45b1b3c79b3952df4ccac8cfea5ca7b9947ec3..3c987fe67a421bd1d5c980479ee4b8a2a7fd213c 100644 --- a/examples/webgl_lines_fat.html +++ b/examples/webgl_lines_fat.html @@ -205,9 +205,9 @@ renderer.setScissorTest( true ); - renderer.setScissor( 20, window.innerHeight - insetHeight - 20, insetWidth, insetHeight ); + renderer.setScissor( 20, 20, insetWidth, insetHeight ); - renderer.setViewport( 20, window.innerHeight - insetHeight - 20, insetWidth, insetHeight ); + renderer.setViewport( 20, 20, insetWidth, insetHeight ); camera2.position.copy( camera.position ); camera2.quaternion.copy( camera.quaternion ); diff --git a/examples/webgl_multiple_elements.html b/examples/webgl_multiple_elements.html index 224edccb05cbbccf64ebaa61c5627572fe0c447b..ec0e55f5c57971089ee9c6b86af4bbb8a3c28ad2 100644 --- a/examples/webgl_multiple_elements.html +++ b/examples/webgl_multiple_elements.html @@ -224,10 +224,10 @@ var width = rect.right - rect.left; var height = rect.bottom - rect.top; var left = rect.left; - var top = rect.top; + var bottom = renderer.domElement.clientHeight - rect.bottom; - renderer.setViewport( left, top, width, height ); - renderer.setScissor( left, top, width, height ); + renderer.setViewport( left, bottom, width, height ); + renderer.setScissor( left, bottom, width, height ); var camera = scene.userData.camera; diff --git a/examples/webgl_multiple_elements_text.html b/examples/webgl_multiple_elements_text.html index 4d1ef11d73149a11744e4cbdfae6e9cd61fde3af..289e4935a722eaeb0841704b340a452022388487 100644 --- a/examples/webgl_multiple_elements_text.html +++ b/examples/webgl_multiple_elements_text.html @@ -252,10 +252,10 @@ var width = rect.right - rect.left; var height = rect.bottom - rect.top; var left = rect.left; - var top = rect.top; + var bottom = renderer.domElement.clientHeight - rect.bottom; - renderer.setViewport( left, top, width, height ); - renderer.setScissor( left, top, width, height ); + renderer.setViewport( left, bottom, width, height ); + renderer.setScissor( left, bottom, width, height ); renderer.render( scene, scene.userData.camera ); diff --git a/examples/webgl_multiple_views.html b/examples/webgl_multiple_views.html index 51de22a184598315c5f0e913ca6c0b92f1f760ec..e287441220a724679f24ba6d995fff38573e0ffa 100644 --- a/examples/webgl_multiple_views.html +++ b/examples/webgl_multiple_views.html @@ -57,7 +57,7 @@ var views = [ { left: 0, - top: 0, + bottom: 0, width: 0.5, height: 1.0, background: new THREE.Color( 0.5, 0.5, 0.7 ), @@ -74,7 +74,7 @@ }, { left: 0.5, - top: 0.5, + bottom: 0, width: 0.5, height: 0.5, background: new THREE.Color( 0.7, 0.5, 0.5 ), @@ -91,7 +91,7 @@ }, { left: 0.5, - top: 0, + bottom: 0.5, width: 0.5, height: 0.5, background: new THREE.Color( 0.5, 0.7, 0.7 ), @@ -280,12 +280,12 @@ view.updateCamera( camera, scene, mouseX, mouseY ); var left = Math.floor( windowWidth * view.left ); - var top = Math.floor( windowHeight * view.top ); + var bottom = Math.floor( windowHeight * view.bottom ); var width = Math.floor( windowWidth * view.width ); var height = Math.floor( windowHeight * view.height ); - renderer.setViewport( left, top, width, height ); - renderer.setScissor( left, top, width, height ); + renderer.setViewport( left, bottom, width, height ); + renderer.setScissor( left, bottom, width, height ); renderer.setScissorTest( true ); renderer.setClearColor( view.background ); diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js index 74a223fa3bf662494e85f4c3d4bf0f3eaeb3cd48..574fe77ecb49c91b8fdd89d19b4aedf80b3529d1 100644 --- a/src/renderers/WebGLRenderer.js +++ b/src/renderers/WebGLRenderer.js @@ -426,14 +426,14 @@ function WebGLRenderer( parameters ) { this.setViewport = function ( x, y, width, height ) { - _viewport.set( x, _height - y - height, width, height ); + _viewport.set( x, y, width, height ); state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ) ); }; this.setScissor = function ( x, y, width, height ) { - _scissor.set( x, _height - y - height, width, height ); + _scissor.set( x, y, width, height ); state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ) ); };