Ver Fonte

Fix linter errors

Lewy Blue há 6 anos atrás
pai
commit
4ebbdc8f64

+ 3 - 5
examples/css2d_label.html

@@ -46,8 +46,8 @@
 
 		<script>
 
-			var camera, scene, scene2, renderer, labelRenderer;
-			var controls;
+			var camera, scene, renderer, labelRenderer;
+
 			var clock = new THREE.Clock();
 			var textureLoader = new THREE.TextureLoader();
 
@@ -64,12 +64,10 @@
 				camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 1000 );
 				camera.position.set( 10, 5, 20 );
 
-				controls = new THREE.OrbitControls( camera );
+				var controls = new THREE.OrbitControls( camera );
 
 				scene = new THREE.Scene();
 
-				scene2 = new THREE.Scene();
-
 				var dirLight = new THREE.DirectionalLight( 0xffffff );
 				dirLight.position.set( 0, 0, 1 );
 				scene.add( dirLight );

+ 19 - 7
examples/css3d_molecules.html

@@ -180,11 +180,11 @@
 
 			function generateButtonCallback( url ) {
 
-				return function ( event ) {
+				return function () {
 
 					loadMolecule( url );
 
-				}
+				};
 
 			}
 
@@ -196,7 +196,7 @@
 					button.innerHTML = m;
 					menu.appendChild( button );
 
-					var url = "models/molecules/" +  MOLECULES[ m ];
+					var url = "models/molecules/" + MOLECULES[ m ];
 
 					button.addEventListener( 'click', generateButtonCallback( url ), false );
 
@@ -206,9 +206,21 @@
 				var b_b = document.getElementById( "b_b" );
 				var b_ab = document.getElementById( "b_ab" );
 
-				b_a.addEventListener( 'click', function() { visualizationType = 0; showAtoms() } );
-				b_b.addEventListener( 'click', function() { visualizationType = 1; showBonds() } );
-				b_ab.addEventListener( 'click', function() { visualizationType = 2; showAtomsBonds() } );
+				b_a.addEventListener( 'click', function () {
+
+					visualizationType = 0; showAtoms();
+
+				} );
+				b_b.addEventListener( 'click', function () {
+
+					visualizationType = 1; showBonds();
+
+				} );
+				b_ab.addEventListener( 'click', function () {
+
+					visualizationType = 2; showAtomsBonds();
+
+				} );
 
 			}
 
@@ -458,7 +470,7 @@
 						joint.updateMatrix();
 
 						var object = new THREE.CSS3DObject( bond );
-						object.rotation.y = Math.PI/2;
+						object.rotation.y = Math.PI / 2;
 
 						object.matrixAutoUpdate = false;
 						object.updateMatrix();

+ 1 - 3
examples/css3d_orthographic.html

@@ -42,8 +42,6 @@
 
 			var scene2, renderer2;
 
-			var controls;
-
 			init();
 			animate();
 
@@ -55,7 +53,7 @@
 
 				camera.position.set( - 200, 200, 200 );
 
-				controls = new THREE.OrbitControls( camera );
+				var controls = new THREE.OrbitControls( camera );
 
 				scene = new THREE.Scene();
 				scene.background = new THREE.Color( 0xf0f0f0 );

+ 8 - 9
examples/css3d_panorama.html

@@ -38,7 +38,6 @@
 		<script>
 
 			var camera, scene, renderer;
-			var geometry, material, mesh;
 			var target = new THREE.Vector3();
 
 			var lon = 90, lat = 0;
