diff --git a/examples/webgl_interactive_voxelpainter.html b/examples/webgl_interactive_voxelpainter.html
index 247ee6b0..be3ffd58 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();
+ directionalLight.position.set( 1, 0.75, 0.5 ).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();
- 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 ) {