diff --git a/examples/webgl_interactive_voxelpainter.html b/examples/webgl_interactive_voxelpainter.html index 247ee6b09eabe1a0b7fd69789d2ae65e610ecd35..be3ffd584a039c318e4df2298fcc87a2f2c0a6a5 100644 --- a/examples/webgl_interactive_voxelpainter.html +++ b/examples/webgl_interactive_voxelpainter.html @@ -22,7 +22,7 @@ - + @@ -44,7 +44,7 @@ var gui, voxelConfig = { orthographicProjection: false }; - + init(); animate(); @@ -58,12 +58,12 @@ info.style.top = '10px'; info.style.width = '100%'; info.style.textAlign = 'center'; - info.innerHTML = 'three.js - voxel painter - webgl
click: add voxel, control + click: remove voxel, shift + click: rotate, save .png'; + info.innerHTML = 'three.js - voxel painter - webgl
click: add voxel, control + click: remove voxel, shift + click: rotate, save .png'; container.appendChild( info ); camera = new THREE.CombinedCamera( window.innerWidth, window.innerHeight, 45, 1, 10000, -2000, 10000 ); camera.position.y = 800; - + cameraTarget = new THREE.Vector3( 0, 0, 0 ); scene = new THREE.Scene(); @@ -99,20 +99,10 @@ scene.add( ambientLight ); var directionalLight = new THREE.DirectionalLight( 0xffffff ); - directionalLight.position.x = Math.random() - 0.5; - directionalLight.position.y = Math.random() - 0.5; - directionalLight.position.z = Math.random() - 0.5; - directionalLight.position.normalize(); - scene.add( directionalLight ); - - var directionalLight = new THREE.DirectionalLight( 0x808080 ); - directionalLight.position.x = Math.random() - 0.5; - directionalLight.position.y = Math.random() - 0.5; - directionalLight.position.z = Math.random() - 0.5; - directionalLight.position.normalize(); + directionalLight.position.set( 1, 0.75, 0.5 ).normalize(); scene.add( directionalLight ); - renderer = new THREE.WebGLRenderer( { antialias: true } ); + renderer = new THREE.WebGLRenderer( { antialias: true, preserveDrawingBuffer : true } ); renderer.setSize( window.innerWidth, window.innerHeight ); container.appendChild( renderer.domElement ); @@ -126,11 +116,11 @@ document.addEventListener( 'mousedown', onDocumentMouseDown, false ); document.addEventListener( 'keydown', onDocumentKeyDown, false ); document.addEventListener( 'keyup', onDocumentKeyUp, false ); - + // add GUI gui = new GUI(); gui.add(voxelConfig, 'orthographicProjection').onChange(function(){ - + if ( voxelConfig.orthographicProjection ) { camera.toOrthographic(); camera.position.x = 1000; @@ -141,9 +131,9 @@ camera.toPerspective(); camera.position.y = 800; } - + }); - + } function getRealIntersector( intersects ) {