@@ -58,32 +57,32 @@
 				var sides = [
 					{
 						url: 'textures/cube/Bridge2/posx.jpg',
-						position: [ -512, 0, 0 ],
+						position: [ - 512, 0, 0 ],
 						rotation: [ 0, Math.PI / 2, 0 ]
 					},
 					{
 						url: 'textures/cube/Bridge2/negx.jpg',
 						position: [ 512, 0, 0 ],
-						rotation: [ 0, -Math.PI / 2, 0 ]
+						rotation: [ 0, - Math.PI / 2, 0 ]
 					},
 					{
 						url: 'textures/cube/Bridge2/posy.jpg',
-						position: [ 0,  512, 0 ],
+						position: [ 0, 512, 0 ],
 						rotation: [ Math.PI / 2, 0, Math.PI ]
 					},
 					{
 						url: 'textures/cube/Bridge2/negy.jpg',
-						position: [ 0, -512, 0 ],
+						position: [ 0, - 512, 0 ],
 						rotation: [ - Math.PI / 2, 0, Math.PI ]
 					},
 					{
 						url: 'textures/cube/Bridge2/posz.jpg',
-						position: [ 0, 0,  512 ],
+						position: [ 0, 0, 512 ],
 						rotation: [ 0, Math.PI, 0 ]
 					},
 					{
 						url: 'textures/cube/Bridge2/negz.jpg',
-						position: [ 0, 0, -512 ],
+						position: [ 0, 0, - 512 ],
 						rotation: [ 0, 0, 0 ]
 					}
 				];
@@ -147,7 +146,7 @@
 
 			}
 
-			function onDocumentMouseUp( event ) {
+			function onDocumentMouseUp() {
 
 				document.removeEventListener( 'mousemove', onDocumentMouseMove );
 				document.removeEventListener( 'mouseup', onDocumentMouseUp );
@@ -193,7 +192,7 @@
 
 				requestAnimationFrame( animate );
 
-				lon +=  0.1;
+				lon += 0.1;
 				lat = Math.max( - 85, Math.min( 85, lat ) );
 				phi = THREE.Math.degToRad( 90 - lat );
 				theta = THREE.Math.degToRad( lon );

+ 6 - 7
examples/css3d_panorama_deviceorientation.html

@@ -40,7 +40,6 @@
 
 			var camera, scene, renderer;
 			var controls;
-			var geometry, material, mesh;
 
 			init();
 			animate();
@@ -56,32 +55,32 @@
 				var sides = [
 					{
 						url: 'textures/cube/Bridge2/posx.jpg',
-						position: [ -512, 0, 0 ],
+						position: [ - 512, 0, 0 ],
 						rotation: [ 0, Math.PI / 2, 0 ]
 					},
 					{
 						url: 'textures/cube/Bridge2/negx.jpg',
 						position: [ 512, 0, 0 ],
-						rotation: [ 0, -Math.PI / 2, 0 ]
+						rotation: [ 0, - Math.PI / 2, 0 ]
 					},
 					{
 						url: 'textures/cube/Bridge2/posy.jpg',
-						position: [ 0,  512, 0 ],
+						position: [ 0, 512, 0 ],
 						rotation: [ Math.PI / 2, 0, Math.PI ]
 					},
 					{
 						url: 'textures/cube/Bridge2/negy.jpg',
-						position: [ 0, -512, 0 ],
+						position: [ 0, - 512, 0 ],
 						rotation: [ - Math.PI / 2, 0, Math.PI ]
 					},
 					{
 						url: 'textures/cube/Bridge2/posz.jpg',
-						position: [ 0, 0,  512 ],
+						position: [ 0, 0, 512 ],
 						rotation: [ 0, Math.PI, 0 ]
 					},
 					{
 						url: 'textures/cube/Bridge2/negz.jpg',
-						position: [ 0, 0, -512 ],
+						position: [ 0, 0, - 512 ],
 						rotation: [ 0, 0, 0 ]
 					}
 				];

+ 6 - 6
examples/css3d_periodictable.html

@@ -262,7 +262,7 @@
 
 					var number = document.createElement( 'div' );
 					number.className = 'number';
-					number.textContent = (i/5) + 1;
+					number.textContent = ( i / 5 ) + 1;
 					element.appendChild( number );
 
 					var symbol = document.createElement( 'div' );
@@ -299,7 +299,7 @@
 
 				for ( var i = 0, l = objects.length; i < l; i ++ ) {
 
-					var phi = Math.acos( -1 + ( 2 * i ) / l );
+					var phi = Math.acos( - 1 + ( 2 * i ) / l );
 					var theta = Math.sqrt( l * Math.PI ) * phi;
 
 					var object = new THREE.Object3D();
@@ -366,28 +366,28 @@
 				controls.addEventListener( 'change', render );
 
 				var button = document.getElementById( 'table' );
-				button.addEventListener( 'click', function ( event ) {
+				button.addEventListener( 'click', function () {
 
 					transform( targets.table, 2000 );
 
 				}, false );
 
 				var button = document.getElementById( 'sphere' );
-				button.addEventListener( 'click', function ( event ) {
+				button.addEventListener( 'click', function () {
 
 					transform( targets.sphere, 2000 );
 
 				}, false );
 
 				var button = document.getElementById( 'helix' );
-				button.addEventListener( 'click', function ( event ) {
+				button.addEventListener( 'click', function () {
 
 					transform( targets.helix, 2000 );
 
 				}, false );
 
 				var button = document.getElementById( 'grid' );
-				button.addEventListener( 'click', function ( event ) {
+				button.addEventListener( 'click', function () {
 
 					transform( targets.grid, 2000 );
 

+ 2 - 2
examples/css3d_sprites.html

@@ -64,7 +64,7 @@
 				scene = new THREE.Scene();
 
 				var image = document.createElement( 'img' );
-				image.addEventListener( 'load', function ( event ) {
+				image.addEventListener( 'load', function () {
 
 					for ( var i = 0; i < particlesTotal; i ++ ) {
 
@@ -135,7 +135,7 @@
 
 				for ( var i = 0; i < particlesTotal; i ++ ) {
 
-					var phi = Math.acos( -1 + ( 2 * i ) / particlesTotal );
+					var phi = Math.acos( - 1 + ( 2 * i ) / particlesTotal );
 					var theta = Math.sqrt( particlesTotal * Math.PI ) * phi;
 
 					positions.push(

+ 10 - 3
examples/css3d_youtube.html

@@ -11,7 +11,6 @@
 			}
 			#blocker {
 				position: absolute;
-				/* background-color: rgba(255, 0, 0, 0.5); */
 				top: 0px;
 				left: 0px;
 				width: 100%;
@@ -87,8 +86,16 @@
 				var blocker = document.getElementById( 'blocker' );
 				blocker.style.display = 'none';
 
-				document.addEventListener( 'mousedown', function () { blocker.style.display = ''; } );
-				document.addEventListener( 'mouseup', function () { blocker.style.display = 'none'; } );
+				document.addEventListener( 'mousedown', function () {
+
+					blocker.style.display = '';
+
+				} );
+				document.addEventListener( 'mouseup', function () {
+
+					blocker.style.display = 'none';
+
+				} );
 
 			}
 

+ 3 - 16
examples/raytracing_sandbox.html

@@ -25,7 +25,7 @@
 
 			var container, info;
 
-			var camera, controls, scene, renderer;
+			var camera, scene, renderer;
 			var group;
 
 			init();
@@ -266,7 +266,7 @@
 				container.appendChild( renderer.domElement );
 
 
-				window.addEventListener( 'resize', function( e ) {
+				window.addEventListener( 'resize', function () {
 
 					renderer.setSize( innerWidth, innerHeight );
 
@@ -283,25 +283,12 @@
 
 				}
 
-				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js<a/> - raytracing renderer (using '  + WORKERS + ' <button onclick="updateWorkers(-1)">-</button><button onclick="updateWorkers(1)">+</button> web workers)' +
+				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js<a/> - raytracing renderer (using ' + WORKERS + ' <button onclick="updateWorkers(-1)">-</button><button onclick="updateWorkers(1)">+</button> web workers)' +
 				'<br/><button onclick="rearrange()">Rearrange</button><button onclick="render()">Render</button>';
 
 
 			}
 
-			function rearrange() {
-
-				group.children.forEach( function( o ) {
-
-					o.position.y += ( Math.random() - 0.5 ) * 100;
-					o.position.x += ( Math.random() - 0.5 ) * 400;
-					o.position.z += ( Math.random() - 0.5 ) * 400;
-
-				} );
-
-			}
-
-
 			function render() {
 
 				renderer.render( scene, camera );

+ 18 - 14
examples/software_lines_splines.html

@@ -56,10 +56,10 @@
 
 			var mouseX = 0, mouseY = 0,
 
-			windowHalfX = window.innerWidth / 2,
-			windowHalfY = window.innerHeight / 2,
+				windowHalfX = window.innerWidth / 2,
+				windowHalfY = window.innerHeight / 2,
 
-			camera, scene, renderer, material, stats;
+				camera, scene, renderer, material, stats;
 
 			init();
 			animate();
@@ -82,10 +82,10 @@
 				container.appendChild( renderer.domElement );
 
 				var geometry = new THREE.Geometry(),
-				geometry2 = new THREE.Geometry(),
-				geometry3 = new THREE.Geometry(),
-				points = hilbert3D( new THREE.Vector3(), 200.0, 1, 0, 1, 2, 3, 4, 5, 6, 7 ),
-				colors = [], colors2 = [], colors3 = [];
+					geometry2 = new THREE.Geometry(),
+					geometry3 = new THREE.Geometry(),
+					points = hilbert3D( new THREE.Vector3(), 200.0, 1, 0, 1, 2, 3, 4, 5, 6, 7 ),
+					colors = [], colors2 = [], colors3 = [];
 
 				var subdivisions = 6;
 
@@ -119,17 +119,17 @@
 				material = new THREE.LineBasicMaterial( { color: 0xffffff, opacity: 1, linewidth: 3, vertexColors: THREE.VertexColors } );
 
 				var line, p, scale = 0.3, d = 225;
-				var parameters =  [
-					[ material, scale*1.5, [-d,0,0],  geometry ],
-					[ material, scale*1.5, [0,0,0],  geometry2 ],
-					[ material, scale*1.5, [d,0,0],  geometry3 ]
+				var parameters = [
+					[ material, scale * 1.5, [ - d, 0, 0 ], geometry ],
+					[ material, scale * 1.5, [ 0, 0, 0 ], geometry2 ],
+					[ material, scale * 1.5, [ d, 0, 0 ], geometry3 ]
 				];
 
 				for ( i = 0; i < parameters.length; ++ i ) {
 
 					p = parameters[ i ];
-					line = new THREE.Line( p[ 3 ],  p[ 0 ] );
-					line.scale.x = line.scale.y = line.scale.z =  p[ 1 ];
+					line = new THREE.Line( p[ 3 ], p[ 0 ] );
+					line.scale.x = line.scale.y = line.scale.z = p[ 1 ];
 					line.position.x = p[ 2 ][ 0 ];
 					line.position.y = p[ 2 ][ 1 ];
 					line.position.z = p[ 2 ][ 2 ];
@@ -163,6 +163,7 @@
 
 				mouseX = event.clientX - windowHalfX;
 				mouseY = event.clientY - windowHalfY;
+
 			}
 
 			function onDocumentTouchStart( event ) {
@@ -173,7 +174,9 @@
 
 					mouseX = event.touches[ 0 ].pageX - windowHalfX;
 					mouseY = event.touches[ 0 ].pageY - windowHalfY;
+
 				}
+
 			}
 
 			function onDocumentTouchMove( event ) {
@@ -184,6 +187,7 @@
 
 					mouseX = event.touches[ 0 ].pageX - windowHalfX;
 					mouseY = event.touches[ 0 ].pageY - windowHalfY;
+
 				}
 
 			}
@@ -210,7 +214,7 @@
 
 					if ( object instanceof THREE.Line ) {
 
-						object.rotation.y = time * ( i % 2 ? 1 : -1 );
+						object.rotation.y = time * ( i % 2 ? 1 : - 1 );
 
 					}
 

+ 5 - 5
examples/software_sandbox.html

@@ -83,25 +83,25 @@
 				var loader = new THREE.TextureLoader();
 				var map = loader.load( 'textures/brick_diffuse.jpg' );
 				texCube = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { map: map, overdraw: 0.5 } ) );
-				texCube.position.set( -300, 0, 0 );
+				texCube.position.set( - 300, 0, 0 );
 				scene.add( texCube );
 
 				// Sprite
 				var sprite = new THREE.Sprite( new THREE.SpriteMaterial( { color: 0xff0040 } ) );
 				sprite.scale.set( 100, 100, 1 );
-				sprite.position.set( -100, 200, 0 );
+				sprite.position.set( - 100, 200, 0 );
 				scene.add( sprite );
 
 				// Sprite with texture
 				var texLoader = new THREE.TextureLoader();
 				map = texLoader.load( 'textures/sprite1.png' );
-				var texSprite = new THREE.Sprite( new THREE.SpriteMaterial( { map: map,transparent: true } ) );
+				var texSprite = new THREE.Sprite( new THREE.SpriteMaterial( { map: map, transparent: true } ) );
 				texSprite.scale.set( 100, 100, 1 );
 				texSprite.position.set( 100, 200, 0 );
 				scene.add( texSprite );
 
 				// Line
-				var points = hilbert3D( new THREE.Vector3( 0,0,0 ), 200.0, 1, 0, 1, 2, 3, 4, 5, 6, 7 );
+				var points = hilbert3D( new THREE.Vector3( 0, 0, 0 ), 200.0, 1, 0, 1, 2, 3, 4, 5, 6, 7 );
 				var spline = new THREE.CatmullRomCurve3( points );
 				var n_sub = 6, colors = [];
 
@@ -121,7 +121,7 @@
 				var material = new THREE.LineBasicMaterial( { opacity: 1, linewidth: 3, vertexColors: THREE.VertexColors } );
 				var line = new THREE.Line( lineGeometry, material );
 				line.scale.set( 0.5, 0.5, 0.5 );
-				line.position.set( 0, -200, 0);
+				line.position.set( 0, - 200, 0 );
 				scene.add( line );
 
 				renderer = new THREE.SoftwareRenderer();

+ 3 - 3
examples/svg_sandbox.html

@@ -40,7 +40,7 @@
 				// QRCODE
 
 				var loader = new THREE.JSONLoader();
-				loader.load( 'models/json/QRCode.json', function ( geometry) {
+				loader.load( 'models/json/QRCode.json', function ( geometry ) {
 
 					mesh = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { /*emissive: 0xff0000,*/ vertexColors: THREE.FaceColors } ) );
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = 2;
@@ -70,14 +70,14 @@
 				// PLANE
 
 				mesh = new THREE.Mesh( new THREE.PlaneBufferGeometry( 100, 100 ), new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff, side: THREE.DoubleSide } ) );
-				mesh.position.y = -500;
+				mesh.position.y = - 500;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 2;
 				scene.add( mesh );
 
 				// CYLINDER
 
 				mesh = new THREE.Mesh( new THREE.CylinderBufferGeometry( 20, 100, 200, 10 ), new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff } ) );
-				mesh.position.x = -500;
+				mesh.position.x = - 500;
 				mesh.rotation.x = - Math.PI / 2;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 2;
 				scene.add( mesh );

+ 6 - 6
examples/webaudio_orientation.html

@@ -135,8 +135,8 @@
 		light.position.set( 0, 200, 100 );
 		light.castShadow = true;
 		light.shadow.camera.top = 180;
-		light.shadow.camera.bottom = -100;
-		light.shadow.camera.left = -120;
+		light.shadow.camera.bottom = - 100;
+		light.shadow.camera.left = - 120;
 		light.shadow.camera.right = 120;
 		scene.add( light );
 
@@ -167,13 +167,13 @@
 		//
 
 		var gltfLoader = new THREE.GLTFLoader();
-		gltfLoader.load( 'models/gltf/BoomBox/glTF-Binary/BoomBox.glb', function( gltf ) {
+		gltfLoader.load( 'models/gltf/BoomBox/glTF-Binary/BoomBox.glb', function ( gltf ) {
 
-			var boomBox =  gltf.scene;
+			var boomBox = gltf.scene;
 			boomBox.position.set( 0, 0.2, 0 );
 			boomBox.scale.set( 20, 20, 20 );
 
-			boomBox.traverse( function( object ) {
+			boomBox.traverse( function ( object ) {
 
 				if ( object.isMesh ) {
 
@@ -225,7 +225,7 @@
 
 	}
 
-	function onWindowResize( event ) {
+	function onWindowResize() {
 
 		camera.aspect = window.innerWidth / window.innerHeight;
 		camera.updateProjectionMatrix();

+ 22 - 17
examples/webaudio_sandbox.html

@@ -94,8 +94,7 @@
 
 			}
 
-			var camera, controls, scene, renderer;
-			var light, pointLight;
+			var camera, controls, scene, renderer, light;
 
 			var material1, material2, material3;
 
@@ -135,15 +134,17 @@
 				var audioLoader = new THREE.AudioLoader();
 
 				var mesh1 = new THREE.Mesh( sphere, material1 );
-				mesh1.position.set( -250, 30, 0 );
+				mesh1.position.set( - 250, 30, 0 );
 				scene.add( mesh1 );
 
 				var sound1 = new THREE.PositionalAudio( listener );
-				audioLoader.load( 'sounds/358232_j_s_song.ogg', function( buffer ) {
+				audioLoader.load( 'sounds/358232_j_s_song.ogg', function ( buffer ) {
+
 					sound1.setBuffer( buffer );
 					sound1.setRefDistance( 20 );
 					sound1.play();
-				});
+
+				} );
 				mesh1.add( sound1 );
 
 				//
@@ -153,17 +154,19 @@
 				scene.add( mesh2 );
 
 				var sound2 = new THREE.PositionalAudio( listener );
-				audioLoader.load( 'sounds/376737_Skullbeatz___Bad_Cat_Maste.ogg', function( buffer ) {
+				audioLoader.load( 'sounds/376737_Skullbeatz___Bad_Cat_Maste.ogg', function ( buffer ) {
+
 					sound2.setBuffer( buffer );
 					sound2.setRefDistance( 20 );
 					sound2.play();
-				});
+
+				} );
 				mesh2.add( sound2 );
 
 				//
 
 				var mesh3 = new THREE.Mesh( sphere, material3 );
-				mesh3.position.set( 0, 30, -250 );
+				mesh3.position.set( 0, 30, - 250 );
 				scene.add( mesh3 );
 
 				var sound3 = new THREE.PositionalAudio( listener );
@@ -185,12 +188,14 @@
 				// global ambient audio
 
 				var sound4 = new THREE.Audio( listener );
-				audioLoader.load( 'sounds/Project_Utopia.ogg', function( buffer ) {
+				audioLoader.load( 'sounds/Project_Utopia.ogg', function ( buffer ) {
+
 					sound4.setBuffer( buffer );
-					sound4.setLoop(true);
-					sound4.setVolume(0.5);
+					sound4.setLoop( true );
+					sound4.setVolume( 0.5 );
 					sound4.play();
-				});
+
+				} );
 
 				// ground
 
@@ -200,17 +205,17 @@
 
 				//
 
-				var SoundControls = function() {
+				var SoundControls = function () {
 
 					this.master = listener.getMasterVolume();
-					this.firstSphere =  sound1.getVolume();
-					this.secondSphere =  sound2.getVolume();
+					this.firstSphere = sound1.getVolume();
+					this.secondSphere = sound2.getVolume();
 					this.thirdSphere = sound3.getVolume();
-					this.Ambient =  sound4.getVolume();
+					this.Ambient = sound4.getVolume();
 
 				};
 
-				var GeneratorControls = function() {
+				var GeneratorControls = function () {
 
 					this.frequency = oscillator.frequency.value;
 					this.wavetype = oscillator.type;

+ 2 - 2
examples/webaudio_timing.html

@@ -93,7 +93,7 @@
 
 	}
 
-	var scene, camera, renderer, audio;
+	var scene, camera, renderer;
 
 	var objects = [];
 
@@ -211,7 +211,7 @@
 
 	}
 
-	function onWindowResize( event ) {
+	function onWindowResize() {
 
 		camera.aspect = window.innerWidth / window.innerHeight;
 		camera.updateProjectionMatrix();

+ 20 - 20
examples/webgl2_materials_texture3d.html

@@ -119,33 +119,33 @@
 					.setResponseType( 'arraybuffer' )
 					.load( 'textures/3d/head256x256x109.zip', function ( data ) {
 
-					var zip = new JSZip( data );
-					var array = zip.files[ 'head256x256x109' ].asUint8Array();
+						var zip = new JSZip( data );
+						var array = zip.files[ 'head256x256x109' ].asUint8Array();
 
-					var texture = new THREE.DataTexture3D( array, 256, 256, 109 );
+						var texture = new THREE.DataTexture3D( array, 256, 256, 109 );
 
-					texture.format = THREE.RedFormat;
-					texture.type = THREE.UnsignedByteType;
+						texture.format = THREE.RedFormat;
+						texture.type = THREE.UnsignedByteType;
 
-					texture.needsUpdate = true;
+						texture.needsUpdate = true;
 
-					var material = new THREE.ShaderMaterial( {
-						uniforms: {
-							diffuse: { value: texture },
-							depth: { value: 0 },
-							size: { value: new THREE.Vector2( planeWidth, planeHeight ) }
-						},
-						vertexShader: document.getElementById( 'vs' ).textContent.trim(),
-						fragmentShader: document.getElementById( 'fs' ).textContent.trim()
-					} );
+						var material = new THREE.ShaderMaterial( {
+							uniforms: {
+								diffuse: { value: texture },
+								depth: { value: 0 },
+								size: { value: new THREE.Vector2( planeWidth, planeHeight ) }
+							},
+							vertexShader: document.getElementById( 'vs' ).textContent.trim(),
+							fragmentShader: document.getElementById( 'fs' ).textContent.trim()
+						} );
 
-					var geometry = new THREE.PlaneBufferGeometry( planeWidth, planeHeight );
+						var geometry = new THREE.PlaneBufferGeometry( planeWidth, planeHeight );
 
-					mesh = new THREE.Mesh( geometry, material );
+						mesh = new THREE.Mesh( geometry, material );
 
-					scene.add( mesh );
+						scene.add( mesh );
 
-				} );
+					} );
 
 				// var controls = new THREE.OrbitControls( camera );
 
@@ -188,7 +188,7 @@
 					if ( value > 1.0 || value < 0.0 ) {
 
 						if ( value > 1.0 ) value = 2.0 - value;
-						if ( value < 0.0 ) vlaue = - value;
+						if ( value < 0.0 ) value = - value;
 
 						depthStep = - depthStep;
 

+ 3 - 3
examples/webgl2_materials_texture3d_volume.html

@@ -151,9 +151,9 @@
 				uniforms.u_cmdata.value = cmtextures[ volconfig.colormap ];
 
 				material = new THREE.ShaderMaterial( {
-					uniforms        : uniforms,
-					vertexShader    : shader.vertexShader,
-					fragmentShader  : shader.fragmentShader,
+					uniforms: uniforms,
+					vertexShader: shader.vertexShader,
+					fragmentShader: shader.fragmentShader,
 					side: THREE.BackSide // The volume shader uses the backface as its "reference point"
 				} );
 

+ 1 - 1
examples/webgl2_sandbox.html

@@ -117,7 +117,7 @@
 
 			}
 
-			function onDocumentMouseMove(event) {
+			function onDocumentMouseMove( event ) {
 
 				mouseX = ( event.clientX - windowHalfX ) * 10;
 				mouseY = ( event.clientY - windowHalfY ) * 10;

+ 14 - 14
examples/webgldeferred_animation.html

@@ -109,7 +109,7 @@
 
 				var loader = new THREE.JSONLoader();
 
-				loader.load( "models/skinned/knight.js", function( geometry, materials ) {
+				loader.load( "models/skinned/knight.js", function ( geometry, materials ) {
 
 					var material = materials[ 0 ];
 					material.emissive.set( 0x101010 );
@@ -117,7 +117,7 @@
 					material.morphTargets = true;
 
 					var mesh = new THREE.SkinnedMesh( geometry, material );
-					mesh.position.y = -30;
+					mesh.position.y = - 30;
 					mesh.scale.multiplyScalar( 5 );
 
 					mixer = new THREE.AnimationMixer( mesh );
@@ -162,7 +162,7 @@
 				}
 
 				var directionalLight = new THREE.DirectionalLight( 0x101010 );
-				directionalLight.position.set( -1, 1, 1 ).normalize();
+				directionalLight.position.set( - 1, 1, 1 ).normalize();
 				scene.add( directionalLight );
 
 				var spotLight = new THREE.SpotLight( 0x404040 );
@@ -183,31 +183,31 @@
 
 				// top
 				var mesh = new THREE.Mesh( geometry, material );
-				mesh.rotation.x = Math.PI/2;
+				mesh.rotation.x = Math.PI / 2;
 				mesh.position.y = size / 2;
 				room.add( mesh );
 
 				// bottom
 				mesh = new THREE.Mesh( geometry, material );
-				mesh.rotation.x = -Math.PI/2;
-				mesh.position.y = -size / 2;
+				mesh.rotation.x = - Math.PI / 2;
+				mesh.position.y = - size / 2;
 				room.add( mesh );
 
 				// left
 				mesh = new THREE.Mesh( geometry, material );
-				mesh.position.x = -size / 2;
-				mesh.rotation.y = Math.PI/2;
+				mesh.position.x = - size / 2;
+				mesh.rotation.y = Math.PI / 2;
 				room.add( mesh );
 
 				// right
 				mesh = new THREE.Mesh( geometry, material );
 				mesh.position.x = size / 2;
-				mesh.rotation.y = -Math.PI/2;
+				mesh.rotation.y = - Math.PI / 2;
 				room.add( mesh );
 
 				// back
 				mesh = new THREE.Mesh( geometry, material );
-				mesh.position.z = -size / 2;
+				mesh.position.z = - size / 2;
 				room.add( mesh );
 
 				// front, to check if transparency works
@@ -220,7 +220,7 @@
 
 				// back2, to check if transparency works
 				mesh = new THREE.Mesh( geometry, transparentMaterial );
-				mesh.position.z = -size / 4;
+				mesh.position.z = - size / 4;
 				mesh.scale.multiplyScalar( 0.75 );
 				mesh.visible = false;
 				transparentObjects.push( mesh );
@@ -247,9 +247,9 @@
 					'light pre-pass': 1,
 					'forward': 2
 
-				} ).onChange( function() {
+				} ).onChange( function () {
 
-					switch( parseInt( api.mode ) ) {
+					switch ( parseInt( api.mode ) ) {
 
 						case 0:
 							renderer.forwardRendering = false;
@@ -293,7 +293,7 @@
 
 			}
 
-			function onWindowResize( event ) {
+			function onWindowResize() {
 
 				WIDTH = window.innerWidth;
 				HEIGHT = window.innerHeight;