Browse Source

Merge branch 'dev' of https://github.com/mrdoob/three.js into dev

Jaume Sanchez 9 years ago
parent
commit
d9c90cf689
100 changed files with 2390 additions and 2166 deletions
  1. 1 1
      LICENSE
  2. 328 225
      build/three.js
  3. 199 195
      build/three.min.js
  4. 4 4
      docs/api/core/BufferAttribute.html
  5. 301 308
      docs/api/core/BufferGeometry.html
  6. 1 1
      docs/api/core/Face3.html
  7. 1 1
      docs/api/core/Geometry.html
  8. 0 115
      docs/api/extras/FontUtils.html
  9. 1 1
      docs/api/extras/SceneUtils.html
  10. 60 0
      docs/api/extras/curves/CatmullRomCurve3.html
  11. 2 2
      docs/api/extras/curves/ClosedSplineCurve3.html
  12. 4 4
      docs/api/extras/geometries/LatheGeometry.html
  13. 1 3
      docs/api/extras/geometries/TextGeometry.html
  14. 61 60
      docs/api/extras/helpers/FaceNormalsHelper.html
  15. 2 1
      docs/api/lights/SpotLight.html
  16. 1 1
      docs/api/loaders/JSONLoader.html
  17. 84 0
      docs/api/loaders/PCDLoader.html
  18. 16 1
      docs/api/materials/MeshLambertMaterial.html
  19. 5 2
      docs/api/materials/MeshPhongMaterial.html
  20. 2 2
      docs/api/materials/MultiMaterial.html
  21. 1 1
      docs/api/materials/ShaderMaterial.html
  22. 1 1
      docs/api/math/Box2.html
  23. 1 1
      docs/api/math/Box3.html
  24. 1 1
      docs/api/math/Euler.html
  25. 1 1
      docs/api/math/Frustum.html
  26. 3 3
      docs/api/math/Line3.html
  27. 1 1
      docs/api/math/Math.html
  28. 1 1
      docs/api/math/Plane.html
  29. 4 4
      docs/api/math/Quaternion.html
  30. 9 1
      docs/api/math/Ray.html
  31. 6 6
      docs/api/math/Sphere.html
  32. 5 5
      docs/api/math/Spline.html
  33. 3 3
      docs/api/math/Triangle.html
  34. 5 0
      docs/api/math/Vector2.html
  35. 2 2
      docs/api/objects/Sprite.html
  36. 6 11
      docs/api/renderers/WebGLRenderer.html
  37. 2 2
      docs/api/textures/Texture.html
  38. 8 8
      docs/list.js
  39. 14 14
      docs/page.js
  40. 1 11
      docs/scenes/geometry-browser.html
  41. 94 76
      docs/scenes/js/geometry.js
  42. 3 3
      docs/scenes/js/material.js
  43. 5 1
      editor/index.html
  44. 2 7
      editor/js/Config.js
  45. 4 1
      editor/js/Editor.js
  46. 2 2
      editor/js/History.js
  47. 26 17
      editor/js/Loader.js
  48. 35 2
      editor/js/Menubar.Add.js
  49. 20 0
      editor/js/Menubar.File.js
  50. 1 1
      editor/js/Sidebar.Animation.js
  51. 3 1
      editor/js/Sidebar.Geometry.BufferGeometry.js
  52. 141 0
      editor/js/Sidebar.Geometry.LatheGeometry.js
  53. 11 29
      editor/js/Sidebar.History.js
  54. 32 12
      editor/js/Sidebar.Object.js
  55. 9 2
      editor/js/Sidebar.Project.js
  56. 5 0
      editor/js/Viewport.js
  57. 8 1
      editor/js/libs/app.js
  58. 5 5
      editor/js/libs/tern-threejs/threejs.js
  59. 6 1
      editor/js/libs/ui.js
  60. 1 2
      examples/canvas_ascii_effect.html
  61. 1 1
      examples/canvas_camera_orthographic.html
  62. 1 1
      examples/canvas_camera_orthographic2.html
  63. 0 149
      examples/canvas_effects_stereo.html
  64. 0 1
      examples/canvas_geometry_nurbs.html
  65. 1 1
      examples/canvas_geometry_panorama.html
  66. 1 1
      examples/canvas_geometry_panorama_fisheye.html
  67. 23 21
      examples/canvas_geometry_text.html
  68. 1 1
      examples/canvas_lights_pointlights.html
  69. 12 5
      examples/canvas_materials.html
  70. 4 1
      examples/canvas_materials_reflection.html
  71. 1 1
      examples/canvas_performance.html
  72. 4 1
      examples/canvas_sandbox.html
  73. 1 1
      examples/css3d_molecules.html
  74. 1 1
      examples/css3d_panorama.html
  75. 1 1
      examples/css3d_panorama_deviceorientation.html
  76. 1 1
      examples/css3d_periodictable.html
  77. 1 0
      examples/css3d_sandbox.html
  78. 1 1
      examples/css3d_sprites.html
  79. 8 58
      examples/css3d_youtube.html
  80. 11 13
      examples/css3dstereo_periodictable.html
  81. 309 0
      examples/files.js
  82. 22 316
      examples/fonts/droid/droid_sans_bold.typeface.js
  83. 2 2
      examples/js/Car.js
  84. 5 3
      examples/js/GPUParticleSystem.js
  85. 5 4
      examples/js/MD2Character.js
  86. 3 2
      examples/js/MD2CharacterComplex.js
  87. 5 7
      examples/js/ShaderSkin.js
  88. 2 4
      examples/js/ShaderTerrain.js
  89. 22 21
      examples/js/UCSCharacter.js
  90. 31 31
      examples/js/WaterShader.js
  91. 118 113
      examples/js/cameras/CinematicCamera.js
  92. 33 34
      examples/js/controls/DragControls.js
  93. 50 58
      examples/js/controls/OrbitControls.js
  94. 2 2
      examples/js/controls/PointerLockControls.js
  95. 1 1
      examples/js/controls/TrackballControls.js
  96. 5 29
      examples/js/controls/VRControls.js
  97. 1 1
      examples/js/crossfade/scenes.js
  98. 28 28
      examples/js/crossfade/transition.js
  99. 8 83
      examples/js/effects/AnaglyphEffect.js
  100. 102 0
      examples/js/effects/CardboardEffect.js

+ 1 - 1
LICENSE

@@ -1,6 +1,6 @@
 The MIT License
 The MIT License
 
 
-Copyright © 2010-2015 three.js authors
+Copyright © 2010-2016 three.js authors
 
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 of this software and associated documentation files (the "Software"), to deal

File diff suppressed because it is too large
+ 328 - 225
build/three.js


File diff suppressed because it is too large
+ 199 - 195
build/three.min.js


+ 4 - 4
docs/api/core/BufferAttribute.html

@@ -15,17 +15,17 @@
 		</div>
 		</div>
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
-		<h3>[name]([page:Array array], [page:Integer itemSize])</h3>
+		<h3>[name]([page:TypedArray array], [page:Integer itemSize])</h3>
 		<div>
 		<div>
-		Instantiates this attribute with data from the associated buffer. The array can either be a regular Array or a Typed Array.
+		Instantiates this attribute with data from the associated buffer.
 		itemSize gives the number of values of the array that should be associated with a particular vertex.
 		itemSize gives the number of values of the array that should be associated with a particular vertex.
 		</div>
 		</div>
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
-		<h3>[property:Array array]</h3>
+		<h3>[property:TypedArray array]</h3>
 		<div>
 		<div>
-		Stores the data associated with this attribute; can be an Array or a Typed Array. This element should have <code>itemSize * numVertices</code> elements, where numVertices is the number of vertices in the associated [page:BufferGeometry geometry].
+		Stores the data associated with this attribute. This element should have <code>itemSize * numVertices</code> elements, where numVertices is the number of vertices in the associated [page:BufferGeometry geometry].
 		</div>
 		</div>
 
 
 		<h3>[property:Integer itemSize]</h3>
 		<h3>[property:Integer itemSize]</h3>

+ 301 - 308
docs/api/core/BufferGeometry.html

@@ -1,309 +1,302 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
+<!DOCTYPE html>
+<html lang="en">
+	<head>
 		<meta charset="utf-8" />
 		<meta charset="utf-8" />
-		<base href="../../" />
-		<script src="list.js"></script>
-		<script src="page.js"></script>
-		<link type="text/css" rel="stylesheet" href="page.css" />
-	</head>
-	<body>
-		<h1>[name]</h1>
-
-		<div class="desc">
-		<p>
-		This class is an efficient alternative to [page:Geometry], because it stores all data, including
-		vertex positions, face indices, normals, colors, UVs, and custom attributes within buffers; this
-		reduces the cost of passing all this data to the GPU.
-		This also makes BufferGeometry harder to work with than [page:Geometry]; rather than accessing
-		position data as [page:Vector3] objects, color data as [page:Color] objects, and so on, you have to
-		access the raw data from the appropriate [page:BufferAttribute attribute] buffer. This makes
-		BufferGeometry best-suited for static objects where you don't need to manipulate the geometry much
-		after instantiating it.
-		</p>
-
-		<h3>Example</h3>
-		<code>
-		var geometry = new THREE.BufferGeometry();
-		// create a simple square shape. We duplicate the top left and bottom right
-		// vertices because each vertex needs to appear once per triangle.
-		var vertexPositions = [
-			[-1.0, -1.0,  1.0],
-			[ 1.0, -1.0,  1.0],
-			[ 1.0,  1.0,  1.0],
-
-			[ 1.0,  1.0,  1.0],
-			[-1.0,  1.0,  1.0],
-			[-1.0, -1.0,  1.0]
-		];
-		var vertices = new Float32Array( vertexPositions.length * 3 ); // three components per vertex
-
-		// components of the position vector for each vertex are stored
-		// contiguously in the buffer.
-		for ( var i = 0; i < vertexPositions.length; i++ )
-		{
-			vertices[ i*3 + 0 ] = vertexPositions[i][0];
-			vertices[ i*3 + 1 ] = vertexPositions[i][1];
-			vertices[ i*3 + 2 ] = vertexPositions[i][2];
-		}
-
-		// itemSize = 3 because there are 3 values (components) per vertex
-		geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
-		var material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
-		var mesh = new THREE.Mesh( geometry, material );
-		</code>
-		<p>More examples: [example:webgl_buffergeometry Complex mesh with non-indexed faces], [example:webgl_buffergeometry_uint Complex mesh with indexed faces], [example:webgl_buffergeometry_lines Lines], [example:webgl_buffergeometry_lines_indexed Indexed Lines], [example:webgl_buffergeometry_particles Particles], and [example:webgl_buffergeometry_rawshader Raw Shaders].</p>
-
-
-		<h3>Accessing attributes</h3>
-		<p>
-		WebGL stores data associated with individual vertices of a geometry in <emph>attributes</emph>.
-		Examples include the position of the vertex, the normal vector for the vertex, the vertex color,
-		and so on. When using [page:Geometry], the [page:WebGLRenderer renderer] takes care of wrapping
-		up this information into typed array buffers and sending this data to the shader. With
-		BufferGeometry, all of this data is stored in buffers associated with an individual attributes.
-		This means that to get the position data associated with a vertex (for instance), you must call
-		[page:.getAttribute] to access the 'position' [page:BufferAttribute attribute], then access the individual
-		x, y, and z coordinates of the position.
-		</p>
-		<p>
-		The following attributes are set by various members of this class:
-		</p>
-		<h4>[page:BufferAttribute position] (itemSize: 3)</h4>
-		<div>
-		Stores the x, y, and z coordinates of each vertex in this geometry. Set by [page:.fromGeometry]().
-		</div>
-
-		<h4>[page:BufferAttribute normal] (itemSize: 3)</h4>
-		<div>
-		Stores the x, y, and z components of the face or vertex normal vector of each vertex in this geometry.
-		Set by [page:.fromGeometry]().
-		</div>
-
-		<h4>[page:BufferAttribute color] (itemSize: 3)</h4>
-		<div>
-		Stores the red, green, and blue channels of vertex color of each vertex in this geometry.
-		Set by [page:.fromGeometry]().
-		</div>
-
-		<h4>[page:BufferAttribute index] (itemSize: 3)</h4>
-		Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles," and works much the same as it does in [page:Geometry]: each triangle is associated with the index of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
-
-		If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
-		</div>
-		<p>
-		In addition to the the built-in attributes, you can set your own custom attributes using the addAttribute method. With [page:Geometry], these attributes are set and stored on the [page:Material]. In BufferGeometry, the attributes are stored with the geometry itself. Note that you still need to set the attributes information on the material as well, but the value of each attribute is stored in the BufferGeometry.
-		</p>
-
-
-		<h2>Constructor</h2>
-
-
-		<h3>[name]()</h3>
-		<div>
-		This creates a new [name]. It also sets several properties to a default value.
-		</div>
-
-
-		<h2>Properties</h2>
-
-		<h3>[property:Integer id]</h3>
-		<div>
-		Unique number for this buffergeometry instance.
-		</div>
-
-		<h3>[property:Hashmap attributes]</h3>
-		<div>
-		This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
-		Rather than accessing this property directly, use addAttribute and getAttribute to access attributes of this geometry.
-		</div>
-
-		<!--
- 		<h3>[property:Boolean dynamic]</h3>
-		<div>
-		When set, it holds certain buffers in memory to have faster updates for this object. When unset, it deletes those buffers and   saves memory.
-		</div> -->
-
-		<h3>[property:Array drawcalls] (previously [property:Array offsets])</h3>
-		<div>
-		For geometries that use indexed triangles, this Array can be used to split the object into multiple WebGL draw calls. Each draw call will draw some subset of the vertices in this geometry using the configured [page:Material shader]. This may be necessary if, for instance, you have more than 65535 vertices in your object.
-		Each element is an object of the form:
-		<code>{ start: Integer, count: Integer, index: Integer }</code>
-		where start specifies the index of the first vertex in this draw call, count specifies how many vertices are included, and index specifies an optional offset.
-
-		Use addDrawCall to add draw calls, rather than modifying this array directly.
-		</div>
-
-		<h3>[property:Box3 boundingBox]</h3>
-		<div>
-		Bounding box.
-		<code>{ min: new THREE.Vector3(), max: new THREE.Vector3() }</code>
-		</div>
-
-		<h3>[property:Sphere boundingSphere]</h3>
-		<div>
-		Bounding sphere.
-		<code>{ radius: float }</code>
-		</div>
-
-		<h3>[property:Array morphTargets]</h3>
-		<div>
-		Array of morph targets. Each morph target is a Javascript object:
-		<code>{ name: "targetName", vertices: [ new THREE.Vertex(), ... ] }</code>
-		Morph vertices match number and order of primary vertices.
-		</div>
-
-		<h2>Methods</h2>
-
-		<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
-
-		<h3>[property:null addAttribute]( [page:String name], [page:BufferAttribute attribute] )</h3>
-		<div>
-		Adds an attribute to this geometry. Use this rather than the attributes property,
-		because an internal array of attributes is maintained to speed up iterating over
-		attributes.
-		</div>
-
-		<h3>[method:null addDrawCall]( [page:Integer start], [page:Integer count], [page:Integer indexOffset] )</h3>
-		<div>
-		Adds a draw call to this geometry; see the [page:BufferGeometry.drawcalls drawcalls] property for details.
-		</div>
-
-		<h3>[method:null clearDrawCalls]( )</h3>
-		<div>
-		Clears all draw calls.
-		</div>
-
-		<h3>[method:null applyMatrix]( [page:Matrix4 matrix] )</h3>
-		<div>
-		Bakes matrix transform directly into vertex coordinates.
-		</div>
-
-		<h3>[method:null center] ()</h3>
-		<div>
-		Center the geometry based on the bounding box.
-		</div>
-
-		<h3>[method:BufferGeometry rotateX] ( [page:Float radians] )</h3>
-		<div>
-		Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop
-    Use [page:Object3D.rotation] for typical real-time mesh rotation.
-		</div>
-
-		<h3>[method:BufferGeometry rotateY] ( [page:Float radians] )</h3>
-		<div>
-		Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop
-    Use [page:Object3D.rotation] for typical real-time mesh rotation.
-		</div>
-
-		<h3>[method:BufferGeometry rotateZ] ( [page:Float radians] )</h3>
-		<div>
-		Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop
-    Use [page:Object3D.rotation] for typical real-time mesh rotation.
-		</div>
-
-		<h3>[method:BufferGeometry translate] ( [page:Float x], [page:Float y], [page:Float z] )</h3>
-		<div>
-		Translate the geometry. This is typically done as a one time operation, and not during a loop
-    Use [page:Object3D.position] for typical real-time mesh translation.
-		</div>
-
-		<h3>[method:BufferGeometry scale] ( [page:Float x], [page:Float y], [page:Float z] )</h3>
-		<div>
-		Scale the geometry data. This is typically done as a one time operation, and not during a loop
-    Use [page:Object3D.scale] for typical real-time mesh scaling.
-		</div>
-
-		<h3>[method:BufferGeometry lookAt] ( [page:Vector3 vector] )</h3>
-		<div>
-		vector - A world vector to look at.<br />
-		</div>
-		<div>
-		Rotates the geometry to face point in space. This is typically done as a one time operation, and not during a loop
-    Use [page:Object3D.lookAt] for typical real-time mesh usage.
-		</div>
-
-		<h3>[method:BufferGeometry setFromObject] ( [page:Object3D object] )</h3>
-		<div>
-		Sets the attributes for this BufferGeometry from an [page:Object3D].
-		</div>
-
-		<h3>[method:null computeVertexNormals]()</h3>
-		<div>
-		Computes vertex normals by averaging face normals.<br />
-		</div>
-
-		<h3>[method:null computeBoundingBox]()</h3>
-		<div>
-		Computes bounding box of the geometry, updating [page:Geometry Geometry.boundingBox] attribute.<br />
-		Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are *null*.
-		</div>
-
-		<h3>[method:null computeBoundingSphere]()</h3>
-		<div>
-		Computes bounding sphere of the geometry, updating [page:Geometry Geometry.boundingSphere] attribute.<br />
-		Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are *null*.
-		</div>
-
-		<h3>[method:null computeOffsets] ( [page:Integer size] )</h3>
-		<div>
-		Compute the draw offset for large models by chunking the index buffer into chunks of 65k addressable vertices.
-		This method will effectively rewrite the index buffer and remap all attributes to match the new indices.
-		WARNING: This method will also expand the vertex count to prevent sprawled triangles across draw offsets.
-		size - Defaults to 65535 or 4294967296 if extension OES_element_index_uint supported, but allows for larger or smaller chunks.
-		</div>
-
-		<h3>[method:null merge]( [page:BufferGeometry bufferGeometry], [page:Integer offset] )</h3>
-		<div>
-		Merge in another BufferGeometry with an optional offset of where to start merging in.
-		</div>
-
-		<h3>[method:null dispose]()</h3>
-		<div>
-		Disposes the object from memory. <br />
-		You need to call this when you want the bufferGeometry removed while the application is running.
-		</div>
-
-		<h3>[method:null fromGeometry]( [page:Geometry] )</h3>
-		<div>
-		Populates this BufferGeometry with data from a [page:Geometry] object.
-		</div>
-
-		<h3>[method:BufferAttribute getAttribute]( [page:String name] )</h3>
-		<div>
-		Returns the [page:BufferAttribute attribute] with the specified name.
-		</div>
-
-		<h3>[method:BufferAttribute removeAttribute]( [page:String name] )</h3>
-		<div>
-		Removes the [page:BufferAttribute attribute] with the specified name.
-		</div>
-
-		<h3>[method:null normalizeNormals]()</h3>
-		<div>
-		Every normal vector in a geometry will have a magnitude of 1.
-		This will correct lighting on the geometry surfaces.
-		</div>
-
-		<h3>[method:Object toJSON]()</h3>
-		<div>
-		Returns a raw object representation of the BufferGeometry.
-		</div>
-
-		<h3>[method:BufferGeometry clone]()</h3>
-		<div>
-		Creates a clone of this BufferGeometry.
-		</div>
-
-		<h3>[method:BufferGeometry copy]( [page:BufferGeometry bufferGeometry] )</h3>
-		<div>
-		Copies another BufferGeometry to this BufferGeometry.
-		</div>
-
-
-
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
-	</body>
-</html>
+		<base href="../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+		<h1>[name]</h1>
+
+		<div class="desc">
+		<p>
+		This class is an efficient alternative to [page:Geometry], because it stores all data, including
+		vertex positions, face indices, normals, colors, UVs, and custom attributes within buffers; this
+		reduces the cost of passing all this data to the GPU.
+		This also makes BufferGeometry harder to work with than [page:Geometry]; rather than accessing
+		position data as [page:Vector3] objects, color data as [page:Color] objects, and so on, you have to
+		access the raw data from the appropriate [page:BufferAttribute attribute] buffer. This makes
+		BufferGeometry best-suited for static objects where you don't need to manipulate the geometry much
+		after instantiating it.
+		</p>
+
+		<h3>Example</h3>
+		<code>
+		var geometry = new THREE.BufferGeometry();
+		// create a simple square shape. We duplicate the top left and bottom right
+		// vertices because each vertex needs to appear once per triangle.
+		var vertexPositions = [
+			[-1.0, -1.0,  1.0],
+			[ 1.0, -1.0,  1.0],
+			[ 1.0,  1.0,  1.0],
+
+			[ 1.0,  1.0,  1.0],
+			[-1.0,  1.0,  1.0],
+			[-1.0, -1.0,  1.0]
+		];
+		var vertices = new Float32Array( vertexPositions.length * 3 ); // three components per vertex
+
+		// components of the position vector for each vertex are stored
+		// contiguously in the buffer.
+		for ( var i = 0; i < vertexPositions.length; i++ )
+		{
+			vertices[ i*3 + 0 ] = vertexPositions[i][0];
+			vertices[ i*3 + 1 ] = vertexPositions[i][1];
+			vertices[ i*3 + 2 ] = vertexPositions[i][2];
+		}
+
+		// itemSize = 3 because there are 3 values (components) per vertex
+		geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
+		var material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
+		var mesh = new THREE.Mesh( geometry, material );
+		</code>
+		<p>More examples: [example:webgl_buffergeometry Complex mesh with non-indexed faces], [example:webgl_buffergeometry_uint Complex mesh with indexed faces], [example:webgl_buffergeometry_lines Lines], [example:webgl_buffergeometry_lines_indexed Indexed Lines], [example:webgl_buffergeometry_custom_attributes_particles Particles], and [example:webgl_buffergeometry_rawshader Raw Shaders].</p>
+
+
+		<h3>Accessing attributes</h3>
+		<p>
+		WebGL stores data associated with individual vertices of a geometry in <emph>attributes</emph>.
+		Examples include the position of the vertex, the normal vector for the vertex, the vertex color,
+		and so on. When using [page:Geometry], the [page:WebGLRenderer renderer] takes care of wrapping
+		up this information into typed array buffers and sending this data to the shader. With
+		BufferGeometry, all of this data is stored in buffers associated with an individual attributes.
+		This means that to get the position data associated with a vertex (for instance), you must call
+		[page:.getAttribute] to access the 'position' [page:BufferAttribute attribute], then access the individual
+		x, y, and z coordinates of the position.
+		</p>
+		<p>
+		The following attributes are set by various members of this class:
+		</p>
+		<h4>[page:BufferAttribute position] (itemSize: 3)</h4>
+		<div>
+		Stores the x, y, and z coordinates of each vertex in this geometry. Set by [page:.fromGeometry]().
+		</div>
+
+		<h4>[page:BufferAttribute normal] (itemSize: 3)</h4>
+		<div>
+		Stores the x, y, and z components of the face or vertex normal vector of each vertex in this geometry.
+		Set by [page:.fromGeometry]().
+		</div>
+
+		<h4>[page:BufferAttribute color] (itemSize: 3)</h4>
+		<div>
+		Stores the red, green, and blue channels of vertex color of each vertex in this geometry.
+		Set by [page:.fromGeometry]().
+		</div>
+
+		<h4>[page:BufferAttribute index] (itemSize: 3)</h4>
+		Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles," and works much the same as it does in [page:Geometry]: each triangle is associated with the index of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
+
+		If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
+		</div>
+		<p>
+		In addition to the the built-in attributes, you can set your own custom attributes using the addAttribute method. With [page:Geometry], these attributes are set and stored on the [page:Material]. In BufferGeometry, the attributes are stored with the geometry itself. Note that you still need to set the attributes information on the material as well, but the value of each attribute is stored in the BufferGeometry.
+		</p>
+
+
+		<h2>Constructor</h2>
+
+
+		<h3>[name]()</h3>
+		<div>
+		This creates a new [name]. It also sets several properties to a default value.
+		</div>
+
+
+		<h2>Properties</h2>
+
+		<h3>[property:Integer id]</h3>
+		<div>
+		Unique number for this buffergeometry instance.
+		</div>
+
+		<h3>[property:Hashmap attributes]</h3>
+		<div>
+		This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
+		Rather than accessing this property directly, use addAttribute and getAttribute to access attributes of this geometry.
+		</div>
+
+		<!--
+ 		<h3>[property:Boolean dynamic]</h3>
+		<div>
+		When set, it holds certain buffers in memory to have faster updates for this object. When unset, it deletes those buffers and   saves memory.
+		</div> -->
+
+		<h3>[property:Array drawcalls] (previously [property:Array offsets])</h3>
+		<div>
+		For geometries that use indexed triangles, this Array can be used to split the object into multiple WebGL draw calls. Each draw call will draw some subset of the vertices in this geometry using the configured [page:Material shader]. This may be necessary if, for instance, you have more than 65535 vertices in your object.
+		Each element is an object of the form:
+		<code>{ start: Integer, count: Integer, index: Integer }</code>
+		where start specifies the index of the first vertex in this draw call, count specifies how many vertices are included, and index specifies an optional offset.
+
+		Use addDrawCall to add draw calls, rather than modifying this array directly.
+		</div>
+
+		<h3>[property:Box3 boundingBox]</h3>
+		<div>
+		Bounding box.
+		<code>{ min: new THREE.Vector3(), max: new THREE.Vector3() }</code>
+		</div>
+
+		<h3>[property:Sphere boundingSphere]</h3>
+		<div>
+		Bounding sphere.
+		<code>{ radius: float }</code>
+		</div>
+
+		<h2>Methods</h2>
+
+		<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
+
+		<h3>[property:null addAttribute]( [page:String name], [page:BufferAttribute attribute] )</h3>
+		<div>
+		Adds an attribute to this geometry. Use this rather than the attributes property,
+		because an internal array of attributes is maintained to speed up iterating over
+		attributes.
+		</div>
+
+		<h3>[method:null addDrawCall]( [page:Integer start], [page:Integer count], [page:Integer indexOffset] )</h3>
+		<div>
+		Adds a draw call to this geometry; see the [page:BufferGeometry.drawcalls drawcalls] property for details.
+		</div>
+
+		<h3>[method:null clearDrawCalls]( )</h3>
+		<div>
+		Clears all draw calls.
+		</div>
+
+		<h3>[method:null applyMatrix]( [page:Matrix4 matrix] )</h3>
+		<div>
+		Bakes matrix transform directly into vertex coordinates.
+		</div>
+
+		<h3>[method:null center] ()</h3>
+		<div>
+		Center the geometry based on the bounding box.
+		</div>
+
+		<h3>[method:BufferGeometry rotateX] ( [page:Float radians] )</h3>
+		<div>
+		Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop
+    Use [page:Object3D.rotation] for typical real-time mesh rotation.
+		</div>
+
+		<h3>[method:BufferGeometry rotateY] ( [page:Float radians] )</h3>
+		<div>
+		Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop
+    Use [page:Object3D.rotation] for typical real-time mesh rotation.
+		</div>
+
+		<h3>[method:BufferGeometry rotateZ] ( [page:Float radians] )</h3>
+		<div>
+		Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop
+    Use [page:Object3D.rotation] for typical real-time mesh rotation.
+		</div>
+
+		<h3>[method:BufferGeometry translate] ( [page:Float x], [page:Float y], [page:Float z] )</h3>
+		<div>
+		Translate the geometry. This is typically done as a one time operation, and not during a loop
+    Use [page:Object3D.position] for typical real-time mesh translation.
+		</div>
+
+		<h3>[method:BufferGeometry scale] ( [page:Float x], [page:Float y], [page:Float z] )</h3>
+		<div>
+		Scale the geometry data. This is typically done as a one time operation, and not during a loop
+    Use [page:Object3D.scale] for typical real-time mesh scaling.
+		</div>
+
+		<h3>[method:BufferGeometry lookAt] ( [page:Vector3 vector] )</h3>
+		<div>
+		vector - A world vector to look at.<br />
+		</div>
+		<div>
+		Rotates the geometry to face point in space. This is typically done as a one time operation, and not during a loop
+    Use [page:Object3D.lookAt] for typical real-time mesh usage.
+		</div>
+
+		<h3>[method:BufferGeometry setFromObject] ( [page:Object3D object] )</h3>
+		<div>
+		Sets the attributes for this BufferGeometry from an [page:Object3D].
+		</div>
+
+		<h3>[method:null computeVertexNormals]()</h3>
+		<div>
+		Computes vertex normals by averaging face normals.<br />
+		</div>
+
+		<h3>[method:null computeBoundingBox]()</h3>
+		<div>
+		Computes bounding box of the geometry, updating [page:Geometry Geometry.boundingBox] attribute.<br />
+		Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are *null*.
+		</div>
+
+		<h3>[method:null computeBoundingSphere]()</h3>
+		<div>
+		Computes bounding sphere of the geometry, updating [page:Geometry Geometry.boundingSphere] attribute.<br />
+		Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are *null*.
+		</div>
+
+		<h3>[method:null computeOffsets] ( [page:Integer size] )</h3>
+		<div>
+		Compute the draw offset for large models by chunking the index buffer into chunks of 65k addressable vertices.
+		This method will effectively rewrite the index buffer and remap all attributes to match the new indices.
+		WARNING: This method will also expand the vertex count to prevent sprawled triangles across draw offsets.
+		size - Defaults to 65535 or 4294967296 if extension OES_element_index_uint supported, but allows for larger or smaller chunks.
+		</div>
+
+		<h3>[method:null merge]( [page:BufferGeometry bufferGeometry], [page:Integer offset] )</h3>
+		<div>
+		Merge in another BufferGeometry with an optional offset of where to start merging in.
+		</div>
+
+		<h3>[method:null dispose]()</h3>
+		<div>
+		Disposes the object from memory. <br />
+		You need to call this when you want the bufferGeometry removed while the application is running.
+		</div>
+
+		<h3>[method:null fromGeometry]( [page:Geometry] )</h3>
+		<div>
+		Populates this BufferGeometry with data from a [page:Geometry] object.
+		</div>
+
+		<h3>[method:BufferAttribute getAttribute]( [page:String name] )</h3>
+		<div>
+		Returns the [page:BufferAttribute attribute] with the specified name.
+		</div>
+
+		<h3>[method:BufferAttribute removeAttribute]( [page:String name] )</h3>
+		<div>
+		Removes the [page:BufferAttribute attribute] with the specified name.
+		</div>
+
+		<h3>[method:null normalizeNormals]()</h3>
+		<div>
+		Every normal vector in a geometry will have a magnitude of 1.
+		This will correct lighting on the geometry surfaces.
+		</div>
+
+		<h3>[method:Object toJSON]()</h3>
+		<div>
+		Returns a raw object representation of the BufferGeometry.
+		</div>
+
+		<h3>[method:BufferGeometry clone]()</h3>
+		<div>
+		Creates a clone of this BufferGeometry.
+		</div>
+
+		<h3>[method:BufferGeometry copy]( [page:BufferGeometry bufferGeometry] )</h3>
+		<div>
+		Copies another BufferGeometry to this BufferGeometry.
+		</div>
+
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 1 - 1
docs/api/core/Face3.html

@@ -74,7 +74,7 @@
 
 
 		<h3>[property:Integer materialIndex]</h3>
 		<h3>[property:Integer materialIndex]</h3>
 		<div>
 		<div>
-		Material index (points to [page:MeshFaceMaterial MeshFaceMaterial.materials]).
+		Material index (points to [page:MultiMaterial MultiMaterial.materials]).
 		</div>
 		</div>
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>

+ 1 - 1
docs/api/core/Geometry.html

@@ -287,7 +287,7 @@
 		<h3>[method:null normalize]()</h3>
 		<h3>[method:null normalize]()</h3>
 		<div>
 		<div>
 		Normalize the geometry. <br />
 		Normalize the geometry. <br />
-		Make the geometry centered and has a bounding sphere whose raidus equals to 1.0.
+		Make the geometry centered and has a bounding sphere whose radius equals to 1.0.
 		</div>
 		</div>
 
 
 		<h3>[method:Geometry clone]()</h3>
 		<h3>[method:Geometry clone]()</h3>

+ 0 - 115
docs/api/extras/FontUtils.html

@@ -1,115 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
-		<meta charset="utf-8" />
-		<base href="../../" />
-		<script src="list.js"></script>
-		<script src="page.js"></script>
-		<link type="text/css" rel="stylesheet" href="page.css" />
-	</head>
-	<body>
-		<h1>[name]</h1>
-
-		<div class="desc">A class for text operations in three.js (See [page:TextGeometry])</div>
-
-
-		<h2>Properties</h2>
-
-
-
-		<h3>[property:number divisions]</h3>
-		<div>
-		The amount of segments in a curve. Default is 10.
-		</div> 
-
-		<h3>[property:string style]</h3>
-		<div>
-		The style of the used font. Default is "normal".
-		</div> 
-
-		<h3>[property:string weight]</h3>
-		<div>
-		The weight of the used font. Default is "normal".
-		</div> 
-
-		<h3>[property:string face]</h3>
-		<div>
-		The name of the font. Default is "helvetiker".
-		</div> 
-
-		<h3>[property:object faces]</h3>
-		<div>
-		All Fonts which are already loaded in.
-		</div> 
-
-		<h3>[property:number size]</h3>
-		<div>
-		The size of the used Font. Default is 150.
-		</div> 
-
-		<h2>Methods</h2>
-
-
-
-		<h3>[method:Object drawText]([page:string text])</h3>
-		<div>
-		text -- The text to draw.
-		</div>
-		<div>
-		Calculates the path and offset of the text in the used font. It returns an  object like { paths : fontPaths, offset : width }.
-		</div>
-
-		<h3>[method:Array Triangulate]([page:Array contour], [page:Boolean indices])</h3>
-		<div>
-		contour -- Array of vector2 to define an contour <br />
-		indices -- A boolean indicating if you need to return indices.
-		</div>
-		<div>
-		Triangulates a contour into an array of faces.
-		</div>
-
-		<h3>[method:Object extractGlyphPoints]([page:string c], [page:string face], [page:number scale], [page:number offset], [page:Path path])</h3>
-		<div>
-		c -- The character to extract. <br />
-		face -- The face to use. <br />
-		scale -- The scale of the character. <br />
-		offset -- The offset of the character compared to begin of the path. <br />
-		path -- The path to which to add the character points.
-		</div>
-		<div>
-		This ectracts the glyphPoints of the character of the face and returns an object containing the path and the new offset.
-		</div>
-
-		<h3>[method:Array generateShapes]([page:string text], [page:Object parameters])</h3>
-		<div>
-		text -- The text to generate the shapes from.<br />
-		parameters -- The parameter containing <br />
-			size -- Default is 100.
-			curveSegments -- Default is 4.
-			font -- Default is "helvetiker".
-			weight -- Default is "normal".
-			style -- Default is "normal".
-
-		</div>
-		<div>
-		Generates shapes from the text and return them as an Array of [page:Shape].
-		</div>
-
-		<h3>[method:Object loadFace]([page:Object data])</h3>
-		<div>
-		data -- The data of the face.
-		</div>
-		<div>
-		This loads and saves the data of the face and return the data. When you add the font Data as javascriptfile, then this automatically get called. So there is no need to do this yourself.
-		</div>
-
-		<h3>[method:Object getFace]()</h3>
-		<div>
-		Returns the used font its data based on its style and weight.
-		</div>
-
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
-	</body>
-</html>

+ 1 - 1
docs/api/extras/SceneUtils.html

@@ -22,7 +22,7 @@
 		materials -- The materials for the object.
 		materials -- The materials for the object.
 		</div>
 		</div>
 		<div>
 		<div>
-		Creates an new Object3D an new mesh for each material defined in materials. Beware that this is not the same as Meshfacematerial which defines multiple material for 1 mesh.<br />
+		Creates an new Object3D an new mesh for each material defined in materials. Beware that this is not the same as MultiMaterial which defines multiple material for 1 mesh.<br />
 		This is mostly useful for object that need a material and a wireframe implementation.
 		This is mostly useful for object that need a material and a wireframe implementation.
 		</div>
 		</div>
 
 

+ 60 - 0
docs/api/extras/curves/CatmullRomCurve3.html

@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<base href="../../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+		[page:Curve] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">Create a smooth 3d spline curve from a series of points using the Catmull-Rom algorithm</div>
+
+		<h2>Example</h2>
+
+<code>
+//Create a closed wavey loop
+var curve = new THREE.CatmullRomCurve3( [
+	new THREE.Vector3( -10, 0, 10 ),
+	new THREE.Vector3( -5, 5, 5 ),
+	new THREE.Vector3( 0, 0, 0 ),
+	new THREE.Vector3( 5, -5, 5 ),
+	new THREE.Vector3( 10, 0, 10 )
+] );
+
+var geometry = new THREE.Geometry();
+geometry.vertices = curve.getPoints( 50 );
+
+var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
+</code>
+
+		<h3>[example:webgl_geometry_extrude_splines geometry / extrude / splines]</h3>
+
+
+		<h2>Constructor</h2>
+
+
+		<h3>[name]( [page:Array points] )</h3>
+		<div>points – An array of [page:Vector3] points</div>
+
+		<h2>Properties</h2>
+
+		<h3>[property:Array points]</h3>
+		
+		<h3>[property:Boolean closed] – curve loops back onto itself when true. False by default.</h3>
+		
+		<h3>[property:String type] - possible values are `centripetal` (default), `chordal` and `catmullrom`
+			
+		<h3>[property:float tension] - when type is `catmullrom`, defines catmullrom's tension. Defaults to 0.5
+
+		<h2>Methods</h2>
+
+		<h3>See [page:Curve] for inherited methods</h3>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 2 - 2
docs/api/extras/curves/ClosedSplineCurve3.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../../" />
 		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -12,7 +12,7 @@
 
 
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">Create a smooth 3d spline curve from a series of points that loops back onto itself</div>
+		<div class="desc">Create a smooth 3d spline curve from a series of points that loops back onto itself. THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3</div>
 
 
 		<h2>Example</h2>
 		<h2>Example</h2>
 
 

+ 4 - 4
docs/api/extras/geometries/LatheGeometry.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../../" />
 		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -12,7 +12,7 @@
 
 
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">Class for generating meshes with axial symmetry. Possible uses include donuts, pipes, vases etc. The lathe rotate around the Z axis.</div>
+		<div class="desc">Class for generating meshes with axial symmetry. Possible uses include donuts, pipes, vases etc. The lathe rotate around the Y axis.</div>
 
 
 
 
 		<h2>Example</h2>
 		<h2>Example</h2>
@@ -20,7 +20,7 @@
 		<code>
 		<code>
 		var points = [];
 		var points = [];
 		for ( var i = 0; i < 10; i ++ ) {
 		for ( var i = 0; i < 10; i ++ ) {
-			points.push( new THREE.Vector3( Math.sin( i * 0.2 ) * 15 + 50, 0, ( i - 5 ) * 2 ) );
+			points.push( new THREE.Vector2( Math.sin( i * 0.2 ) * 15 + 50, ( i - 5 ) * 2 ) );
 
 
 		}
 		}
 		var geometry = new THREE.LatheGeometry( points );
 		var geometry = new THREE.LatheGeometry( points );
@@ -34,7 +34,7 @@
 
 
 		<h3>[name]([page:Array points], [page:Integer segments], [page:Float phiStart], [page:Float phiLength])</h3>
 		<h3>[name]([page:Array points], [page:Integer segments], [page:Float phiStart], [page:Float phiLength])</h3>
 		<div>
 		<div>
-		points — Array of Vector3s. Since this rotates around Z axis, the y-values can be set to 0<br />
+		points — Array of Vector2s.<br />
 		segments — the number of circumference segments to generate. Default is 12.<br />
 		segments — the number of circumference segments to generate. Default is 12.<br />
 		phiStart — the starting angle in radians. Default is 0.<br />
 		phiStart — the starting angle in radians. Default is 0.<br />
 		phiLength — the radian (0 to 2*PI) range of the lathed section 2*PI is a closed lathe, less than 2PI is a portion. Default is 2*PI
 		phiLength — the radian (0 to 2*PI) range of the lathed section 2*PI is a closed lathe, less than 2PI is a portion. Default is 2*PI

+ 1 - 3
docs/api/extras/geometries/TextGeometry.html

@@ -31,12 +31,10 @@
 		text — The text that needs to be shown. <br />
 		text — The text that needs to be shown. <br />
 		parameters — Object that can contains the following parameters.
 		parameters — Object that can contains the following parameters.
 		<ul>
 		<ul>
+			<li>font — THREE.Font.</li>
 			<li>size — Float. Size of the text.</li>
 			<li>size — Float. Size of the text.</li>
 			<li>height — Float. Thickness to extrude text.  Default is 50.</li>
 			<li>height — Float. Thickness to extrude text.  Default is 50.</li>
 			<li>curveSegments — Integer. Number of points on the curves. Default is 12.</li>
 			<li>curveSegments — Integer. Number of points on the curves. Default is 12.</li>
-			<li>font — String. Font name.</li>
-			<li>weight — String. Font weight (normal, bold).</li>
-			<li>style —  String. Font style (normal, italics).</li>
 			<li>bevelEnabled — Boolean. Turn on bevel. Default is False.</li>
 			<li>bevelEnabled — Boolean. Turn on bevel. Default is False.</li>
 			<li>bevelThickness — Float. How deep into text bevel goes. Default is 10.</li>
 			<li>bevelThickness — Float. How deep into text bevel goes. Default is 10.</li>
 			<li>bevelSize — Float. How far from text outline is bevel. Default is 8.</li>
 			<li>bevelSize — Float. How far from text outline is bevel. Default is 8.</li>

+ 61 - 60
docs/api/extras/helpers/FaceNormalsHelper.html

@@ -1,61 +1,62 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
+<!DOCTYPE html>
+<html lang="en">
+	<head>
 		<meta charset="utf-8" />
 		<meta charset="utf-8" />
-		<base href="../../../" />
-		<script src="list.js"></script>
-		<script src="page.js"></script>
-		<link type="text/css" rel="stylesheet" href="page.css" />
-	</head>
-	<body>
-		[page:Line] &rarr;
-
-		<h1>[name]</h1>
-
-		<div class="desc">Renders [page:ArrowHelper arrows] to visualize an object's [page:Face3 face] normals. Requires that the object's geometry be an instance of [page:Geometry] (does not work with [page:BufferGeometry]), and that face normals have been specified on all [page:Face3 faces] or calculated with [page:Geometry.computeFaceNormals computeFaceNormals].</div>
-
-		<h2>Example</h2>
-
-		<code>
-		geometry = new THREE.BoxGeometry( 10, 10, 10, 2, 2, 2 );
-		material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
-		object = new THREE.Mesh( geometry, material );
-
-		edges = new THREE.FaceNormalsHelper( object, 2, 0x00ff00, 1 );
-
-		scene.add( object );
-		scene.add( edges );
-		</code>
-		[example:webgl_helpers Example using various helpers]
-
-		<h2>Constructor</h2>
-
-
-		<h3>[name]( [page:Object3D object], [page:Number size], [page:Color color], [page:Number linewidth] )</h3>
-		<div>object -- object for which to render face normals
-		size -- size (length) of the arrows
-		color -- color of the arrows
-		linewidth -- width of the arrow lines
-		</div>
-
-
-		<h2>Properties</h2>
-
-		<h3>[property:Object3D object]</h3>
-		<div>
-		The attached object
-		</div>
-
-
-		<h2>Methods</h2>
-
-
-		<h3>[method:null update]()</h3>
-		<div>Updates the face normal preview based on movement of the object.</div>
-
-
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
-	</body>
-</html>
+		<base href="../../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+		[page:Line] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">Renders [page:ArrowHelper arrows] to visualize an object's [page:Face3 face] normals. Requires that the object's geometry be an instance of [page:Geometry] (does not work with [page:BufferGeometry]), and that face normals have been specified on all [page:Face3 faces] or calculated with [page:Geometry.computeFaceNormals computeFaceNormals].</div>
+
+		<h2>Example</h2>
+
+		<code>
+		geometry = new THREE.BoxGeometry( 10, 10, 10, 2, 2, 2 );
+		material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
+		object = new THREE.Mesh( geometry, material );
+
+		edges = new THREE.FaceNormalsHelper( object, 2, 0x00ff00, 1 );
+
+		scene.add( object );
+		scene.add( edges );
+		</code>
+		[example:webgl_helpers Example using various helpers]
+
+		<h2>Constructor</h2>
+
+
+		<h3>[name]( [page:Object3D object], [page:Number size], [page:Color color], [page:Number linewidth] )</h3>
+		<div>
+		object -- object for which to render face normals<br />
+		size -- size (length) of the arrows<br />
+		color -- color of the arrows<br />
+		linewidth -- width of the arrow lines
+		</div>
+
+
+		<h2>Properties</h2>
+
+		<h3>[property:Object3D object]</h3>
+		<div>
+		The attached object
+		</div>
+
+
+		<h2>Methods</h2>
+
+
+		<h3>[method:null update]()</h3>
+		<div>Updates the face normal preview based on movement of the object.</div>
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 2 - 1
docs/api/lights/SpotLight.html

@@ -70,7 +70,8 @@
 		<h3>[property:Object3D target]</h3>
 		<h3>[property:Object3D target]</h3>
 		<div>
 		<div>
 			Spotlight focus points at target.position.<br />
 			Spotlight focus points at target.position.<br />
-			Default position — *(0,0,0)*.
+			Default position — *(0,0,0)*.<br />
+			*Note*: Currently for target property to work properly, it must be part of the [page:Scene scene], e.g. this will help: <code>scene.add( light.target )</code>
 		</div>
 		</div>
 	
 	
 		<h3>[property:Float intensity]</h3>
 		<h3>[property:Float intensity]</h3>

+ 1 - 1
docs/api/loaders/JSONLoader.html

@@ -61,7 +61,7 @@
 			'models/animated/monster/monster.js',
 			'models/animated/monster/monster.js',
 			// Function when resource is loaded
 			// Function when resource is loaded
 			function ( geometry, materials ) {
 			function ( geometry, materials ) {
-				var material = new THREE.MeshFaceMaterial( materials );
+				var material = new THREE.MultiMaterial( materials );
 				var object = new THREE.Mesh( geometry, material );
 				var object = new THREE.Mesh( geometry, material );
 				scene.add( object );
 				scene.add( object );
 			}
 			}

+ 84 - 0
docs/api/loaders/PCDLoader.html

@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<base href="../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+
+		<h1>[name]</h1>
+
+		<div class="desc">A loader for <em>PCD</em> files. Loads ascii and binary. Compressed binary files are not suported.</div>
+
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( [page:LoadingManager manager] )</h3>
+		<div>
+		[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
+		</div>
+		<div>
+		Creates a new [name].
+		</div>
+
+		<h2>Properties</h2>
+
+		<h3>[page:Boolean littleEndian]</h3>
+		<div>
+		Default value is true.
+		</div>
+
+		<h2>Methods</h2>
+
+		<h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
+		<div>
+		[page:String url] — required<br />
+		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Object3D].<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onError] — Will be called when load errors.<br />
+		</div>
+		<div>
+		Begin loading from url and call onLoad with the parsed response content.
+		</div>
+
+		<h3>[method:Object3D parse]( [page:Arraybuffer data],[page:String url] )</h3>
+		<div>
+		[page:Arraybuffer data] — The binary structure to parse.
+		</div>
+		<div>
+		[page:String url] — The file name or file url.
+		</div>
+		<div>
+		Parse an <em>pcd</em> binary structure and return an [page:Object3D].<br /> 
+		The object is converted to [page:Points] with a [page:BufferGeometry] and a [page:PointsMaterial].
+		</div>
+
+		<h2>Example</h2>
+
+		<code>
+
+		// instantiate a loader
+		var loader = new THREE.PCDLoader();
+		
+		// load a resource
+		loader.load( 
+			// resource URL
+			'pointcloud.pcd' , 
+			// Function when resource is loaded
+			function ( mesh ) {
+				scene.add( mesh );
+			}
+		);
+		</code>
+
+		[example:webgl_loader_pcd]
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/PCDLoader.js examples/js/loaders/PCDLoader.js]
+	</body>
+</html>

+ 16 - 1
docs/api/materials/MeshLambertMaterial.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -26,6 +26,9 @@
 		<div>
 		<div>
 		color — Line color in hexadecimal. Default is 0xffffff.<br />
 		color — Line color in hexadecimal. Default is 0xffffff.<br />
 		map — Sets the texture map. Default is null <br />
 		map — Sets the texture map. Default is null <br />
+		lightMap — Set light map. Default is null.<br />
+		aoMap — Set ao map. Default is null.<br />
+		emissiveMap — Set emissive map. Default is null.<br />
 		specularMap — Set specular map. Default is null.<br />
 		specularMap — Set specular map. Default is null.<br />
 		alphaMap — Set alpha map. Default is null.<br />
 		alphaMap — Set alpha map. Default is null.<br />
 		envMap — Set env map. Default is null.<br />
 		envMap — Set env map. Default is null.<br />
@@ -53,9 +56,21 @@
 		Emissive (light) color of the material, essentially a solid color unaffected by other lighting. Default is black.<br />
 		Emissive (light) color of the material, essentially a solid color unaffected by other lighting. Default is black.<br />
 		</div>
 		</div>
 
 
+		<h3>[property:Float emissiveIntensity]</h3>
+		<div>Intensity of the emissive light. Modulates the emissive color. Default is 1.</div>
+
 		<h3>[property:Texture map]</h3>
 		<h3>[property:Texture map]</h3>
 		<div>Set color texture map. Default is null.</div>
 		<div>Set color texture map. Default is null.</div>
 
 
+		<h3>[property:Texture lightMap]</h3>
+		<div>Set light map. Default is null. The lightMap requires a second set of UVs.</div>
+
+		<h3>[property:Texture aoMap]</h3>
+		<div>Set ambient occlusion map. Default is null. The aoMap requires a second set of UVs.</div>
+
+		<h3>[property:Texture emissiveMap]</h3>
+		<div>Set emisssive (glow) map. Default is null. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.</div>
+
 		<h3>[property:Texture specularMap]</h3>
 		<h3>[property:Texture specularMap]</h3>
 		<div>Since this material does not have a specular component, the specular value affects only how much of the environment map affects the surface. Default is null.</div>
 		<div>Since this material does not have a specular component, the specular value affects only how much of the environment map affects the surface. Default is null.</div>
 
 

+ 5 - 2
docs/api/materials/MeshPhongMaterial.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -65,6 +65,9 @@
 		Emissive (light) color of the material, essentially a solid color unaffected by other lighting. Default is black.<br />
 		Emissive (light) color of the material, essentially a solid color unaffected by other lighting. Default is black.<br />
 		</div>
 		</div>
 
 
+		<h3>[property:Float emissiveIntensity]</h3>
+		<div>Intensity of the emissive light. Modulates the emissive color. Default is 1.</div>
+
 		<h3>[property:Color specular]</h3>
 		<h3>[property:Color specular]</h3>
 		<div>
 		<div>
 		Specular color of the material, i.e., how shiny the material is and the color of its shine. Setting this the same color as the diffuse value (times some intensity) makes the material more metallic-looking; setting this to some gray makes the material look more plastic. Default is dark gray.<br />
 		Specular color of the material, i.e., how shiny the material is and the color of its shine. Setting this the same color as the diffuse value (times some intensity) makes the material more metallic-looking; setting this to some gray makes the material look more plastic. Default is dark gray.<br />
@@ -83,7 +86,7 @@
 		<div>Set ambient occlusion map. Default is null. The aoMap requires a second set of UVs.</div>
 		<div>Set ambient occlusion map. Default is null. The aoMap requires a second set of UVs.</div>
 
 
 		<h3>[property:Texture emissiveMap]</h3>
 		<h3>[property:Texture emissiveMap]</h3>
-		<div>Set emisssive (glow) map. Default is null. The emissive map color is modulated by the emissive color. If you have an emissive map, be sure to set the emissive color to something other than black.</div>
+		<div>Set emisssive (glow) map. Default is null. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.</div>
 
 
 		<h3>[property:Texture bumpMap]</h3>
 		<h3>[property:Texture bumpMap]</h3>
 		<div>
 		<div>

+ 2 - 2
docs/api/materials/MeshFaceMaterial.html → docs/api/materials/MultiMaterial.html

@@ -11,7 +11,7 @@
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
 		<div class="desc">
 		<div class="desc">
-		A Material to define multiple materials for the same geometry. 
+		A Material to define multiple materials for the same geometry.
 		The geometry decides which material is used for which faces by the [page:Face3 faces materialindex].
 		The geometry decides which material is used for which faces by the [page:Face3 faces materialindex].
 		The materialindex corresponds with the index of the material in the materials array.
 		The materialindex corresponds with the index of the material in the materials array.
 		</div>
 		</div>
@@ -25,7 +25,7 @@
 		materials -- The materials for the geometry.
 		materials -- The materials for the geometry.
 		</div>
 		</div>
 		<div>
 		<div>
-		Creates a MeshFaceMaterial with the correct materials.
+		Creates a MultiMaterial with the correct materials.
 		</div>
 		</div>
 
 
 
 

+ 1 - 1
docs/api/materials/ShaderMaterial.html

@@ -46,7 +46,7 @@
 		<h3>Vertex shaders and fragment shaders</h3>
 		<h3>Vertex shaders and fragment shaders</h3>
 		<p>You can specify two different types of shaders for each material:
 		<p>You can specify two different types of shaders for each material:
 		<ul>
 		<ul>
-			<li>The *vertex shader* runs first; it recieves *attributes*, calculates/manipulates the position of each individual vertex, and passes additional data (*varying*s) to the fragment shader.</li>
+			<li>The *vertex shader* runs first; it receives *attributes*, calculates/manipulates the position of each individual vertex, and passes additional data (*varying*s) to the fragment shader.</li>
 			<li>The *fragment shader* runs second; it sets the color of each individual "fragment" (pixel) rendered to the screen.</li>
 			<li>The *fragment shader* runs second; it sets the color of each individual "fragment" (pixel) rendered to the screen.</li>
 		</ul>
 		</ul>
 		</p>
 		</p>

+ 1 - 1
docs/api/math/Box2.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>

+ 1 - 1
docs/api/math/Box3.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>

+ 1 - 1
docs/api/math/Euler.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>

+ 1 - 1
docs/api/math/Frustum.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>

+ 3 - 3
docs/api/math/Line3.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -72,7 +72,7 @@
 		</div>
 		</div>
 		Returns true if both line's start and end points are equal.
 		Returns true if both line's start and end points are equal.
 		</div>
 		</div>
-		
+
 		<h3>[method:Float distanceSq]()</h3>
 		<h3>[method:Float distanceSq]()</h3>
 		<div>
 		<div>
 		Returns the line segment's length squared.
 		Returns the line segment's length squared.
@@ -94,7 +94,7 @@
 		<div>
 		<div>
 		Return a vector at a certain position along the line. When t = 0, it returns the start vector, and when t=1 it returns the end vector.
 		Return a vector at a certain position along the line. When t = 0, it returns the start vector, and when t=1 it returns the end vector.
 		</div>
 		</div>
-		
+
 		<h3>[method:Vector3 center]([page:Vector3 optionalTarget])</h3>
 		<h3>[method:Vector3 center]([page:Vector3 optionalTarget])</h3>
 		<div>
 		<div>
 		optionalTarget -- [page:Vector3] Optional target to set the result.
 		optionalTarget -- [page:Vector3] Optional target to set the result.

+ 1 - 1
docs/api/math/Math.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>

+ 1 - 1
docs/api/math/Plane.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>

+ 4 - 4
docs/api/math/Quaternion.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -170,8 +170,8 @@
 		// rotate a mesh towards a target quaternion
 		// rotate a mesh towards a target quaternion
 		mesh.quaternion.slerp( endQuaternion, 0.01 );
 		mesh.quaternion.slerp( endQuaternion, 0.01 );
 		</code>
 		</code>
-		
-		
+
+
 		<h2>Static Methods</h2>
 		<h2>Static Methods</h2>
 
 
 		<h3>[method:Quaternion slerp]( [page:Quaternion qStart], [page:Quaternion qEnd], [page:Quaternion qTarget], [page:Float t] )</h3>
 		<h3>[method:Quaternion slerp]( [page:Quaternion qStart], [page:Quaternion qEnd], [page:Quaternion qTarget], [page:Float t] )</h3>
@@ -195,7 +195,7 @@
 		t = ( t + 0.01 ) % 1; // constant angular momentum
 		t = ( t + 0.01 ) % 1; // constant angular momentum
 		THREE.Quaternion.slerp( startQuaternion, endQuaternion, mesh.quaternion, t );
 		THREE.Quaternion.slerp( startQuaternion, endQuaternion, mesh.quaternion, t );
 		</code>
 		</code>
-		
+
 		<!-- Note: Do not add non-static methods to the bottom of this page. Put them above the <h2>Static Methods</h2> -->
 		<!-- Note: Do not add non-static methods to the bottom of this page. Put them above the <h2>Static Methods</h2> -->
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 9 - 1
docs/api/math/Ray.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -191,6 +191,14 @@
 		Copy the parameters to the origin and direction properties.
 		Copy the parameters to the origin and direction properties.
 		</div>
 		</div>
 
 
+		<h3>[method:Ray lookAt]([page:Vector3 v])</h3>
+		<div>
+		v -- [page:Vector3] The vector to look at.
+		</div>
+		<div>
+		Adjusts the direction of the ray to point at the vector in world coordinates.
+		</div>
+
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

+ 6 - 6
docs/api/math/Sphere.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -21,16 +21,16 @@
 		center -- [page:Vector3] <br />
 		center -- [page:Vector3] <br />
 		radius -- [page:Float]
 		radius -- [page:Float]
 		</div>
 		</div>
-		
+
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
 
 
 		<h3>[property:Vector3 center]</h3>
 		<h3>[property:Vector3 center]</h3>
-		
+
 		<h3>[property:Float radius]</h3>
 		<h3>[property:Float radius]</h3>
-		
-		
+
+
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
 
 
@@ -84,7 +84,7 @@
 
 
 		<h3>[method:Sphere setFromPoints]([page:Array points], [page:Vector3 optionalCenter]) [page:Sphere this]</h3>
 		<h3>[method:Sphere setFromPoints]([page:Array points], [page:Vector3 optionalCenter]) [page:Sphere this]</h3>
 		<div>
 		<div>
-		points -- [page:Array] of [page:Vector3] positions.<br />  
+		points -- [page:Array] of [page:Vector3] positions.<br />
 		optionalCenter -- Optional [page:Vector3] position for the sphere's center.<br />
 		optionalCenter -- Optional [page:Vector3] position for the sphere's center.<br />
 		</div>
 		</div>
 		<div>
 		<div>

+ 5 - 5
docs/api/math/Spline.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -17,7 +17,7 @@
 
 
 
 
 		<h3>[name]( [page:Array points] )</h3>
 		<h3>[name]( [page:Array points] )</h3>
-		
+
 		<div>Initialises the spline with *points*, which are the places through which the spline will go.</div>
 		<div>Initialises the spline with *points*, which are the places through which the spline will go.</div>
 
 
 
 
@@ -40,11 +40,11 @@
 		k — point index
 		k — point index
 		</div>
 		</div>
 		<div>Return the interpolated point at *k*.</div>
 		<div>Return the interpolated point at *k*.</div>
-		
+
 		<h3>[method:Array getControlPointsArray]( )</h3>
 		<h3>[method:Array getControlPointsArray]( )</h3>
 		<div>Returns an array with triplets of x, y, z coordinates that correspond to the current control points.
 		<div>Returns an array with triplets of x, y, z coordinates that correspond to the current control points.
 		</div>
 		</div>
-		
+
 		<h3>[method:Object getLength]( [page:Integer nSubDivisions] )</h3>
 		<h3>[method:Object getLength]( [page:Integer nSubDivisions] )</h3>
 		<div>
 		<div>
 		nSubDivisions — number of subdivisions between control points. Default is *100*.
 		nSubDivisions — number of subdivisions between control points. Default is *100*.
@@ -54,7 +54,7 @@
 			the length of the spline when using nSubDivisions. The property .[page:Array chunkLength]
 			the length of the spline when using nSubDivisions. The property .[page:Array chunkLength]
 			contains an array with the total length from the beginning of the spline to the end of that chunk.
 			contains an array with the total length from the beginning of the spline to the end of that chunk.
 		</div>
 		</div>
-		
+
 		<h3>[method:null reparametrizeByArcLength]( [page:Float samplingCoef] )</h3>
 		<h3>[method:null reparametrizeByArcLength]( [page:Float samplingCoef] )</h3>
 		<div>
 		<div>
 		samplingCoef — how many intermediate values to use between spline points
 		samplingCoef — how many intermediate values to use between spline points

+ 3 - 3
docs/api/math/Triangle.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -35,7 +35,7 @@
 		<div>
 		<div>
 		The first [page:Vector3] of the triangle.
 		The first [page:Vector3] of the triangle.
 		</div>
 		</div>
-		
+
 		<h3>[property:Vector3 b]</h3>
 		<h3>[property:Vector3 b]</h3>
 		<div>
 		<div>
 		The second [page:Vector3] of the triangle.
 		The second [page:Vector3] of the triangle.
@@ -120,7 +120,7 @@
 		optionalTarget -- Optional [page:Plane] target to set the result.
 		optionalTarget -- Optional [page:Plane] target to set the result.
 		</div>
 		</div>
 		<div>
 		<div>
-		Return a [page:Plane plane] based on the triangle. Optionally sets a target plane. 
+		Return a [page:Plane plane] based on the triangle. Optionally sets a target plane.
 		</div>
 		</div>
 
 
 		<h3>[method:Boolean containsPoint]([page:Vector3 point])</h3>
 		<h3>[method:Boolean containsPoint]([page:Vector3 point])</h3>

+ 5 - 0
docs/api/math/Vector2.html

@@ -120,6 +120,11 @@
 		Normalizes this vector.
 		Normalizes this vector.
 		</div>
 		</div>
 
 
+		<h3>[method:Float angle]()</h3>
+		<div>
+		Computes the angle in radians of this vector with respect to the positive x-axis.
+		</div>
+
 		<h3>[method:Float distanceTo]( [page:Vector2 v] )</h3>
 		<h3>[method:Float distanceTo]( [page:Vector2 v] )</h3>
 		<div>
 		<div>
 		Computes distance of this vector to *v*.
 		Computes distance of this vector to *v*.

+ 2 - 2
docs/api/objects/Sprite.html

@@ -17,7 +17,7 @@
                 <h2>Example</h2>
                 <h2>Example</h2>
 
 
                 <code>
                 <code>
-                var map = THREE.ImageUtils.loadTexture( "sprite.png" );
+                var map = new THREE.TextureLoader().load( "sprite.png" );
                 var material = new THREE.SpriteMaterial( { map: map, color: 0xffffff, fog: true } );
                 var material = new THREE.SpriteMaterial( { map: map, color: 0xffffff, fog: true } );
                 var sprite = new THREE.Sprite( material );
                 var sprite = new THREE.Sprite( material );
                 scene.add( sprite );
                 scene.add( sprite );
@@ -48,7 +48,7 @@
                 <div>
                 <div>
                 This creates a new clone of the sprite.
                 This creates a new clone of the sprite.
                 </div>
                 </div>
-		
+
 		<h3>[method:Object3D clone]([page:Object3D object])</h3>
 		<h3>[method:Object3D clone]([page:Object3D object])</h3>
 		<div>
 		<div>
 		object -- (optional) Object3D which needs to be cloned. If undefined, clone method will create a new cloned Sprite Object.
 		object -- (optional) Object3D which needs to be cloned. If undefined, clone method will create a new cloned Sprite Object.

+ 6 - 11
docs/api/renderers/WebGLRenderer.html

@@ -98,11 +98,6 @@
 		<div>Default is THREE.CullFaceFront. The faces that needed to be culled. Possible values: THREE.CullFaceFront and THREE.CullFaceBack</div>
 		<div>Default is THREE.CullFaceFront. The faces that needed to be culled. Possible values: THREE.CullFaceFront and THREE.CullFaceBack</div>
 
 
 
 
-		<h3>[page:Boolean shadowMapDebug]</h3>
-
-		<div>Default is false. If set, then the shadowmaps get a specific color to identify which shadow is from which shadowmap.</div>
-
-
 		<h3>[property:Boolean shadowMapCascade]</h3>
 		<h3>[property:Boolean shadowMapCascade]</h3>
 
 
 		<div>Default is false. If Set, use cascaded shadowmaps. See [link:http://developer.download.nvidia.com/SDK/10.5/opengl/src/cascaded_shadow_maps/doc/cascaded_shadow_maps.pdf cascaded shadowmaps] for more information.</div>
 		<div>Default is false. If Set, use cascaded shadowmaps. See [link:http://developer.download.nvidia.com/SDK/10.5/opengl/src/cascaded_shadow_maps/doc/cascaded_shadow_maps.pdf cascaded shadowmaps] for more information.</div>
@@ -169,8 +164,8 @@
 		Return a [page:Boolean] true if the context supports vertex textures.
 		Return a [page:Boolean] true if the context supports vertex textures.
 		</div>
 		</div>
 
 
-		<h3>[method:null setSize]( [page:Integer width], [page:Integer height] )</h3>
-		<div>Resizes the output canvas to (width, height), and also sets the viewport to fit that size, starting in (0, 0).</div>
+		<h3>[method:null setSize]( [page:Integer width], [page:Integer height], [page:Boolean updateStyle] )</h3>
+		<div>Resizes the output canvas to (width, height), and also sets the viewport to fit that size, starting in (0, 0). Setting updateStyle to true adds explicit pixel units to the output canvas style.</div>
 
 
 		<h3>[method:null setViewport]( [page:Integer x], [page:Integer y], [page:Integer width], [page:Integer height] )</h3>
 		<h3>[method:null setViewport]( [page:Integer x], [page:Integer y], [page:Integer width], [page:Integer height] )</h3>
 		<div>Sets the viewport to render from (x, y) to (x + width, y + height).</div>
 		<div>Sets the viewport to render from (x, y) to (x + width, y + height).</div>
@@ -178,11 +173,11 @@
 
 
 		<h3>[method:null setScissor]( [page:Integer x], [page:Integer y], [page:Integer width], [page:Integer height] )</h3>
 		<h3>[method:null setScissor]( [page:Integer x], [page:Integer y], [page:Integer width], [page:Integer height] )</h3>
 		<div>Sets the scissor area from (x, y) to (x + width, y + height).</div>
 		<div>Sets the scissor area from (x, y) to (x + width, y + height).</div>
-		
+
 		<div>NOTE: The point (x, y) is the lower left corner of the area to be set for both of these methods. The area is defined from left to right in width but bottom to top in height. The sense of the vertical definition is opposite to the fill direction of an HTML canvas element.</div>
 		<div>NOTE: The point (x, y) is the lower left corner of the area to be set for both of these methods. The area is defined from left to right in width but bottom to top in height. The sense of the vertical definition is opposite to the fill direction of an HTML canvas element.</div>
 
 
-		<h3>[method:null enableScissorTest]( [page:Boolean enable] )</h3>
-		<div>Enable the scissor test. When this is enabled, only the pixels within the defined scissor area will be affected by further renderer actions.</div>
+		<h3>[method:null setScissorTest]( [page:Boolean boolean] )</h3>
+		<div>Enable or disable the scissor test. When this is enabled, only the pixels within the defined scissor area will be affected by further renderer actions.</div>
 
 
 		<h3>[method:null setClearColor]( [page:Color color], [page:Float alpha] )</h3>
 		<h3>[method:null setClearColor]( [page:Color color], [page:Float alpha] )</h3>
 		<div>Sets the clear color and opacity.</div>
 		<div>Sets the clear color and opacity.</div>
@@ -200,7 +195,7 @@
 		<div>Returns a [page:Float float] with the current clear alpha. Ranges from 0 to 1.</div>
 		<div>Returns a [page:Float float] with the current clear alpha. Ranges from 0 to 1.</div>
 
 
 		<h3>[method:null clear]( [page:Boolean color], [page:Boolean depth], [page:Boolean stencil] )</h3>
 		<h3>[method:null clear]( [page:Boolean color], [page:Boolean depth], [page:Boolean stencil] )</h3>
-		<div>Tells the renderer to clear its color, depth or stencil drawing buffer(s).</div>
+		<div>Tells the renderer to clear its color, depth or stencil drawing buffer(s). This method initializes the color buffer to the current clear color value.</div>
 		<div>Arguments default to true.</div>
 		<div>Arguments default to true.</div>
 
 
 		<h3>[method:null renderBufferImmediate]( [page:Object3D object], [page:shaderprogram program], [page:Material shading] )</h3>
 		<h3>[method:null renderBufferImmediate]( [page:Object3D object], [page:shaderprogram program], [page:Material shading] )</h3>

+ 2 - 2
docs/api/textures/Texture.html

@@ -21,7 +21,7 @@
 
 
 		<code>
 		<code>
 		// load a texture, set wrap mode to repeat
 		// load a texture, set wrap mode to repeat
-		var texture = THREE.ImageUtils.loadTexture( "textures/water.jpg" );
+		var texture = new THREE.TextureLoader().load( "textures/water.jpg" );
 		texture.wrapS = THREE.RepeatWrapping;
 		texture.wrapS = THREE.RepeatWrapping;
 		texture.wrapT = THREE.RepeatWrapping;
 		texture.wrapT = THREE.RepeatWrapping;
 		texture.repeat.set( 4, 4 );
 		texture.repeat.set( 4, 4 );
@@ -53,7 +53,7 @@
 		<div>
 		<div>
 		The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.
 		The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.
 		</div>
 		</div>
-		
+
 		<div>
 		<div>
 		NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels. Individual dimensions need not be equal, but each must be a power of two. This is a limitation of WebGL, not Three.js.
 		NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels. Individual dimensions need not be equal, but each must be a power of two. This is a limitation of WebGL, not Three.js.
 		</div>
 		</div>

+ 8 - 8
docs/list.js

@@ -9,11 +9,11 @@ var list = {
 
 
 	"Reference": {
 	"Reference": {
 		"Constants": [
 		"Constants": [
-			[ "CustomBlendingEquation", "api/constants/CustomBlendingEquations"],
-			[ "GLState", "api/constants/GLState"],
-			[ "Materials", "api/constants/Materials"],
-			[ "ShadowingTypes", "api/constants/ShadowingTypes"],
-			[ "Textures", "api/constants/Textures"]
+			[ "CustomBlendingEquation", "api/constants/CustomBlendingEquations" ],
+			[ "GLState", "api/constants/GLState" ],
+			[ "Materials", "api/constants/Materials" ],
+			[ "ShadowingTypes", "api/constants/ShadowingTypes" ],
+			[ "Textures", "api/constants/Textures" ]
 		],
 		],
 
 
 		"Cameras": [
 		"Cameras": [
@@ -72,7 +72,7 @@ var list = {
 			[ "Material", "api/materials/Material" ],
 			[ "Material", "api/materials/Material" ],
 			[ "MeshBasicMaterial", "api/materials/MeshBasicMaterial" ],
 			[ "MeshBasicMaterial", "api/materials/MeshBasicMaterial" ],
 			[ "MeshDepthMaterial", "api/materials/MeshDepthMaterial" ],
 			[ "MeshDepthMaterial", "api/materials/MeshDepthMaterial" ],
-			[ "MeshFaceMaterial", "api/materials/MeshFaceMaterial" ],
+			[ "MultiMaterial", "api/materials/MultiMaterial" ],
 			[ "MeshLambertMaterial", "api/materials/MeshLambertMaterial" ],
 			[ "MeshLambertMaterial", "api/materials/MeshLambertMaterial" ],
 			[ "MeshNormalMaterial", "api/materials/MeshNormalMaterial" ],
 			[ "MeshNormalMaterial", "api/materials/MeshNormalMaterial" ],
 			[ "MeshPhongMaterial", "api/materials/MeshPhongMaterial" ],
 			[ "MeshPhongMaterial", "api/materials/MeshPhongMaterial" ],
@@ -150,14 +150,13 @@ var list = {
 		],
 		],
 
 
 		"Textures": [
 		"Textures": [
-			[ "CubeTexture", "api/textures/CubeTexture" ],
 			[ "CompressedTexture", "api/textures/CompressedTexture" ],
 			[ "CompressedTexture", "api/textures/CompressedTexture" ],
+			[ "CubeTexture", "api/textures/CubeTexture" ],
 			[ "DataTexture", "api/textures/DataTexture" ],
 			[ "DataTexture", "api/textures/DataTexture" ],
 			[ "Texture", "api/textures/Texture" ]
 			[ "Texture", "api/textures/Texture" ]
 		],
 		],
 
 
 		"Extras": [
 		"Extras": [
-			[ "FontUtils", "api/extras/FontUtils" ],
 			[ "GeometryUtils", "api/extras/GeometryUtils" ],
 			[ "GeometryUtils", "api/extras/GeometryUtils" ],
 			[ "SceneUtils", "api/extras/SceneUtils" ]
 			[ "SceneUtils", "api/extras/SceneUtils" ]
 		],
 		],
@@ -178,6 +177,7 @@ var list = {
 
 
 		"Extras / Curves": [
 		"Extras / Curves": [
 			[ "ArcCurve", "api/extras/curves/ArcCurve" ],
 			[ "ArcCurve", "api/extras/curves/ArcCurve" ],
+			[ "CatmullRomCurve3", "api/extras/curves/CatmullRomCurve3" ],
 			[ "ClosedSplineCurve3", "api/extras/curves/ClosedSplineCurve3" ],
 			[ "ClosedSplineCurve3", "api/extras/curves/ClosedSplineCurve3" ],
 			[ "CubicBezierCurve", "api/extras/curves/CubicBezierCurve" ],
 			[ "CubicBezierCurve", "api/extras/curves/CubicBezierCurve" ],
 			[ "CubicBezierCurve3", "api/extras/curves/CubicBezierCurve3" ],
 			[ "CubicBezierCurve3", "api/extras/curves/CubicBezierCurve3" ],

+ 14 - 14
docs/page.js

@@ -7,7 +7,7 @@ var onDocumentLoad = function ( event ) {
 
 
 	if ( section == 'manual' ) {
 	if ( section == 'manual' ) {
 
 
-		name = name.replace(/\-/g, ' ');
+		name = name.replace( /\-/g, ' ' );
 
 
 		path = pathname.replace( /\ /g, '-' );
 		path = pathname.replace( /\ /g, '-' );
 		path = /\/manual\/[-A-z0-9\/]+/.exec( path ).toString().substr( 8 );
 		path = /\/manual\/[-A-z0-9\/]+/.exec( path ).toString().substr( 8 );
@@ -20,22 +20,22 @@ var onDocumentLoad = function ( event ) {
 
 
 	var text = document.body.innerHTML;
 	var text = document.body.innerHTML;
 
 
-	text = text.replace(/\[name\]/gi, name);
-	text = text.replace(/\[path\]/gi, path);
-	text = text.replace(/\[page:([\w\.]+)\]/gi, "[page:$1 $1]" ); // [page:name] to [page:name title]
-	text = text.replace(/\[page:\.([\w\.]+) ([\w\.\s]+)\]/gi, "[page:"+name+".$1 $2]" ); // [page:.member title] to [page:name.member title]
-	text = text.replace(/\[page:([\w\.]+) ([\w\.\s]+)\]/gi, "<a href=\"javascript:window.parent.goTo('$1')\" title=\"$1\">$2</a>" ); // [page:name title]
-	// text = text.replace(/\[member:.([\w]+) ([\w\.\s]+)\]/gi, "<a href=\"javascript:window.parent.goTo('" + name + ".$1')\" title=\"$1\">$2</a>" );
+	text = text.replace( /\[name\]/gi, name );
+	text = text.replace( /\[path\]/gi, path );
+	text = text.replace( /\[page:([\w\.]+)\]/gi, "[page:$1 $1]" ); // [page:name] to [page:name title]
+	text = text.replace( /\[page:\.([\w\.]+) ([\w\.\s]+)\]/gi, "[page:" + name + ".$1 $2]" ); // [page:.member title] to [page:name.member title]
+	text = text.replace( /\[page:([\w\.]+) ([\w\.\s]+)\]/gi, "<a href=\"javascript:window.parent.goTo('$1')\" title=\"$1\">$2</a>" ); // [page:name title]
+	// text = text.replace( /\[member:.([\w]+) ([\w\.\s]+)\]/gi, "<a href=\"javascript:window.parent.goTo('" + name + ".$1')\" title=\"$1\">$2</a>" );
 
 
-	text = text.replace(/\[(?:member|property|method):([\w]+)\]/gi, "[member:$1 $1]" ); // [member:name] to [member:name title]
-	text = text.replace(/\[(?:member|property|method):([\w]+) ([\w\.\s]+)\]/gi, "<a href=\"javascript:window.parent.goTo('"+name+".$2')\" target=\"_parent\" title=\""+name+".$2\" class=\"permalink\">#</a> .<a href=\"javascript:window.parent.goTo('$1')\" title=\"$1\" id=\"$2\">$2</a> " );
+	text = text.replace( /\[(?:member|property|method):([\w]+)\]/gi, "[member:$1 $1]" ); // [member:name] to [member:name title]
+	text = text.replace( /\[(?:member|property|method):([\w]+) ([\w\.\s]+)\]/gi, "<a href=\"javascript:window.parent.goTo('" + name + ".$2')\" target=\"_parent\" title=\"" + name + ".$2\" class=\"permalink\">#</a> .<a href=\"javascript:window.parent.goTo('$1')\" title=\"$1\" id=\"$2\">$2</a> " );
 
 
-	text = text.replace(/\[link:([\w|\:|\/|\.|\-|\_]+)\]/gi, "[link:$1 $1]" ); // [link:url] to [link:url title]
-	text = text.replace(/\[link:([\w|\:|\/|\.|\-|\_|\(|\)|\#]+) ([\w|\:|\/|\.|\-|\_|\s]+)\]/gi, "<a href=\"$1\"  target=\"_blank\">$2</a>" ); // [link:url title]
-	text = text.replace(/\*([\w|\d|\"|\-|\(][\w|\d|\ |\-|\/|\+|\-|\(|\)|\=|\,|\.\"]*[\w|\d|\"|\)]|\w)\*/gi, "<strong>$1</strong>" ); // *
+	text = text.replace( /\[link:([\w|\:|\/|\.|\-|\_]+)\]/gi, "[link:$1 $1]" ); // [link:url] to [link:url title]
+	text = text.replace( /\[link:([\w|\:|\/|\.|\-|\_|\(|\)|\#]+) ([\w|\:|\/|\.|\-|\_|\s]+)\]/gi, "<a href=\"$1\"  target=\"_blank\">$2</a>" ); // [link:url title]
+	text = text.replace( /\*([\w|\d|\"|\-|\(][\w|\d|\ |\-|\/|\+|\-|\(|\)|\=|\,|\.\"]*[\w|\d|\"|\)]|\w)\*/gi, "<strong>$1</strong>" ); // *
 
 
-	text = text.replace(/\[example:([\w\_]+)\]/gi, "[example:$1 $1]" ); // [example:name] to [example:name title]
-	text = text.replace(/\[example:([\w\_]+) ([\w\:\/\.\-\_ \s]+)\]/gi, "<a href=\"../../../../examples/#$1\"  target=\"_blank\">$2</a>" ); // [example:name title]
+	text = text.replace( /\[example:([\w\_]+)\]/gi, "[example:$1 $1]" ); // [example:name] to [example:name title]
+	text = text.replace( /\[example:([\w\_]+) ([\w\:\/\.\-\_ \s]+)\]/gi, "<a href=\"../examples/#$1\"  target=\"_blank\">$2</a>" ); // [example:name title]
 
 
 
 
 	document.body.innerHTML = text;
 	document.body.innerHTML = text;

+ 1 - 11
docs/scenes/geometry-browser.html

@@ -37,16 +37,6 @@
 		<script src="../../build/three.min.js"></script>
 		<script src="../../build/three.min.js"></script>
 		<script src='../../examples/js/libs/dat.gui.min.js'></script>
 		<script src='../../examples/js/libs/dat.gui.min.js'></script>
 		<script src="../../examples/js/controls/OrbitControls.js"></script>
 		<script src="../../examples/js/controls/OrbitControls.js"></script>
-		<script src="../../examples/js/geometries/TextGeometry.js"></script>
-		<script src="../../examples/js/utils/FontUtils.js"></script>
-		<script src="../../examples/fonts/gentilis_bold.typeface.js"></script>
-		<script src="../../examples/fonts/gentilis_regular.typeface.js"></script>
-		<script src="../../examples/fonts/optimer_bold.typeface.js"></script>
-		<script src="../../examples/fonts/optimer_regular.typeface.js"></script>
-		<script src="../../examples/fonts/helvetiker_bold.typeface.js"></script>
-		<script src="../../examples/fonts/helvetiker_regular.typeface.js"></script>
-		<script src="../../examples/fonts/droid/droid_serif_regular.typeface.js"></script>
-		<script src="../../examples/fonts/droid/droid_serif_bold.typeface.js"></script>
 
 
 		<script src='js/geometry.js'></script>
 		<script src='js/geometry.js'></script>
 
 
@@ -60,7 +50,7 @@
 			camera.position.z = 30;
 			camera.position.z = 30;
 
 
 			var renderer = new THREE.WebGLRenderer( { antialias: true } );
 			var renderer = new THREE.WebGLRenderer( { antialias: true } );
-			renderer.setPixelRatio( window.devicePixelRatio );			
+			renderer.setPixelRatio( window.devicePixelRatio );
 			renderer.setSize( window.innerWidth, window.innerHeight );
 			renderer.setSize( window.innerWidth, window.innerHeight );
 			document.body.appendChild( renderer.domElement );
 			document.body.appendChild( renderer.domElement );
 
 

+ 94 - 76
docs/scenes/js/geometry.js

@@ -77,17 +77,18 @@ var constants = {
 
 
 	}
 	}
 
 
-}
+};
 
 
 function updateGroupGeometry( mesh, geometry ) {
 function updateGroupGeometry( mesh, geometry ) {
 
 
-	mesh.children[0].geometry.dispose();
-	mesh.children[1].geometry.dispose();
+	mesh.children[ 0 ].geometry.dispose();
+	mesh.children[ 1 ].geometry.dispose();
+
+	mesh.children[ 0 ].geometry = new THREE.WireframeGeometry( geometry );
+	mesh.children[ 1 ].geometry = geometry;
 
 
-	mesh.children[0].geometry = new THREE.WireframeGeometry( geometry );
-	mesh.children[1].geometry = geometry;
+	// these do not update nicely together if shared
 
 
-	//these do not update nicely together if shared
 }
 }
 
 
 var guis = {
 var guis = {
@@ -113,16 +114,17 @@ var guis = {
 
 
 		}
 		}
 
 
-		var folder = gui.addFolder('THREE.BoxGeometry');
+		var folder = gui.addFolder( 'THREE.BoxGeometry' );
 
 
 		folder.add( data, 'width', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'width', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'height', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'height', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'depth', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'depth', 1, 30 ).onChange( generateGeometry );
-		folder.add( data, 'widthSegments', 1, 10 ).step(1).onChange( generateGeometry );
-		folder.add( data, 'heightSegments', 1, 10 ).step(1).onChange( generateGeometry );
-		folder.add( data, 'depthSegments', 1, 10 ).step(1).onChange( generateGeometry );
+		folder.add( data, 'widthSegments', 1, 10 ).step( 1 ).onChange( generateGeometry );
+		folder.add( data, 'heightSegments', 1, 10 ).step( 1 ).onChange( generateGeometry );
+		folder.add( data, 'depthSegments', 1, 10 ).step( 1 ).onChange( generateGeometry );
 
 
 		generateGeometry();
 		generateGeometry();
+
 	},
 	},
 
 
 	CylinderGeometry : function( mesh ) {
 	CylinderGeometry : function( mesh ) {
@@ -151,23 +153,24 @@ var guis = {
 					data.thetaStart,
 					data.thetaStart,
 					data.thetaLength
 					data.thetaLength
 				)
 				)
-			)
+			);
 
 
 		}
 		}
 
 
-		var folder = gui.addFolder('THREE.CylinderGeometry');
+		var folder = gui.addFolder( 'THREE.CylinderGeometry' );
 
 
 		folder.add( data, 'radiusTop', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'radiusTop', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'radiusBottom', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'radiusBottom', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'height', 1, 50 ).onChange( generateGeometry );
 		folder.add( data, 'height', 1, 50 ).onChange( generateGeometry );
-		folder.add( data, 'radiusSegments', 3, 64 ).step(1).onChange( generateGeometry );
-		folder.add( data, 'heightSegments', 1, 64 ).step(1).onChange( generateGeometry );
+		folder.add( data, 'radiusSegments', 3, 64 ).step( 1 ).onChange( generateGeometry );
+		folder.add( data, 'heightSegments', 1, 64 ).step( 1 ).onChange( generateGeometry );
 		folder.add( data, 'openEnded' ).onChange( generateGeometry );
 		folder.add( data, 'openEnded' ).onChange( generateGeometry );
 		folder.add( data, 'thetaStart', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'thetaStart', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'thetaLength', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'thetaLength', 0, twoPi ).onChange( generateGeometry );
 
 
 
 
 		generateGeometry();
 		generateGeometry();
+
 	},
 	},
 
 
 	CircleGeometry : function( mesh ) {
 	CircleGeometry : function( mesh ) {
@@ -189,14 +192,15 @@ var guis = {
 
 
 		}
 		}
 
 
-		var folder = gui.addFolder('THREE.CircleGeometry');
+		var folder = gui.addFolder( 'THREE.CircleGeometry' );
 
 
 		folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry );
 		folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry );
-		folder.add( data, 'segments', 0, 128 ).step(1).onChange( generateGeometry );
+		folder.add( data, 'segments', 0, 128 ).step( 1 ).onChange( generateGeometry );
 		folder.add( data, 'thetaStart', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'thetaStart', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'thetaLength', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'thetaLength', 0, twoPi ).onChange( generateGeometry );
 
 
 		generateGeometry();
 		generateGeometry();
+
 	},
 	},
 
 
 	DodecahedronGeometry : function() {
 	DodecahedronGeometry : function() {
@@ -212,16 +216,16 @@ var guis = {
 				new THREE.DodecahedronGeometry(
 				new THREE.DodecahedronGeometry(
 					data.radius, data.detail
 					data.radius, data.detail
 				)
 				)
-			)
+			);
 
 
 		}
 		}
 
 
-		var folder = gui.addFolder('THREE.DodecahedronGeometry');
+		var folder = gui.addFolder( 'THREE.DodecahedronGeometry' );
 
 
-		folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry )
-		folder.add( data, 'detail', 0, 5 ).step(1).onChange( generateGeometry )
+		folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry );
+		folder.add( data, 'detail', 0, 5 ).step( 1 ).onChange( generateGeometry );
 
 
-		generateGeometry()
+		generateGeometry();
 
 
 	},
 	},
 
 
@@ -238,16 +242,16 @@ var guis = {
 				new THREE.IcosahedronGeometry(
 				new THREE.IcosahedronGeometry(
 					data.radius, data.detail
 					data.radius, data.detail
 				)
 				)
-			)
+			);
 
 
 		}
 		}
 
 
-		var folder = gui.addFolder('THREE.IcosahedronGeometry');
+		var folder = gui.addFolder( 'THREE.IcosahedronGeometry' );
 
 
-		folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry )
-		folder.add( data, 'detail', 0, 5 ).step(1).onChange( generateGeometry )
+		folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry );
+		folder.add( data, 'detail', 0, 5 ).step( 1 ).onChange( generateGeometry );
 
 
-		generateGeometry()
+		generateGeometry();
 
 
 	},
 	},
 
 
@@ -264,16 +268,16 @@ var guis = {
 				new THREE.OctahedronGeometry(
 				new THREE.OctahedronGeometry(
 					data.radius, data.detail
 					data.radius, data.detail
 				)
 				)
-			)
+			);
 
 
 		}
 		}
 
 
-		var folder = gui.addFolder('THREE.OctahedronGeometry');
+		var folder = gui.addFolder( 'THREE.OctahedronGeometry' );
 
 
-		folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry )
-		folder.add( data, 'detail', 0, 5 ).step(1).onChange( generateGeometry )
+		folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry );
+		folder.add( data, 'detail', 0, 5 ).step( 1 ).onChange( generateGeometry );
 
 
-		generateGeometry()
+		generateGeometry();
 
 
 	},
 	},
 
 
@@ -296,14 +300,15 @@ var guis = {
 
 
 		}
 		}
 
 
-		var folder = gui.addFolder('THREE.PlaneGeometry');
+		var folder = gui.addFolder( 'THREE.PlaneGeometry' );
 
 
 		folder.add( data, 'width', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'width', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'height', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'height', 1, 30 ).onChange( generateGeometry );
-		folder.add( data, 'widthSegments', 1, 30 ).step(1).onChange( generateGeometry );
-		folder.add( data, 'heightSegments', 1, 30 ).step(1).onChange( generateGeometry );
+		folder.add( data, 'widthSegments', 1, 30 ).step( 1 ).onChange( generateGeometry );
+		folder.add( data, 'heightSegments', 1, 30 ).step( 1 ).onChange( generateGeometry );
 
 
 		generateGeometry();
 		generateGeometry();
+
 	},
 	},
 
 
 	RingGeometry : function( mesh ) {
 	RingGeometry : function( mesh ) {
@@ -327,16 +332,17 @@ var guis = {
 
 
 		}
 		}
 
 
-		var folder = gui.addFolder('THREE.RingGeometry');
+		var folder = gui.addFolder( 'THREE.RingGeometry' );
 
 
 		folder.add( data, 'innerRadius', 0, 30 ).onChange( generateGeometry );
 		folder.add( data, 'innerRadius', 0, 30 ).onChange( generateGeometry );
 		folder.add( data, 'outerRadius', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'outerRadius', 1, 30 ).onChange( generateGeometry );
-		folder.add( data, 'thetaSegments', 1, 30 ).step(1).onChange( generateGeometry );
-		folder.add( data, 'phiSegments', 1, 30 ).step(1).onChange( generateGeometry );
+		folder.add( data, 'thetaSegments', 1, 30 ).step( 1 ).onChange( generateGeometry );
+		folder.add( data, 'phiSegments', 1, 30 ).step( 1 ).onChange( generateGeometry );
 		folder.add( data, 'thetaStart', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'thetaStart', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'thetaLength', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'thetaLength', 0, twoPi ).onChange( generateGeometry );
 
 
 		generateGeometry();
 		generateGeometry();
+
 	},
 	},
 
 
 	SphereGeometry : function( mesh ) {
 	SphereGeometry : function( mesh ) {
@@ -361,17 +367,18 @@ var guis = {
 
 
 		}
 		}
 
 
-		var folder = gui.addFolder('THREE.SphereGeometry');
+		var folder = gui.addFolder( 'THREE.SphereGeometry' );
 
 
 		folder.add( data, 'radius', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'radius', 1, 30 ).onChange( generateGeometry );
-		folder.add( data, 'widthSegments', 3, 32 ).step(1).onChange( generateGeometry );
-		folder.add( data, 'heightSegments', 2, 32 ).step(1).onChange( generateGeometry );
+		folder.add( data, 'widthSegments', 3, 32 ).step( 1 ).onChange( generateGeometry );
+		folder.add( data, 'heightSegments', 2, 32 ).step( 1 ).onChange( generateGeometry );
 		folder.add( data, 'phiStart', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'phiStart', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'phiLength', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'phiLength', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'thetaStart', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'thetaStart', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'thetaLength', 0, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'thetaLength', 0, twoPi ).onChange( generateGeometry );
 
 
 		generateGeometry();
 		generateGeometry();
+
 	},
 	},
 
 
 	TetrahedronGeometry : function() {
 	TetrahedronGeometry : function() {
@@ -387,16 +394,16 @@ var guis = {
 				new THREE.TetrahedronGeometry(
 				new THREE.TetrahedronGeometry(
 					data.radius, data.detail
 					data.radius, data.detail
 				)
 				)
-			)
+			);
 
 
 		}
 		}
 
 
-		var folder = gui.addFolder('THREE.TetrahedronGeometry');
+		var folder = gui.addFolder( 'THREE.TetrahedronGeometry' );
 
 
-		folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry )
-		folder.add( data, 'detail', 0, 5 ).step(1).onChange( generateGeometry )
+		folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry );
+		folder.add( data, 'detail', 0, 5 ).step( 1 ).onChange( generateGeometry );
 
 
-		generateGeometry()
+		generateGeometry();
 
 
 	},
 	},
 
 
@@ -408,8 +415,7 @@ var guis = {
 			height : 2,
 			height : 2,
 			curveSegments : 12,
 			curveSegments : 12,
 			font : "helvetiker",
 			font : "helvetiker",
-			weight : "normal",
-			style : "normal",
+			weight : "regular",
 			bevelEnabled : false,
 			bevelEnabled : false,
 			bevelThickness : 1,
 			bevelThickness : 1,
 			bevelSize : 0.5
 			bevelSize : 0.5
@@ -419,40 +425,52 @@ var guis = {
 			"helvetiker",
 			"helvetiker",
 			"optimer",
 			"optimer",
 			"gentilis",
 			"gentilis",
-			"droid serif"
-		]
+			"droid/droid_serif"
+		];
 
 
 		var weights = [
 		var weights = [
-			"normal", "bold"
-		]
+			"regular", "bold"
+		];
 
 
 		function generateGeometry() {
 		function generateGeometry() {
 
 
-			var geometry = new THREE.TextGeometry( data.text, data )
+			var loader = new THREE.FontLoader();
+			loader.load( '../../examples/fonts/' + data.font + '_' + data.weight + '.typeface.js', function ( font ) {
+
+				var geometry = new THREE.TextGeometry( data.text, {
+					font: font,
+					size: data.size,
+					height: data.height,
+					curveSegments: data.curveSegments,
+					bevelEnabled: data.bevelEnabled,
+					bevelThickness: data.bevelThickness,
+					bevelSize: data.bevelSize
+				} );
+				geometry.center();
 
 
-			geometry.center()
+				updateGroupGeometry( mesh, geometry );
 
 
-			updateGroupGeometry( mesh, geometry );
+			} );
 
 
 		}
 		}
 
 
 		//Hide the wireframe
 		//Hide the wireframe
-		mesh.children[0].visible = false;
+		mesh.children[ 0 ].visible = false;
 
 
-		var folder = gui.addFolder('THREE.TextGeometry');
+		var folder = gui.addFolder( 'THREE.TextGeometry' );
 
 
 		folder.add( data, 'text' ).onChange( generateGeometry );
 		folder.add( data, 'text' ).onChange( generateGeometry );
 		folder.add( data, 'size', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'size', 1, 30 ).onChange( generateGeometry );
 		folder.add( data, 'height', 1, 20 ).onChange( generateGeometry );
 		folder.add( data, 'height', 1, 20 ).onChange( generateGeometry );
-		folder.add( data, 'curveSegments', 1, 20 ).step(1).onChange( generateGeometry );
+		folder.add( data, 'curveSegments', 1, 20 ).step( 1 ).onChange( generateGeometry );
 		folder.add( data, 'font', fonts ).onChange( generateGeometry );
 		folder.add( data, 'font', fonts ).onChange( generateGeometry );
 		folder.add( data, 'weight', weights ).onChange( generateGeometry );
 		folder.add( data, 'weight', weights ).onChange( generateGeometry );
-		// folder.add( data, 'style', 1, 1 ).onChange( generateGeometry );
 		folder.add( data, 'bevelEnabled' ).onChange( generateGeometry );
 		folder.add( data, 'bevelEnabled' ).onChange( generateGeometry );
 		folder.add( data, 'bevelThickness', 0.1, 3 ).onChange( generateGeometry );
 		folder.add( data, 'bevelThickness', 0.1, 3 ).onChange( generateGeometry );
 		folder.add( data, 'bevelSize', 0.1, 3 ).onChange( generateGeometry );
 		folder.add( data, 'bevelSize', 0.1, 3 ).onChange( generateGeometry );
 
 
 		generateGeometry();
 		generateGeometry();
+
 	},
 	},
 
 
 	TorusGeometry : function( mesh ) {
 	TorusGeometry : function( mesh ) {
@@ -471,16 +489,16 @@ var guis = {
 				new THREE.TorusGeometry(
 				new THREE.TorusGeometry(
 					data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc
 					data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc
 				)
 				)
-			)
+			);
 
 
 		}
 		}
 
 
-		var folder = gui.addFolder('THREE.TorusGeometry');
+		var folder = gui.addFolder( 'THREE.TorusGeometry' );
 
 
 		folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry );
 		folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry );
 		folder.add( data, 'tube', 0.1, 10 ).onChange( generateGeometry );
 		folder.add( data, 'tube', 0.1, 10 ).onChange( generateGeometry );
-		folder.add( data, 'radialSegments', 2, 30 ).step(1).onChange( generateGeometry );
-		folder.add( data, 'tubularSegments', 3, 200 ).step(1).onChange( generateGeometry );
+		folder.add( data, 'radialSegments', 2, 30 ).step( 1 ).onChange( generateGeometry );
+		folder.add( data, 'tubularSegments', 3, 200 ).step( 1 ).onChange( generateGeometry );
 		folder.add( data, 'arc', 0.1, twoPi ).onChange( generateGeometry );
 		folder.add( data, 'arc', 0.1, twoPi ).onChange( generateGeometry );
 
 
 		generateGeometry();
 		generateGeometry();
@@ -506,39 +524,39 @@ var guis = {
 					data.radius, data.tube, data.radialSegments, data.tubularSegments,
 					data.radius, data.tube, data.radialSegments, data.tubularSegments,
 					data.p, data.q, data.heightScale
 					data.p, data.q, data.heightScale
 				)
 				)
-			)
+			);
 
 
 		}
 		}
 
 
-		var folder = gui.addFolder('THREE.TorusGeometry');
+		var folder = gui.addFolder( 'THREE.TorusGeometry' );
 
 
-		folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry )
-		folder.add( data, 'tube', 0.1, 10 ).onChange( generateGeometry )
-		folder.add( data, 'radialSegments', 3, 300 ).step(1).onChange( generateGeometry )
-		folder.add( data, 'tubularSegments', 3, 20 ).step(1).onChange( generateGeometry )
-		folder.add( data, 'p', 1, 20 ).step(1).onChange( generateGeometry )
-		folder.add( data, 'q', 1, 20 ).step(1).onChange( generateGeometry )
-		folder.add( data, 'heightScale', 1, 20 ).onChange( generateGeometry )
+		folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry );
+		folder.add( data, 'tube', 0.1, 10 ).onChange( generateGeometry );
+		folder.add( data, 'radialSegments', 3, 300 ).step( 1 ).onChange( generateGeometry );
+		folder.add( data, 'tubularSegments', 3, 20 ).step( 1 ).onChange( generateGeometry );
+		folder.add( data, 'p', 1, 20 ).step( 1 ).onChange( generateGeometry );
+		folder.add( data, 'q', 1, 20 ).step( 1 ).onChange( generateGeometry );
+		folder.add( data, 'heightScale', 1, 20 ).onChange( generateGeometry );
 
 
-		generateGeometry()
+		generateGeometry();
 
 
 	}
 	}
 
 
-}
+};
 
 
 function chooseFromHash ( mesh ) {
 function chooseFromHash ( mesh ) {
 
 
-	var selectedGeometry = window.location.hash.substring(1) || "TorusGeometry";
+	var selectedGeometry = window.location.hash.substring( 1 ) || "TorusGeometry";
 
 
 	if ( guis[ selectedGeometry ] !== undefined ) {
 	if ( guis[ selectedGeometry ] !== undefined ) {
 
 
-	    guis[ selectedGeometry ]( mesh );
+		guis[ selectedGeometry ]( mesh );
 
 
 	}
 	}
 
 
 	if ( selectedGeometry === 'TextGeometry' ) {
 	if ( selectedGeometry === 'TextGeometry' ) {
 
 
-	    return { fixed : true };
+		return { fixed : true };
 
 
 	}
 	}
 
 

+ 3 - 3
docs/scenes/js/material.js

@@ -104,10 +104,10 @@ var envMaps = (function () {
 		path + 'pz' + format, path + 'nz' + format
 		path + 'pz' + format, path + 'nz' + format
 	];
 	];
 
 
-	var reflectionCube = THREE.ImageUtils.loadTextureCube( urls );
+	var reflectionCube = new THREE.CubeTextureLoader().load( urls );
 	reflectionCube.format = THREE.RGBFormat;
 	reflectionCube.format = THREE.RGBFormat;
 
 
-	var refractionCube = THREE.ImageUtils.loadTextureCube( urls );
+	var refractionCube = new THREE.CubeTextureLoader().load( urls );
 	refractionCube.mapping = THREE.CubeRefractionMapping;
 	refractionCube.mapping = THREE.CubeRefractionMapping;
 	refractionCube.format = THREE.RGBFormat;
 	refractionCube.format = THREE.RGBFormat;
 
 
@@ -125,7 +125,7 @@ var textureMaps = (function () {
 
 
 	return {
 	return {
 		none : null,
 		none : null,
-		grass : THREE.ImageUtils.loadTexture( "../../examples/textures/terrain/grasslight-thin.jpg" )
+		grass : new THREE.TextureLoader().load( "../../examples/textures/terrain/grasslight-thin.jpg" )
 	};
 	};
 
 
 })();
 })();

+ 5 - 1
editor/index.html

@@ -19,7 +19,8 @@
 		<script src="../examples/js/loaders/AMFLoader.js"></script>
 		<script src="../examples/js/loaders/AMFLoader.js"></script>
 		<script src="../examples/js/loaders/AWDLoader.js"></script>
 		<script src="../examples/js/loaders/AWDLoader.js"></script>
 		<script src="../examples/js/loaders/BabylonLoader.js"></script>
 		<script src="../examples/js/loaders/BabylonLoader.js"></script>
-		<script src="../examples/js/loaders/ColladaLoader.js"></script>
+		<script src="../examples/js/loaders/ColladaLoader2.js"></script>
+		<script src="../examples/js/loaders/FBXLoader.js"></script>
 		<script src="../examples/js/loaders/KMZLoader.js"></script>
 		<script src="../examples/js/loaders/KMZLoader.js"></script>
 		<script src="../examples/js/loaders/MD2Loader.js"></script>
 		<script src="../examples/js/loaders/MD2Loader.js"></script>
 		<script src="../examples/js/loaders/OBJLoader.js"></script>
 		<script src="../examples/js/loaders/OBJLoader.js"></script>
@@ -118,6 +119,7 @@
 		<script src="js/Sidebar.Geometry.TorusKnotGeometry.js"></script>
 		<script src="js/Sidebar.Geometry.TorusKnotGeometry.js"></script>
 		<script src="../examples/js/geometries/TeapotBufferGeometry.js"></script>
 		<script src="../examples/js/geometries/TeapotBufferGeometry.js"></script>
 		<script src="js/Sidebar.Geometry.TeapotBufferGeometry.js"></script>
 		<script src="js/Sidebar.Geometry.TeapotBufferGeometry.js"></script>
+		<script src="js/Sidebar.Geometry.LatheGeometry.js"></script>
 		<script src="js/Sidebar.Material.js"></script>
 		<script src="js/Sidebar.Material.js"></script>
 		<script src="js/Sidebar.Animation.js"></script>
 		<script src="js/Sidebar.Animation.js"></script>
 		<script src="js/Sidebar.Script.js"></script>
 		<script src="js/Sidebar.Script.js"></script>
@@ -147,6 +149,8 @@
 		<script src="js/commands/SetMaterialMapCommand.js"></script>
 		<script src="js/commands/SetMaterialMapCommand.js"></script>
 		<script src="js/commands/SetSceneCommand.js"></script>
 		<script src="js/commands/SetSceneCommand.js"></script>
 
 
+		<!-- <script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="qyqgfqd9j8z890t"></script> -->
+
 		<script>
 		<script>
 
 
 			window.URL = window.URL || window.webkitURL;
 			window.URL = window.URL || window.webkitURL;

+ 2 - 7
editor/js/Config.js

@@ -10,19 +10,14 @@ var Config = function () {
 		'autosave': true,
 		'autosave': true,
 		'theme': 'css/light.css',
 		'theme': 'css/light.css',
 
 
-		'project/history/stored': true,
 		'project/renderer': 'WebGLRenderer',
 		'project/renderer': 'WebGLRenderer',
 		'project/renderer/antialias': true,
 		'project/renderer/antialias': true,
 		'project/renderer/shadows': true,
 		'project/renderer/shadows': true,
 		'project/vr': false,
 		'project/vr': false,
 
 
+		'settings/history': false,
+
 		'ui/sidebar/animation/collapsed': true,
 		'ui/sidebar/animation/collapsed': true,
-		'ui/sidebar/geometry/collapsed': true,
-		'ui/sidebar/history/collapsed': true,
-		'ui/sidebar/material/collapsed': true,
-		'ui/sidebar/object3d/collapsed': false,
-		'ui/sidebar/project/collapsed': true,
-		'ui/sidebar/scene/collapsed': false,
 		'ui/sidebar/script/collapsed': true
 		'ui/sidebar/script/collapsed': true
 	};
 	};
 
 

+ 4 - 1
editor/js/Editor.js

@@ -6,7 +6,7 @@ var Editor = function () {
 
 
 	var SIGNALS = signals;
 	var SIGNALS = signals;
 
 
-	this.DEFAULT_CAMERA = new THREE.PerspectiveCamera( 50, 1, 1, 10000 );
+	this.DEFAULT_CAMERA = new THREE.PerspectiveCamera( 50, 1, 0.1, 10000 );
 	this.DEFAULT_CAMERA.name = 'Camera';
 	this.DEFAULT_CAMERA.name = 'Camera';
 	this.DEFAULT_CAMERA.position.set( 20, 10, 20 );
 	this.DEFAULT_CAMERA.position.set( 20, 10, 20 );
 	this.DEFAULT_CAMERA.lookAt( new THREE.Vector3() );
 	this.DEFAULT_CAMERA.lookAt( new THREE.Vector3() );
@@ -458,6 +458,9 @@ Editor.prototype = {
 		var camera = loader.parse( json.camera );
 		var camera = loader.parse( json.camera );
 
 
 		this.camera.copy( camera );
 		this.camera.copy( camera );
+		this.camera.aspect = this.DEFAULT_CAMERA.aspect;
+		this.camera.updateProjectionMatrix();
+
 		this.history.fromJSON( json.history );
 		this.history.fromJSON( json.history );
 		this.scripts = json.scripts;
 		this.scripts = json.scripts;
 
 

+ 2 - 2
editor/js/History.js

@@ -75,7 +75,7 @@ History.prototype = {
 		cmd.execute();
 		cmd.execute();
 		cmd.inMemory = true;
 		cmd.inMemory = true;
 
 
-		if ( this.config.getKey( 'project/history/stored' ) ) {
+		if ( this.config.getKey( 'settings/history' ) ) {
 
 
 			cmd.json = cmd.toJSON();	// serialize the cmd immediately after execution and append the json to the cmd
 			cmd.json = cmd.toJSON();	// serialize the cmd immediately after execution and append the json to the cmd
 
 
@@ -165,7 +165,7 @@ History.prototype = {
 		history.undos = [];
 		history.undos = [];
 		history.redos = [];
 		history.redos = [];
 
 
-		if ( ! this.config.getKey( 'project/history/stored' ) ) {
+		if ( ! this.config.getKey( 'settings/history' ) ) {
 
 
 			return history;
 			return history;
 
 

+ 26 - 17
editor/js/Loader.js

@@ -14,11 +14,19 @@ var Loader = function ( editor ) {
 		var filename = file.name;
 		var filename = file.name;
 		var extension = filename.split( '.' ).pop().toLowerCase();
 		var extension = filename.split( '.' ).pop().toLowerCase();
 
 
+		var reader = new FileReader();
+		reader.addEventListener( 'progress', function ( event ) {
+
+			var size = '(' + Math.floor( event.total / 1000 ).format() + ' KB)';
+			var progress = Math.floor( ( event.loaded / event.total ) * 100 ) + '%';
+			console.log( 'Loading', filename, size, progress );
+
+		} );
+
 		switch ( extension ) {
 		switch ( extension ) {
 
 
 			case 'amf':
 			case 'amf':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var loader = new THREE.AMFLoader();
 					var loader = new THREE.AMFLoader();
@@ -33,7 +41,6 @@ var Loader = function ( editor ) {
 
 
 			case 'awd':
 			case 'awd':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var loader = new THREE.AWDLoader();
 					var loader = new THREE.AWDLoader();
@@ -48,7 +55,6 @@ var Loader = function ( editor ) {
 
 
 			case 'babylon':
 			case 'babylon':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var contents = event.target.result;
 					var contents = event.target.result;
@@ -66,7 +72,6 @@ var Loader = function ( editor ) {
 
 
 			case 'babylonmeshdata':
 			case 'babylonmeshdata':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var contents = event.target.result;
 					var contents = event.target.result;
@@ -89,7 +94,6 @@ var Loader = function ( editor ) {
 
 
 			case 'ctm':
 			case 'ctm':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var data = new Uint8Array( event.target.result );
 					var data = new Uint8Array( event.target.result );
@@ -119,7 +123,6 @@ var Loader = function ( editor ) {
 
 
 			case 'dae':
 			case 'dae':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var contents = event.target.result;
 					var contents = event.target.result;
@@ -136,6 +139,22 @@ var Loader = function ( editor ) {
 
 
 				break;
 				break;
 
 
+			case 'fbx':
+
+				reader.addEventListener( 'load', function ( event ) {
+
+					var contents = event.target.result;
+
+					var loader = new THREE.FBXLoader();
+					var object = loader.parse( contents );
+
+					editor.execute( new AddObjectCommand( object ) );
+
+				}, false );
+				reader.readAsText( file );
+
+				break;
+
 			case 'js':
 			case 'js':
 			case 'json':
 			case 'json':
 
 
@@ -144,7 +163,6 @@ var Loader = function ( editor ) {
 			case '3obj':
 			case '3obj':
 			case '3scn':
 			case '3scn':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var contents = event.target.result;
 					var contents = event.target.result;
@@ -196,7 +214,6 @@ var Loader = function ( editor ) {
 
 
 			case 'kmz':
 			case 'kmz':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var loader = new THREE.KMZLoader();
 					var loader = new THREE.KMZLoader();
@@ -213,7 +230,6 @@ var Loader = function ( editor ) {
 
 
 			case 'md2':
 			case 'md2':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var contents = event.target.result;
 					var contents = event.target.result;
@@ -237,7 +253,6 @@ var Loader = function ( editor ) {
 
 
 			case 'obj':
 			case 'obj':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var contents = event.target.result;
 					var contents = event.target.result;
@@ -254,7 +269,6 @@ var Loader = function ( editor ) {
 
 
 			case 'playcanvas':
 			case 'playcanvas':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var contents = event.target.result;
 					var contents = event.target.result;
@@ -272,7 +286,6 @@ var Loader = function ( editor ) {
 
 
 			case 'ply':
 			case 'ply':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var contents = event.target.result;
 					var contents = event.target.result;
@@ -295,7 +308,6 @@ var Loader = function ( editor ) {
 
 
 			case 'stl':
 			case 'stl':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var contents = event.target.result;
 					var contents = event.target.result;
@@ -328,7 +340,6 @@ var Loader = function ( editor ) {
 			/*
 			/*
 			case 'utf8':
 			case 'utf8':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var contents = event.target.result;
 					var contents = event.target.result;
@@ -348,7 +359,6 @@ var Loader = function ( editor ) {
 
 
 			case 'vtk':
 			case 'vtk':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var contents = event.target.result;
 					var contents = event.target.result;
@@ -371,7 +381,6 @@ var Loader = function ( editor ) {
 
 
 			case 'wrl':
 			case 'wrl':
 
 
-				var reader = new FileReader();
 				reader.addEventListener( 'load', function ( event ) {
 				reader.addEventListener( 'load', function ( event ) {
 
 
 					var contents = event.target.result;
 					var contents = event.target.result;
@@ -442,7 +451,7 @@ var Loader = function ( editor ) {
 
 
 					if ( result.materials.length > 1 ) {
 					if ( result.materials.length > 1 ) {
 
 
-						material = new THREE.MeshFaceMaterial( result.materials );
+						material = new THREE.MultiMaterial( result.materials );
 
 
 					} else {
 					} else {
 
 

+ 35 - 2
editor/js/Menubar.Add.js

@@ -242,6 +242,39 @@ Menubar.Add = function ( editor ) {
 	options.add( option );
 	options.add( option );
 	*/
 	*/
 
 
+	// Lathe
+
+	var option = new UI.Row();
+	option.setClass( 'option' );
+	option.setTextContent( 'Lathe' );
+	option.onClick( function() {
+
+		var points = [
+			new THREE.Vector2( 0, 0 ),
+			new THREE.Vector2( 4, 0 ),
+			new THREE.Vector2( 3.5, 0.5 ),
+			new THREE.Vector2( 1, 0.75 ),
+			new THREE.Vector2( 0.8, 1 ),
+			new THREE.Vector2( 0.8, 4 ),
+			new THREE.Vector2( 1, 4.2 ),
+			new THREE.Vector2( 1.4, 4.8 ),
+			new THREE.Vector2( 2, 5 ),
+			new THREE.Vector2( 2.5, 5.4 ),
+			new THREE.Vector2( 3, 12 )
+		];
+		var segments = 20;
+		var phiStart = 0;
+		var phiLength = 2 * Math.PI;
+
+		var geometry = new THREE.LatheGeometry( points, segments, phiStart, phiLength );
+		var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial( { side: THREE.DoubleSide } ) );
+		mesh.name = 'Lathe ' + ( ++ meshCount );
+
+		editor.execute( new AddObjectCommand( mesh ) );
+
+	} );
+	options.add( option );
+
 	// Sprite
 	// Sprite
 
 
 	var option = new UI.Row();
 	var option = new UI.Row();
@@ -291,9 +324,9 @@ Menubar.Add = function ( editor ) {
 		var intensity = 1;
 		var intensity = 1;
 		var distance = 0;
 		var distance = 0;
 		var angle = Math.PI * 0.1;
 		var angle = Math.PI * 0.1;
-		var exponent = 10;
+		var penumbra = 0;
 
 
-		var light = new THREE.SpotLight( color, intensity, distance, angle, exponent );
+		var light = new THREE.SpotLight( color, intensity, distance, angle, penumbra );
 		light.name = 'SpotLight ' + ( ++ lightCount );
 		light.name = 'SpotLight ' + ( ++ lightCount );
 		light.target.name = 'SpotLight ' + ( lightCount ) + ' Target';
 		light.target.name = 'SpotLight ' + ( lightCount ) + ' Target';
 
 

+ 20 - 0
editor/js/Menubar.File.js

@@ -251,6 +251,26 @@ Menubar.File = function ( editor ) {
 	} );
 	} );
 	options.add( option );
 	options.add( option );
 
 
+	/*
+	// Publish (Dropbox)
+
+	var option = new UI.Row();
+	option.setClass( 'option' );
+	option.setTextContent( 'Publish (Dropbox)' );
+	option.onClick( function () {
+
+		var parameters = {
+			files: [
+				{ 'url': 'data:text/plain;base64,' + window.btoa( "Hello, World" ), 'filename': 'app/test.txt' }
+			]
+		};
+
+		Dropbox.save( parameters );
+
+	} );
+	options.add( option );
+	*/
+
 
 
 	//
 	//
 
 

+ 1 - 1
editor/js/Sidebar.Animation.js

@@ -36,7 +36,7 @@ Sidebar.Animation = function ( editor ) {
 
 
 				var material = child.material;
 				var material = child.material;
 
 
-				if ( material instanceof THREE.MeshFaceMaterial ) {
+				if ( material instanceof THREE.MultiMaterial ) {
 
 
 					for ( var i = 0; i < material.materials.length; i ++ ) {
 					for ( var i = 0; i < material.materials.length; i ++ ) {
 
 

+ 3 - 1
editor/js/Sidebar.Geometry.BufferGeometry.js

@@ -34,9 +34,11 @@ Sidebar.Geometry.BufferGeometry = function ( editor ) {
 
 
 			for ( var name in attributes ) {
 			for ( var name in attributes ) {
 
 
+				var attribute = attributes[ name ];
+
 				var panel = new UI.Row();
 				var panel = new UI.Row();
 				panel.add( new UI.Text( name ).setWidth( '90px' ) );
 				panel.add( new UI.Text( name ).setWidth( '90px' ) );
-				panel.add( new UI.Text( ( attributes[ name ].count ).format() ).setFontSize( '12px' ) );
+				panel.add( new UI.Text( ( attribute.count ).format() + ' (' + attribute.itemSize + ')' ).setFontSize( '12px' ) );
 				container.add( panel );
 				container.add( panel );
 
 
 			}
 			}

+ 141 - 0
editor/js/Sidebar.Geometry.LatheGeometry.js

@@ -0,0 +1,141 @@
+/**
+ * @author rfm1201
+ */
+
+Sidebar.Geometry.LatheGeometry = function( editor, object ) {
+
+	var signals = editor.signals;
+
+	var container = new UI.Row();
+
+	var parameters = object.geometry.parameters;
+
+	// segments
+
+	var segmentsRow = new UI.Row();
+	var segments = new UI.Integer( parameters.segments ).onChange( update );
+
+	segmentsRow.add( new UI.Text( 'Segments' ).setWidth( '90px' ) );
+	segmentsRow.add( segments );
+
+	container.add( segmentsRow );
+
+	// phiStart
+
+	var phiStartRow = new UI.Row();
+	var phiStart = new UI.Number( parameters.phiStart * 180 / Math.PI ).onChange( update );
+
+	phiStartRow.add( new UI.Text( 'Phi start (°)' ).setWidth( '90px' ) );
+	phiStartRow.add( phiStart );
+
+	container.add( phiStartRow );
+
+	// phiLength
+
+	var phiLengthRow = new UI.Row();
+	var phiLength = new UI.Number( parameters.phiLength * 180 / Math.PI ).onChange( update );
+
+	phiLengthRow.add( new UI.Text( 'Phi length (°)' ).setWidth( '90px' ) );
+	phiLengthRow.add( phiLength );
+
+	container.add( phiLengthRow );
+
+	// points
+
+	var lastPointIdx = 0;
+	var pointsUI = [];
+
+	var pointsRow = new UI.Row();
+	pointsRow.add( new UI.Text( 'Points' ).setWidth( '90px' ) );
+
+	var points = new UI.Span().setDisplay( 'inline-block' );
+	pointsRow.add( points );
+
+	var pointsList = new UI.Div();
+	points.add( pointsList );
+
+	for ( var i = 0; i < parameters.points.length; i ++ ) {
+
+		var point = parameters.points[ i ];
+		pointsList.add( createPointRow( point.x, point.y ) );
+
+	}
+
+	var addPointButton = new UI.Button( '+' ).onClick( function() {
+
+		var point = pointsUI[ pointsUI.length - 1 ];
+
+		pointsList.add( createPointRow( point.x.getValue(), point.y.getValue() ) );
+
+		update();
+
+	} );
+	points.add( addPointButton );
+
+	container.add( pointsRow );
+
+	//
+
+	function createPointRow( x, y ) {
+
+		var pointRow = new UI.Div();
+		var lbl = new UI.Text( lastPointIdx + 1 ).setWidth( '20px' );
+		var txtX = new UI.Number( x ).setRange( 0, Infinity ).setWidth( '40px' ).onChange( update );
+		var txtY = new UI.Number( y ).setWidth( '40px' ).onChange( update );
+		var idx = lastPointIdx;
+		var btn = new UI.Button( '-' ).onClick( function() {
+
+			deletePointRow( idx );
+
+		} );
+
+		pointsUI.push( { row: pointRow, lbl: lbl, x: txtX, y: txtY } );
+		lastPointIdx ++;
+		pointRow.add( lbl, txtX, txtY, btn );
+
+		return pointRow;
+
+	}
+
+	function deletePointRow( idx ) {
+
+		if ( ! pointsUI[ idx ] ) return;
+
+		pointsList.remove( pointsUI[ idx ].row );
+		pointsUI[ idx ] = null;
+
+		update();
+
+	}
+
+	function update() {
+
+		var points = [];
+		var count = 0;
+
+		for ( var i = 0; i < pointsUI.length; i ++ ) {
+
+			var pointUI = pointsUI[ i ];
+
+			if ( ! pointUI ) continue;
+
+			points.push( new THREE.Vector2( pointUI.x.getValue(), pointUI.y.getValue() ) );
+			count ++;
+			pointUI.lbl.setValue( count );
+
+		}
+
+		var geometry = new THREE.LatheGeometry(
+			points,
+			segments.getValue(),
+			phiStart.getValue() / 180 * Math.PI,
+			phiLength.getValue() / 180 * Math.PI
+		);
+
+		editor.execute( new SetGeometryCommand( object, geometry ) );
+
+	}
+
+	return container;
+
+};

+ 11 - 29
editor/js/Sidebar.History.js

@@ -11,25 +11,21 @@ Sidebar.History = function ( editor ) {
 
 
 	var history = editor.history;
 	var history = editor.history;
 
 
-	var container = new UI.CollapsiblePanel();
-	container.setCollapsed( editor.config.getKey( 'ui/sidebar/history/collapsed' ) );
-	container.onCollapsedChange( function ( boolean ) {
+	var container = new UI.Panel();
 
 
-		editor.config.setKey( 'ui/sidebar/history/collapsed', boolean );
+	container.add( new UI.Text( 'HISTORY' ) );
 
 
-	} );
-
-	container.addStatic( new UI.Text( 'HISTORY' ) );
+	//
 
 
-	// Checkbox 'Save History'
+	var persistent = new UI.THREE.Boolean( config.getKey( 'settings/history' ), 'persistent' );
+	persistent.setPosition( 'absolute' ).setRight( '8px' );
+	persistent.onChange( function () {
 
 
-	var saveHistorySpan = new UI.Span().setPosition( 'absolute' ).setRight( '8px' );
-	var saveHistoryCheckbox = new UI.Checkbox( config.getKey( 'project/history/stored' ) ).onChange( function () {
+		var value = this.getValue();
 
 
-		config.setKey( 'project/history/stored', this.getValue() );
-		var saveHistory = this.getValue();
+		config.setKey( 'settings/history', value );
 
 
-		if ( saveHistory ) {
+		if ( value ) {
 
 
 			alert( 'The history will be preserved across sessions.\nThis can have an impact on performance when working with textures.' );
 			alert( 'The history will be preserved across sessions.\nThis can have an impact on performance when working with textures.' );
 
 
@@ -44,18 +40,9 @@ Sidebar.History = function ( editor ) {
 		}
 		}
 
 
 	} );
 	} );
+	container.add( persistent );
 
 
-	saveHistorySpan.add( saveHistoryCheckbox );
-
-	saveHistorySpan.onClick( function ( event ) {
-
-		event.stopPropagation(); // Avoid panel collapsing
-
-	} );
-
-	container.addStatic( saveHistorySpan );
-
-	container.add( new UI.Break() );
+	container.add( new UI.Break(), new UI.Break() );
 
 
 	var ignoreObjectSelectedSignal = false;
 	var ignoreObjectSelectedSignal = false;
 
 
@@ -68,11 +55,6 @@ Sidebar.History = function ( editor ) {
 
 
 		ignoreObjectSelectedSignal = false;
 		ignoreObjectSelectedSignal = false;
 
 
-	} );
-	outliner.onDblClick( function () {
-
-		//editor.focusById( parseInt( outliner.getValue() ) );
-
 	} );
 	} );
 	container.add( outliner );
 	container.add( outliner );
 
 

+ 32 - 12
editor/js/Sidebar.Object.js

@@ -224,15 +224,15 @@ Sidebar.Object = function ( editor ) {
 
 
 	container.add( objectAngleRow );
 	container.add( objectAngleRow );
 
 
-	// exponent
+	// penumrba
 
 
-	var objectExponentRow = new UI.Row();
-	var objectExponent = new UI.Number().setRange( 0, Infinity ).onChange( update );
+	var objectPenumbraRow = new UI.Row();
+	var objectPenumbra = new UI.Number().setRange( 0, 1 ).onChange( update );
 
 
-	objectExponentRow.add( new UI.Text( 'Exponent' ).setWidth( '90px' ) );
-	objectExponentRow.add( objectExponent );
+	objectPenumbraRow.add( new UI.Text( 'Penumbra' ).setWidth( '90px' ) );
+	objectPenumbraRow.add( objectPenumbra );
 
 
-	container.add( objectExponentRow );
+	container.add( objectPenumbraRow );
 
 
 	// decay
 	// decay
 
 
@@ -256,6 +256,9 @@ Sidebar.Object = function ( editor ) {
 	var objectReceiveShadow = new UI.THREE.Boolean( false, 'receive' ).onChange( update );
 	var objectReceiveShadow = new UI.THREE.Boolean( false, 'receive' ).onChange( update );
 	objectShadowRow.add( objectReceiveShadow );
 	objectShadowRow.add( objectReceiveShadow );
 
 
+	var objectShadowRadius = new UI.Number( 1 ).onChange( update );
+	objectShadowRow.add( objectShadowRadius );
+
 	container.add( objectShadowRow );
 	container.add( objectShadowRow );
 
 
 	// visible
 	// visible
@@ -441,9 +444,9 @@ Sidebar.Object = function ( editor ) {
 
 
 			}
 			}
 
 
-			if ( object.exponent !== undefined && Math.abs( object.exponent - objectExponent.getValue() ) >= 0.01 ) {
+			if ( object.penumbra !== undefined && Math.abs( object.penumbra - objectPenumbra.getValue() ) >= 0.01 ) {
 
 
-				editor.execute( new SetValueCommand( object, 'exponent', objectExponent.getValue() ) );
+				editor.execute( new SetValueCommand( object, 'penumbra', objectPenumbra.getValue() ) );
 
 
 			}
 			}
 
 
@@ -476,6 +479,16 @@ Sidebar.Object = function ( editor ) {
 
 
 			}
 			}
 
 
+			if ( object.shadow !== undefined ) {
+
+				if ( object.shadow.radius !== objectShadowRadius.getValue() ) {
+
+					editor.execute( new SetValueCommand( object.shadow, 'radius', objectShadowRadius.getValue() ) );
+
+				}
+
+			}
+
 			try {
 			try {
 
 
 				var userData = JSON.parse( objectUserData.getValue() );
 				var userData = JSON.parse( objectUserData.getValue() );
@@ -507,10 +520,11 @@ Sidebar.Object = function ( editor ) {
 			'groundColor': objectGroundColorRow,
 			'groundColor': objectGroundColorRow,
 			'distance' : objectDistanceRow,
 			'distance' : objectDistanceRow,
 			'angle' : objectAngleRow,
 			'angle' : objectAngleRow,
-			'exponent' : objectExponentRow,
+			'penumbra' : objectPenumbraRow,
 			'decay' : objectDecayRow,
 			'decay' : objectDecayRow,
 			'castShadow' : objectShadowRow,
 			'castShadow' : objectShadowRow,
-			'receiveShadow' : objectReceiveShadow
+			'receiveShadow' : objectReceiveShadow,
+			'shadow': objectShadowRadius
 		};
 		};
 
 
 		for ( var property in properties ) {
 		for ( var property in properties ) {
@@ -665,9 +679,9 @@ Sidebar.Object = function ( editor ) {
 
 
 		}
 		}
 
 
-		if ( object.exponent !== undefined ) {
+		if ( object.penumbra !== undefined ) {
 
 
-			objectExponent.setValue( object.exponent );
+			objectPenumbra.setValue( object.penumbra );
 
 
 		}
 		}
 
 
@@ -689,6 +703,12 @@ Sidebar.Object = function ( editor ) {
 
 
 		}
 		}
 
 
+		if ( object.shadow !== undefined ) {
+
+			objectShadowRadius.setValue( object.shadow.radius );
+
+		}
+
 		objectVisible.setValue( object.visible );
 		objectVisible.setValue( object.visible );
 
 
 		try {
 		try {

+ 9 - 2
editor/js/Sidebar.Project.js

@@ -114,7 +114,14 @@ Sidebar.Project = function ( editor ) {
 		rendererPropertiesRow.setDisplay( type === 'WebGLRenderer' ? '' : 'none' );
 		rendererPropertiesRow.setDisplay( type === 'WebGLRenderer' ? '' : 'none' );
 
 
 		var renderer = new rendererTypes[ type ]( { antialias: antialias } );
 		var renderer = new rendererTypes[ type ]( { antialias: antialias } );
-		if ( shadows && renderer.shadowMap ) renderer.shadowMap.enabled = true;
+
+		if ( shadows && renderer.shadowMap ) {
+
+			renderer.shadowMap.enabled = true;
+			// renderer.shadowMap.type = THREE.PCFSoftShadowMap;
+
+		}
+
 		signals.rendererChanged.dispatch( renderer );
 		signals.rendererChanged.dispatch( renderer );
 
 
 	}
 	}
@@ -123,4 +130,4 @@ Sidebar.Project = function ( editor ) {
 
 
 	return container;
 	return container;
 
 
-}
+};

+ 5 - 0
editor/js/Viewport.js

@@ -507,6 +507,11 @@ var Viewport = function ( editor ) {
 
 
 	signals.windowResize.add( function () {
 	signals.windowResize.add( function () {
 
 
+		// TODO: Move this out?
+
+		editor.DEFAULT_CAMERA.aspect = container.dom.offsetWidth / container.dom.offsetHeight;
+		editor.DEFAULT_CAMERA.updateProjectionMatrix();
+
 		camera.aspect = container.dom.offsetWidth / container.dom.offsetHeight;
 		camera.aspect = container.dom.offsetWidth / container.dom.offsetHeight;
 		camera.updateProjectionMatrix();
 		camera.updateProjectionMatrix();
 
 

+ 8 - 1
editor/js/libs/app.js

@@ -27,7 +27,14 @@ var APP = {
 			renderer = new THREE.WebGLRenderer( { antialias: true } );
 			renderer = new THREE.WebGLRenderer( { antialias: true } );
 			renderer.setClearColor( 0x000000 );
 			renderer.setClearColor( 0x000000 );
 			renderer.setPixelRatio( window.devicePixelRatio );
 			renderer.setPixelRatio( window.devicePixelRatio );
-			if ( json.project.shadows ) renderer.shadowMap.enabled = true;
+
+			if ( json.project.shadows ) {
+
+				renderer.shadowMap.enabled = true;
+				// renderer.shadowMap.type = THREE.PCFSoftShadowMap;
+
+			}
+
 			this.dom = renderer.domElement;
 			this.dom = renderer.domElement;
 
 
 			this.setScene( loader.parse( json.scene ) );
 			this.setScene( loader.parse( json.scene ) );

+ 5 - 5
editor/js/libs/tern-threejs/threejs.js

@@ -368,7 +368,7 @@
         },
         },
         "materialIndex": {
         "materialIndex": {
           "!type": "number",
           "!type": "number",
-          "!doc": "Material index (points to [page:MeshFaceMaterial MeshFaceMaterial.materials])."
+          "!doc": "Material index (points to [page:MultiMaterial MultiMaterial.materials])."
         },
         },
         "clone": {
         "clone": {
           "!type": "fn() -> +THREE.Face3",
           "!type": "fn() -> +THREE.Face3",
@@ -960,7 +960,7 @@
       "prototype": {
       "prototype": {
         "createMultiMaterialObject": {
         "createMultiMaterialObject": {
           "!type": "fn(geometry: +THREE.Geometry, materials: []) -> +THREE.Object3D",
           "!type": "fn(geometry: +THREE.Geometry, materials: []) -> +THREE.Object3D",
-          "!doc": "Creates an new Object3D an new mesh for each material defined in materials. Beware that this is not the same as Meshfacematerial which defines multiple material for 1 mesh.<br>\n\t\tThis is mostly useful for object that need a material and a wireframe implementation."
+          "!doc": "Creates an new Object3D an new mesh for each material defined in materials. Beware that this is not the same as MultiMaterial which defines multiple material for 1 mesh.<br>\n\t\tThis is mostly useful for object that need a material and a wireframe implementation."
         },
         },
         "attach": {
         "attach": {
           "!type": "fn(child: +THREE.Object3D, scene: +THREE.Object3D, parent: +THREE.Object3D)",
           "!type": "fn(child: +THREE.Object3D, scene: +THREE.Object3D, parent: +THREE.Object3D)",
@@ -1618,7 +1618,7 @@
       "prototype": {
       "prototype": {
         "!proto": "THREE.Geometry.prototype"
         "!proto": "THREE.Geometry.prototype"
       },
       },
-      "!doc": "Class for generating meshes with axial symmetry. Possible uses include donuts, pipes, vases etc. The lathe rotate around the Z axis.",
+      "!doc": "Class for generating meshes with axial symmetry. Possible uses include donuts, pipes, vases etc. The lathe rotate around the Y axis.",
       "!type": "fn(points: [], segments: number, phiStart: number, phiLength: number)"
       "!type": "fn(points: [], segments: number, phiStart: number, phiLength: number)"
     },
     },
     "OctahedronGeometry": {
     "OctahedronGeometry": {
@@ -2839,8 +2839,8 @@
       "!doc": "A material for drawing geometry by depth. Depth is based off of the camera near and far plane. White is nearest, black is farthest.",
       "!doc": "A material for drawing geometry by depth. Depth is based off of the camera near and far plane. White is nearest, black is farthest.",
       "!type": "fn(parameters: object)"
       "!type": "fn(parameters: object)"
     },
     },
-    "MeshFaceMaterial": {
-      "!url": "http://threejs.org/docs/#Reference/materials/MeshFaceMaterial",
+    "MultiMaterial": {
+      "!url": "http://threejs.org/docs/#Reference/materials/MultiMaterial",
       "prototype": {
       "prototype": {
         "materials": {
         "materials": {
           "!type": "[]",
           "!type": "[]",

+ 6 - 1
editor/js/libs/ui.js

@@ -763,7 +763,7 @@ UI.Number = function ( number ) {
 
 
 		}
 		}
 
 
-		scope.setValue( parseFloat( value ) );
+		scope.setValue( value );
 
 
 	}
 	}
 
 
@@ -805,6 +805,11 @@ UI.Number.prototype.setValue = function ( value ) {
 
 
 	if ( value !== undefined ) {
 	if ( value !== undefined ) {
 
 
+		value = parseFloat( value );
+
+		if ( value < this.min ) value = this.min;
+		if ( value > this.max ) value = this.max;
+
 		this.value = value;
 		this.value = value;
 		this.dom.value = value.toFixed( this.precision );
 		this.dom.value = value.toFixed( this.precision );
 
 

+ 1 - 2
examples/canvas_ascii_effect.html

@@ -1,6 +1,5 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
-
 	<head>
 	<head>
 		<title>three.js - ASCII Effect</title>
 		<title>three.js - ASCII Effect</title>
 		<meta charset="utf-8">
 		<meta charset="utf-8">
@@ -71,7 +70,7 @@
 				light.position.set( - 500, - 500, - 500 );
 				light.position.set( - 500, - 500, - 500 );
 				scene.add( light );
 				scene.add( light );
 
 
-				sphere = new THREE.Mesh( new THREE.SphereGeometry( 200, 20, 10 ), new THREE.MeshLambertMaterial( { shading: THREE.FlatShading } ) );
+				sphere = new THREE.Mesh( new THREE.SphereGeometry( 200, 20, 10 ), new THREE.MeshLambertMaterial() );
 				scene.add( sphere );
 				scene.add( sphere );
 
 
 				// Plane
 				// Plane

+ 1 - 1
examples/canvas_camera_orthographic.html

@@ -74,7 +74,7 @@
 				// Cubes
 				// Cubes
 
 
 				var geometry = new THREE.BoxGeometry( 50, 50, 50 );
 				var geometry = new THREE.BoxGeometry( 50, 50, 50 );
-				var material = new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, overdraw: 0.5 } );
+				var material = new THREE.MeshLambertMaterial( { color: 0xffffff, overdraw: 0.5 } );
 
 
 				for ( var i = 0; i < 100; i ++ ) {
 				for ( var i = 0; i < 100; i ++ ) {
 
 

+ 1 - 1
examples/canvas_camera_orthographic2.html

@@ -143,7 +143,7 @@
 				// Cubes
 				// Cubes
 
 
 				var geometry = new THREE.BoxGeometry( 50, 50, 50 );
 				var geometry = new THREE.BoxGeometry( 50, 50, 50 );
-				var material = new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, overdraw: 0.5 } );
+				var material = new THREE.MeshLambertMaterial( { color: 0xffffff, overdraw: 0.5 } );
 
 
 				for ( var i = 0; i < 100; i ++ ) {
 				for ( var i = 0; i < 100; i ++ ) {
 
 

+ 0 - 149
examples/canvas_effects_stereo.html

@@ -1,149 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
-		<title>three.js canvas - effects - stereo</title>
-		<meta charset="utf-8">
-		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<style>
-			body {
-				background:#fff;
-				padding:0;
-				margin:0;
-				font-weight: bold;
-				overflow:hidden;
-			}
-		</style>
-	</head>
-	<body>
-
-		<script src="../build/three.min.js"></script>
-
-		<script src="js/effects/StereoEffect.js"></script>
-
-		<script src="js/renderers/Projector.js"></script>
-		<script src="js/renderers/CanvasRenderer.js"></script>
-
-		<script src="js/libs/stats.min.js"></script>
-
-		<script>
-
-			var container, stats;
-
-			var camera, scene, renderer;
-
-			var geometry, group;
-
-			var effect;
-
-			var mouseX = 0, mouseY = 0;
-
-			var windowHalfX = window.innerWidth / 2;
-			var windowHalfY = window.innerHeight / 2;
-
-			document.addEventListener( 'mousemove', onDocumentMouseMove, false );
-
-			init();
-			animate();
-
-			function init() {
-
-				container = document.createElement( 'div' );
-				document.body.appendChild( container );
-
-				camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 10000 );
-				camera.position.z = 500;
-
-				scene = new THREE.Scene();
-
-				var geometry = new THREE.BoxGeometry( 100, 100, 100 );
-				var material = new THREE.MeshNormalMaterial( { overdraw: 0.5 } );
-
-				group = new THREE.Group();
-
-				for ( var i = 0; i < 200; i ++ ) {
-
-					var mesh = new THREE.Mesh( geometry, material );
-					mesh.position.x = Math.random() * 2000 - 1000;
-					mesh.position.y = Math.random() * 2000 - 1000;
-					mesh.position.z = Math.random() * 2000 - 1000;
-					mesh.rotation.x = Math.random() * 2 * Math.PI;
-					mesh.rotation.y = Math.random() * 2 * Math.PI;
-					mesh.matrixAutoUpdate = false;
-					mesh.updateMatrix();
-					group.add( mesh );
-
-				}
-
-				scene.add( group );
-
-				renderer = new THREE.CanvasRenderer();
-				renderer.setClearColor( 0xffffff );
-				renderer.setPixelRatio( window.devicePixelRatio );
-				renderer.setSize( window.innerWidth, window.innerHeight );
-				container.appendChild( renderer.domElement );
-
-				effect = new THREE.StereoEffect( renderer );
-				effect.setSize( window.innerWidth, window.innerHeight );
-
-				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				stats.domElement.style.zIndex = 100;
-				container.appendChild( stats.domElement );
-
-				//
-
-				window.addEventListener( 'resize', onWindowResize, false );
-
-			}
-
-			function onWindowResize() {
-
-				windowHalfX = window.innerWidth / 2;
-				windowHalfY = window.innerHeight / 2;
-
-				camera.aspect = window.innerWidth / window.innerHeight;
-				camera.updateProjectionMatrix();
-
-				renderer.setSize( window.innerWidth, window.innerHeight );
-				effect.setSize( window.innerWidth, window.innerHeight );
-
-			}
-
-			function onDocumentMouseMove(event) {
-
-				mouseX = ( event.clientX - windowHalfX ) * 10;
-				mouseY = ( event.clientY - windowHalfY ) * 10;
-
-			}
-
-			//
-
-			function animate() {
-
-				requestAnimationFrame( animate );
-
-				render();
-				stats.update();
-
-			}
-
-			function render() {
-
-				camera.position.x += ( mouseX - camera.position.x ) * .05;
-				camera.position.y += ( - mouseY - camera.position.y ) * .05;
-				camera.lookAt( scene.position );
-
-				var currentSeconds = Date.now();
-				group.rotation.x = Math.sin( currentSeconds * 0.0007 ) * 0.5;
-				group.rotation.y = Math.sin( currentSeconds * 0.0003 ) * 0.5;
-				group.rotation.z = Math.sin( currentSeconds * 0.0002 ) * 0.5;
-
-				effect.render( scene, camera );
-
-			}
-
-		</script>
-
-	</body>
-</html>

+ 0 - 1
examples/canvas_geometry_nurbs.html

@@ -1,6 +1,5 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
-	<!-- based on canvas_geometry_shapes.html -->
 	<head>
 	<head>
 		<title>three.js canvas - geometry - NURBS</title>
 		<title>three.js canvas - geometry - NURBS</title>
 		<meta charset="utf-8">
 		<meta charset="utf-8">

+ 1 - 1
examples/canvas_geometry_panorama.html

@@ -81,7 +81,7 @@
 
 
 				];
 				];
 
 
-				mesh = new THREE.Mesh( new THREE.BoxGeometry( 300, 300, 300, 7, 7, 7 ), new THREE.MeshFaceMaterial( materials ) );
+				mesh = new THREE.Mesh( new THREE.BoxGeometry( 300, 300, 300, 7, 7, 7 ), new THREE.MultiMaterial( materials ) );
 				mesh.scale.x = - 1;
 				mesh.scale.x = - 1;
 				scene.add( mesh );
 				scene.add( mesh );
 
 

+ 1 - 1
examples/canvas_geometry_panorama_fisheye.html

@@ -81,7 +81,7 @@
 
 
 				];
 				];
 
 
-				mesh = new THREE.Mesh( new THREE.BoxGeometry( 300, 300, 300, 7, 7, 7 ), new THREE.MeshFaceMaterial( materials ) );
+				mesh = new THREE.Mesh( new THREE.BoxGeometry( 300, 300, 300, 7, 7, 7 ), new THREE.MultiMaterial( materials ) );
 				mesh.scale.x = - 1;
 				mesh.scale.x = - 1;
 				scene.add( mesh );
 				scene.add( mesh );
 
 

+ 23 - 21
examples/canvas_geometry_text.html

@@ -23,10 +23,6 @@
 
 
 		<script src="js/libs/stats.min.js"></script>
 		<script src="js/libs/stats.min.js"></script>
 
 
-		<script src="js/geometries/TextGeometry.js"></script>
-		<script src="js/utils/FontUtils.js"></script>
-		<script src="fonts/helvetiker_regular.typeface.js"></script>
-
 
 
 		<script>
 		<script>
 
 
@@ -34,7 +30,7 @@
 
 
 			var camera, scene, renderer;
 			var camera, scene, renderer;
 
 
-			var group, text;
+			var group;
 
 
 			var targetRotation = 0;
 			var targetRotation = 0;
 			var targetRotationOnMouseDown = 0;
 			var targetRotationOnMouseDown = 0;
@@ -45,10 +41,15 @@
 			var windowHalfX = window.innerWidth / 2;
 			var windowHalfX = window.innerWidth / 2;
 			var windowHalfY = window.innerHeight / 2;
 			var windowHalfY = window.innerHeight / 2;
 
 
-			init();
-			animate();
+			var loader = new THREE.FontLoader();
+			loader.load( 'fonts/helvetiker_regular.typeface.js', function ( font ) {
+
+				init( font );
+				animate();
 
 
-			function init() {
+			} );
+
+			function init( font ) {
 
 
 				container = document.createElement( 'div' );
 				container = document.createElement( 'div' );
 				document.body.appendChild( container );
 				document.body.appendChild( container );
@@ -78,34 +79,35 @@
 
 
 				}
 				}
 
 
-				var text3d = new THREE.TextGeometry( theText, {
+				var geometry = new THREE.TextGeometry( theText, {
 
 
+					font: font,
 					size: 80,
 					size: 80,
 					height: 20,
 					height: 20,
-					curveSegments: 2,
-					font: "helvetiker"
+					curveSegments: 2
 
 
 				});
 				});
 
 
-				text3d.computeBoundingBox();
-				var centerOffset = -0.5 * ( text3d.boundingBox.max.x - text3d.boundingBox.min.x );
+				geometry.computeBoundingBox();
+
+				var centerOffset = -0.5 * ( geometry.boundingBox.max.x - geometry.boundingBox.min.x );
 
 
-				var material = new THREE.MeshFaceMaterial( [
+				var material = new THREE.MultiMaterial( [
 					new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff, overdraw: 0.5 } ),
 					new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff, overdraw: 0.5 } ),
 					new THREE.MeshBasicMaterial( { color: 0x000000, overdraw: 0.5 } )
 					new THREE.MeshBasicMaterial( { color: 0x000000, overdraw: 0.5 } )
 				] );
 				] );
 
 
-				text = new THREE.Mesh( text3d, material );
+				var mesh = new THREE.Mesh( geometry, material );
 
 
-				text.position.x = centerOffset;
-				text.position.y = 100;
-				text.position.z = 0;
+				mesh.position.x = centerOffset;
+				mesh.position.y = 100;
+				mesh.position.z = 0;
 
 
-				text.rotation.x = 0;
-				text.rotation.y = Math.PI * 2;
+				mesh.rotation.x = 0;
+				mesh.rotation.y = Math.PI * 2;
 
 
 				group = new THREE.Group();
 				group = new THREE.Group();
-				group.add( text );
+				group.add( mesh );
 
 
 				scene.add( group );
 				scene.add( group );
 
 

+ 1 - 1
examples/canvas_lights_pointlights.html

@@ -94,7 +94,7 @@
 				loader = new THREE.JSONLoader();
 				loader = new THREE.JSONLoader();
 				loader.load( 'obj/WaltHeadLo.js', function ( geometry ) {
 				loader.load( 'obj/WaltHeadLo.js', function ( geometry ) {
 
 
-					mesh = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, overdraw: 0.5 } ) );
+					mesh = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: 0xffffff, overdraw: 0.5 } ) );
 					scene.add( mesh );
 					scene.add( mesh );
 
 
 				} );
 				} );

+ 12 - 5
examples/canvas_materials.html

@@ -67,15 +67,22 @@
 
 
 				var geometry = new THREE.SphereGeometry( 100, 14, 7 );
 				var geometry = new THREE.SphereGeometry( 100, 14, 7 );
 
 
+				var textureLoader = new THREE.TextureLoader();
+
+				var earthTexture = textureLoader.load( 'textures/land_ocean_ice_cloud_2048.jpg' );
+
+				var envMap = textureLoader.load( 'textures/envmap.png' );
+				envMap.mapping = THREE.SphericalReflectionMapping;
+
 				var materials = [
 				var materials = [
 
 
 					new THREE.MeshBasicMaterial( { color: 0x00ffff, wireframe: true, side: THREE.DoubleSide } ),
 					new THREE.MeshBasicMaterial( { color: 0x00ffff, wireframe: true, side: THREE.DoubleSide } ),
 					new THREE.MeshBasicMaterial( { color: 0xff0000, blending: THREE.AdditiveBlending } ),
 					new THREE.MeshBasicMaterial( { color: 0xff0000, blending: THREE.AdditiveBlending } ),
-					new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, overdraw: 0.5 } ),
-					new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.SmoothShading, overdraw: 0.5 } ),
+					new THREE.MeshLambertMaterial( { color: 0xffffff, overdraw: 0.5 } ),
+					new THREE.MeshLambertMaterial( { color: 0xffffff, overdraw: 0.5 } ),
 					new THREE.MeshNormalMaterial( { overdraw: 0.5 } ),
 					new THREE.MeshNormalMaterial( { overdraw: 0.5 } ),
-					new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/land_ocean_ice_cloud_2048.jpg' ) } ),
-					new THREE.MeshBasicMaterial( { envMap: THREE.ImageUtils.loadTexture( 'textures/envmap.png', THREE.SphericalReflectionMapping ), overdraw: 0.5 } )
+					new THREE.MeshBasicMaterial( { map: earthTexture } ),
+					new THREE.MeshBasicMaterial( { envMap: envMap, overdraw: 0.5 } )
 
 
 				];
 				];
 
 
@@ -86,7 +93,7 @@
 
 
 				}
 				}
 
 
-				materials.push( new THREE.MeshFaceMaterial( materials ) );
+				materials.push( new THREE.MultiMaterial( materials ) );
 
 
 				objects = [];
 				objects = [];
 
 

+ 4 - 1
examples/canvas_materials_reflection.html

@@ -67,7 +67,10 @@
 
 
 					geometry.computeVertexNormals();
 					geometry.computeVertexNormals();
 
 
-					mesh = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { envMap: THREE.ImageUtils.loadTexture( 'textures/metal.jpg', THREE.SphericalReflectionMapping ), overdraw: 0.5 } ) );
+					var envMap = new THREE.TextureLoader().load( 'textures/metal.jpg' );
+					envMap.mapping = THREE.SphericalReflectionMapping;
+
+					mesh = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { envMap: envMap, overdraw: 0.5 } ) );
 					scene.add( mesh );
 					scene.add( mesh );
 
 
 				} );
 				} );

+ 1 - 1
examples/canvas_performance.html

@@ -69,7 +69,7 @@
 				// Spheres
 				// Spheres
 
 
 				geometry = new THREE.SphereGeometry( 100, 26, 18 );
 				geometry = new THREE.SphereGeometry( 100, 26, 18 );
-				material = new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, overdraw: 0.5 } );
+				material = new THREE.MeshLambertMaterial( { color: 0xffffff, overdraw: 0.5 } );
 
 
 				for ( var i = 0; i < 20; i ++ ) {
 				for ( var i = 0; i < 20; i ++ ) {
 
 

+ 4 - 1
examples/canvas_sandbox.html

@@ -94,7 +94,10 @@
 
 
 				geometry = new THREE.IcosahedronGeometry( 100, 1 );
 				geometry = new THREE.IcosahedronGeometry( 100, 1 );
 
 
-				material = new THREE.MeshBasicMaterial( { envMap: THREE.ImageUtils.loadTexture( 'textures/metal.jpg', THREE.SphericalReflectionMapping ), overdraw: 0.5 } );
+				var envMap = new THREE.TextureLoader().load( 'textures/metal.jpg' );
+				envMap.mapping = THREE.SphericalReflectionMapping;
+
+				material = new THREE.MeshBasicMaterial( { envMap: envMap, overdraw: 0.5 } );
 
 
 				for ( var i = 0; i < 10; i ++ ) {
 				for ( var i = 0; i < 10; i ++ ) {
 
 

+ 1 - 1
examples/css3d_molecules.html

@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html>
 <html>
 	<head>
 	<head>
+		<title>three.js css3d - molecules</title>
 		<meta charset="utf-8">
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<title>three.js css3d - molecules</title>
 		<style>
 		<style>
 			html, body {
 			html, body {
 				height: 100%;
 				height: 100%;

+ 1 - 1
examples/css3d_panorama.html

@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html>
 <html>
 	<head>
 	<head>
+		<title>three.js css3d - panorama</title>
 		<meta charset="utf-8">
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<title>three.js css3d - panorama</title>
 		<style>
 		<style>
 			body {
 			body {
 				background-color: #000000;
 				background-color: #000000;

+ 1 - 1
examples/css3d_panorama_deviceorientation.html

@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html>
 <html>
 	<head>
 	<head>
+		<title>three.js css3d - panorama - deviceorientation</title>
 		<meta charset="utf-8">
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<title>three.js css3d - panorama - deviceorientation</title>
 		<style>
 		<style>
 			body {
 			body {
 				background-color: #000000;
 				background-color: #000000;

+ 1 - 1
examples/css3d_periodictable.html

@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html>
 <html>
 	<head>
 	<head>
+		<title>three.js css3d - periodic table</title>
 		<meta charset="utf-8">
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<title>three.js css3d - periodic table</title>
 		<style>
 		<style>
 			html, body {
 			html, body {
 				height: 100%;
 				height: 100%;

+ 1 - 0
examples/css3d_sandbox.html

@@ -2,6 +2,7 @@
 <html>
 <html>
 	<head>
 	<head>
 		<meta charset="utf-8">
 		<meta charset="utf-8">
+		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<style>
 		<style>
 			body {
 			body {
 				background-color: #ffffff;
 				background-color: #ffffff;

+ 1 - 1
examples/css3d_sprites.html

@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html>
 <html>
 	<head>
 	<head>
+		<title>three.js css3d - sprites</title>
 		<meta charset="utf-8">
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<title>three.js css3d - sprites</title>
 		<style>
 		<style>
 			html, body {
 			html, body {
 				height: 100%;
 				height: 100%;

File diff suppressed because it is too large
+ 8 - 58
examples/css3d_youtube.html


+ 11 - 13
examples/css3dstereo_periodictable.html

@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html>
 <html>
 	<head>
 	<head>
+		<title>three.js css3d stereo - periodic table</title>
 		<meta charset="utf-8">
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<title>three.js css3d stereo - periodic table</title>
 		<style>
 		<style>
 			html, body {
 			html, body {
 				height: 100%;
 				height: 100%;
@@ -66,7 +66,7 @@
 	<body>
 	<body>
 		<script src="../build/three.min.js"></script>
 		<script src="../build/three.min.js"></script>
 		<script src="js/libs/tween.min.js"></script>
 		<script src="js/libs/tween.min.js"></script>
-		<script src="js/controls/TrackballControls.js"></script>
+		<script src="js/controls/DeviceOrientationControls.js"></script>
 		<script src="js/renderers/CSS3DStereoRenderer.js"></script>
 		<script src="js/renderers/CSS3DStereoRenderer.js"></script>
 
 
 		<div id="container"></div>
 		<div id="container"></div>
@@ -196,7 +196,7 @@
 
 
 			var camera, scene, renderer;
 			var camera, scene, renderer;
 			var controls;
 			var controls;
-			
+
 			var state = 0;
 			var state = 0;
 
 
 			var objects = [];
 			var objects = [];
@@ -208,7 +208,7 @@
 			function init() {
 			function init() {
 
 
 				camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 10000 );
 				camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 10000 );
-				camera.position.z = 3000;
+				camera.position.z = 200;
 
 
 				scene = new THREE.Scene();
 				scene = new THREE.Scene();
 
 
@@ -323,11 +323,7 @@
 
 
 				//
 				//
 
 
-				controls = new THREE.TrackballControls( camera, renderer.domElement );
-				controls.rotateSpeed = 0.5;
-				controls.minDistance = 500;
-				controls.maxDistance = 6000;
-				controls.addEventListener( 'change', render );
+				controls = new THREE.DeviceOrientationControls( camera );
 
 
 				transform( targets.table, 5000 );
 				transform( targets.table, 5000 );
 
 
@@ -351,13 +347,13 @@
 					isFullscreen = true;
 					isFullscreen = true;
 
 
 				} else {
 				} else {
-				
+
 					document.webkitExitFullscreen();
 					document.webkitExitFullscreen();
-					
+
 					isFullscreen = false;
 					isFullscreen = false;
-				
+
 				}
 				}
-			
+
 			} );
 			} );
 
 
 			function transform( positions, duration ) {
 			function transform( positions, duration ) {
@@ -429,6 +425,8 @@
 
 
 				controls.update();
 				controls.update();
 
 
+				render();
+
 			}
 			}
 
 
 			function render() {
 			function render() {

+ 309 - 0
examples/files.js

@@ -0,0 +1,309 @@
+var files = {
+	"webgl": [
+		"webgl_animation_cloth",
+		"webgl_animation_scene",
+		"webgl_animation_skinning_blending",
+		"webgl_animation_skinning_morph",
+		"webgl_camera",
+		"webgl_camera_logarithmicdepthbuffer",
+		"webgl_decals",
+		"webgl_effects_anaglyph",
+		"webgl_effects_cardboard",
+		"webgl_effects_parallaxbarrier",
+		"webgl_effects_peppersghost",
+		"webgl_effects_stereo",
+		"webgl_exporter_obj",
+		"webgl_geometries",
+		"webgl_geometries2",
+		"webgl_geometry_colors",
+		"webgl_geometry_colors_blender",
+		"webgl_geometry_colors_lookuptable",
+		"webgl_geometry_convex",
+		"webgl_geometry_cube",
+		"webgl_geometry_dynamic",
+		"webgl_geometry_extrude_shapes",
+		"webgl_geometry_extrude_shapes2",
+		"webgl_geometry_extrude_splines",
+		"webgl_geometry_hierarchy",
+		"webgl_geometry_hierarchy2",
+		"webgl_geometry_large_mesh",
+		"webgl_geometry_minecraft",
+		"webgl_geometry_minecraft_ao",
+		"webgl_geometry_normals",
+		"webgl_geometry_nurbs",
+		"webgl_geometry_shapes",
+		"webgl_geometry_spline_editor",
+		"webgl_geometry_teapot",
+		"webgl_geometry_terrain",
+		"webgl_geometry_terrain_fog",
+		"webgl_geometry_terrain_raycast",
+		"webgl_geometry_text",
+		"webgl_geometry_text_earcut",
+		"webgl_geometry_text_pnltri",
+		"webgl_gpgpu_birds",
+		"webgl_gpu_particle_system",
+		"webgl_hdr",
+		"webgl_helpers",
+		"webgl_interactive_buffergeometry",
+		"webgl_interactive_cubes",
+		"webgl_interactive_cubes_gpu",
+		"webgl_interactive_instances_gpu",
+		"webgl_interactive_cubes_ortho",
+		"webgl_interactive_draggablecubes",
+		"webgl_interactive_lines",
+		"webgl_interactive_points",
+		"webgl_interactive_raycasting_points",
+		"webgl_interactive_voxelpainter",
+		"webgl_kinect",
+		"webgl_lensflares",
+		"webgl_lights_hemisphere",
+		"webgl_lights_pointlights",
+		"webgl_lights_pointlights2",
+		"webgl_lines_colors",
+		"webgl_lines_cubes",
+		"webgl_lines_dashed",
+		"webgl_lines_sphere",
+		"webgl_lines_splines",
+		"webgl_loader_3mf",
+		"webgl_loader_amf",
+		"webgl_loader_assimp2json",
+		"webgl_loader_awd",
+		"webgl_loader_babylon",
+		"webgl_loader_collada",
+		"webgl_loader_collada_keyframe",
+		"webgl_loader_collada_kinematics",
+		"webgl_loader_collada_skinning",
+		"webgl_loader_ctm",
+		"webgl_loader_ctm_materials",
+		"webgl_loader_fbx",
+		"webgl_loader_gltf",
+		"webgl_loader_json_blender",
+		"webgl_loader_json_claraio",
+		"webgl_loader_json_objconverter",
+		"webgl_loader_md2",
+		"webgl_loader_md2_control",
+		"webgl_loader_mmd",
+		"webgl_loader_mmd_pose",
+		"webgl_loader_mmd_audio",
+		"webgl_loader_msgpack",
+		"webgl_loader_obj",
+		"webgl_loader_obj_mtl",
+		"webgl_loader_pcd",
+		"webgl_loader_pdb",
+		"webgl_loader_ply",
+		"webgl_loader_sea3d",
+		"webgl_loader_sea3d_hierarchy",
+		"webgl_loader_sea3d_keyframe",
+		"webgl_loader_sea3d_morph",
+		"webgl_loader_sea3d_skinning",
+		"webgl_loader_sea3d_sound",
+		"webgl_loader_scene",
+		"webgl_loader_stl",
+		"webgl_loader_utf8",
+		"webgl_loader_vrml",
+		"webgl_loader_vtk",
+		"webgl_lod",
+		"webgl_marchingcubes",
+		"webgl_materials",
+		"webgl_materials_blending",
+		"webgl_materials_blending_custom",
+		"webgl_materials_bumpmap",
+		"webgl_materials_bumpmap_skin",
+		"webgl_materials_cars",
+		"webgl_materials_cubemap",
+		"webgl_materials_cubemap_balls_reflection",
+		"webgl_materials_cubemap_balls_refraction",
+		"webgl_materials_cubemap_dynamic",
+		"webgl_materials_cubemap_dynamic2",
+		"webgl_materials_cubemap_escher",
+		"webgl_materials_cubemap_refraction",
+		"webgl_materials_displacementmap",
+		"webgl_materials_envmaps",
+		"webgl_materials_grass",
+		"webgl_materials_lightmap",
+		"webgl_materials_nodes",
+		"webgl_materials_normalmap",
+		"webgl_materials_parallaxmap",
+		"webgl_materials_shaders_fresnel",
+		"webgl_materials_skin",
+		"webgl_materials_standard",
+		"webgl_materials_texture_anisotropy",
+		"webgl_materials_texture_compressed",
+		"webgl_materials_texture_filters",
+		"webgl_materials_texture_hdr",
+		"webgl_materials_texture_manualmipmap",
+		"webgl_materials_texture_pvrtc",
+		"webgl_materials_texture_tga",
+		"webgl_materials_variations_basic",
+		"webgl_materials_variations_lambert",
+		"webgl_materials_variations_phong",
+		"webgl_materials_variations_standard",
+		"webgl_materials_variations_standard2",
+		"webgl_materials_video",
+		"webgl_materials_wireframe",
+		"webgl_mirror",
+		"webgl_modifier_subdivision",
+		"webgl_modifier_tessellation",
+		"webgl_morphnormals",
+		"webgl_morphtargets",
+		"webgl_morphtargets_horse",
+		"webgl_morphtargets_human",
+		"webgl_multiple_canvases_circle",
+		"webgl_multiple_canvases_complex",
+		"webgl_multiple_canvases_grid",
+		"webgl_multiple_elements",
+		"webgl_multiple_elements_text",
+		"webgl_multiple_renderers",
+		"webgl_multiple_views",
+		"webgl_nearestneighbour",
+		"webgl_objects_update",
+		"webgl_octree",
+		"webgl_octree_raycasting",
+		"webgl_panorama_equirectangular",
+		"webgl_particles_general",
+		"webgl_performance",
+		"webgl_performance_doublesided",
+		"webgl_performance_static",
+		"webgl_points_billboards",
+		"webgl_points_billboards_colors",
+		"webgl_points_dynamic",
+		"webgl_points_random",
+		"webgl_points_sprites",
+		"webgl_postprocessing",
+		"webgl_postprocessing_advanced",
+		"webgl_postprocessing_crossfade",
+		"webgl_postprocessing_dof",
+		"webgl_postprocessing_dof2",
+		"webgl_postprocessing_glitch",
+		"webgl_postprocessing_godrays",
+		"webgl_postprocessing_masking",
+		"webgl_postprocessing_nodes",
+		"webgl_postprocessing_ssao",
+		"webgl_raycast_texture",
+		"webgl_read_float_buffer",
+		"webgl_rtt",
+		"webgl_sandbox",
+		"webgl_shader",
+		"webgl_shader_lava",
+		"webgl_shader2",
+		"webgl_shaders_ocean",
+		"webgl_shaders_ocean2",
+		"webgl_shaders_sky",
+		"webgl_shaders_tonemapping",
+		"webgl_shaders_vector",
+		"webgl_shading_physical",
+		"webgl_shadowmap",
+		"webgl_shadowmap_performance",
+		"webgl_shadowmap_pointlight",
+		"webgl_shadowmap_viewer",
+		"webgl_shadowmesh",
+		"webgl_skinning_simple",
+		"webgl_sprites",
+		"webgl_terrain_dynamic",
+		"webgl_test_memory",
+		"webgl_test_memory2",
+		"webgl_trails",
+		"webgl_video_panorama_equirectangular"
+	],
+	"webgl / advanced": [
+		"webgl_buffergeometry",
+		"webgl_buffergeometry_constructed_from_geometry",
+		"webgl_buffergeometry_custom_attributes_particles",
+		"webgl_buffergeometry_drawcalls",
+		"webgl_buffergeometry_instancing",
+		"webgl_buffergeometry_instancing_billboards",
+		"webgl_buffergeometry_instancing_dynamic",
+		"webgl_buffergeometry_instancing_interleaved_dynamic",
+		"webgl_buffergeometry_lines",
+		"webgl_buffergeometry_lines_indexed",
+		"webgl_buffergeometry_points",
+		"webgl_buffergeometry_rawshader",
+		"webgl_buffergeometry_selective_draw",
+		"webgl_buffergeometry_uint",
+		"webgl_custom_attributes",
+		"webgl_custom_attributes_lines",
+		"webgl_custom_attributes_points",
+		"webgl_custom_attributes_points2",
+		"webgl_custom_attributes_points3",
+		"webgl_raymarching_reflect"
+	],
+	"webvr": [
+		"webvr_cubes",
+		"webvr_video"
+	],
+	"css3d": [
+		"css3d_molecules",
+		"css3d_panorama",
+		"css3d_panorama_deviceorientation",
+		"css3d_periodictable",
+		"css3d_sandbox",
+		"css3d_sprites",
+		"css3d_youtube"
+	],
+	"css3d stereo": [
+		"css3dstereo_periodictable",
+	],
+	"misc": [
+		"misc_animation_authoring",
+		"misc_animation_keys",
+		"misc_controls_deviceorientation",
+		"misc_controls_fly",
+		"misc_controls_orbit",
+		"misc_controls_pointerlock",
+		"misc_controls_trackball",
+		"misc_controls_transform",
+		"misc_fps",
+		"misc_lights_test",
+		"misc_lookat",
+		"misc_sound",
+		"misc_ubiquity_test",
+		"misc_ubiquity_test2",
+		"misc_uv_tests"
+	],
+	"canvas": [
+		"canvas_ascii_effect",
+		"canvas_camera_orthographic",
+		"canvas_camera_orthographic2",
+		"canvas_geometry_birds",
+		"canvas_geometry_cube",
+		"canvas_geometry_earth",
+		"canvas_geometry_hierarchy",
+		"canvas_geometry_nurbs",
+		"canvas_geometry_panorama",
+		"canvas_geometry_panorama_fisheye",
+		"canvas_geometry_shapes",
+		"canvas_geometry_terrain",
+		"canvas_geometry_text",
+		"canvas_interactive_cubes",
+		"canvas_interactive_cubes_tween",
+		"canvas_interactive_particles",
+		"canvas_interactive_voxelpainter",
+		"canvas_lights_pointlights",
+		"canvas_lines",
+		"canvas_lines_colors",
+		"canvas_lines_colors_2d",
+		"canvas_lines_dashed",
+		"canvas_lines_sphere",
+		"canvas_materials",
+		"canvas_materials_normal",
+		"canvas_materials_reflection",
+		"canvas_materials_video",
+		"canvas_morphtargets_horse",
+		"canvas_particles_floor",
+		"canvas_particles_random",
+		"canvas_particles_sprites",
+		"canvas_particles_waves",
+		"canvas_performance",
+		"canvas_sandbox"
+	],
+	"raytracing": [
+		"raytracing_sandbox"
+	],
+	"software": [
+		"software_geometry_earth",
+		"software_sandbox"
+	],
+	"svg": [
+		"svg_sandbox"
+	]
+};

+ 22 - 316
examples/fonts/droid/droid_sans_bold.typeface.js

@@ -1,8 +1,8 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8">
 		<title>three.js / examples</title>
 		<title>three.js / examples</title>
+		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<style>
 		<style>
 
 
@@ -60,13 +60,14 @@
 			}
 			}
 
 
 				#panel #content {
 				#panel #content {
-					padding: 0px 20px;
+					padding: 0px 20px 20px 20px;
 				}
 				}
 
 
 				#panel #content .link {
 				#panel #content .link {
 					color: #2194CE;
 					color: #2194CE;
 					text-decoration: none;
 					text-decoration: none;
 					cursor: pointer;
 					cursor: pointer;
+					display: block;
 				}
 				}
 
 
 				#panel #content .selected {
 				#panel #content .selected {
@@ -185,311 +186,9 @@
 		</div>
 		</div>
 		<iframe id="viewer" allowfullscreen onmousewheel=""></iframe>
 		<iframe id="viewer" allowfullscreen onmousewheel=""></iframe>
 
 
+		<script src="files.js"></script>
 		<script>
 		<script>
 
 
-		var files = {
-			"webgl": [
-				"webgl_animation_cloth",
-				"webgl_animation_scene",
-				"webgl_animation_skinning_blending",
-				"webgl_animation_skinning_morph",
-				"webgl_camera",
-				"webgl_camera_logarithmicdepthbuffer",
-				"webgl_decals",
-				"webgl_effects_anaglyph",
-				"webgl_effects_parallaxbarrier",
-				"webgl_effects_peppersghost",
-				"webgl_effects_stereo",
-				"webgl_exporter_obj",
-				"webgl_geometries",
-				"webgl_geometries2",
-				"webgl_geometry_colors",
-				"webgl_geometry_colors_blender",
-				"webgl_geometry_colors_lookuptable",
-				"webgl_geometry_convex",
-				"webgl_geometry_cube",
-				"webgl_geometry_dynamic",
-				"webgl_geometry_extrude_shapes",
-				"webgl_geometry_extrude_shapes2",
-				"webgl_geometry_extrude_splines",
-				"webgl_geometry_hierarchy",
-				"webgl_geometry_hierarchy2",
-				"webgl_geometry_large_mesh",
-				"webgl_geometry_minecraft",
-				"webgl_geometry_minecraft_ao",
-				"webgl_geometry_normals",
-				"webgl_geometry_nurbs",
-				"webgl_geometry_shapes",
-				"webgl_geometry_spline_editor",
-				"webgl_geometry_teapot",
-				"webgl_geometry_terrain",
-				"webgl_geometry_terrain_fog",
-				"webgl_geometry_terrain_raycast",
-				"webgl_geometry_text",
-				"webgl_geometry_text_earcut",
-				"webgl_geometry_text_pnltri",
-				"webgl_gpgpu_birds",
-				"webgl_gpu_particle_system",
-				"webgl_hdr",
-				"webgl_helpers",
-				"webgl_interactive_buffergeometry",
-				"webgl_interactive_cubes",
-				"webgl_interactive_cubes_gpu",
-				"webgl_interactive_instances_gpu",
-				"webgl_interactive_cubes_ortho",
-				"webgl_interactive_draggablecubes",
-				"webgl_interactive_lines",
-				"webgl_interactive_points",
-				"webgl_interactive_raycasting_points",
-				"webgl_interactive_voxelpainter",
-				"webgl_kinect",
-				"webgl_lensflares",
-				"webgl_lights_hemisphere",
-				"webgl_lights_pointlights",
-				"webgl_lights_pointlights2",
-				"webgl_lines_colors",
-				"webgl_lines_cubes",
-				"webgl_lines_dashed",
-				"webgl_lines_sphere",
-				"webgl_lines_splines",
-				"webgl_loader_3mf",
-				"webgl_loader_amf",
-				"webgl_loader_assimp2json",
-				"webgl_loader_awd",
-				"webgl_loader_babylon",
-				"webgl_loader_collada",
-				"webgl_loader_collada_keyframe",
-				"webgl_loader_collada_kinematics",
-				"webgl_loader_collada_skinning",
-				"webgl_loader_ctm",
-				"webgl_loader_ctm_materials",
-				"webgl_loader_gltf",
-				"webgl_loader_json_blender",
-				"webgl_loader_json_claraio",
-				"webgl_loader_json_objconverter",
-				"webgl_loader_md2",
-				"webgl_loader_md2_control",
-				"webgl_loader_mmd",
-				"webgl_loader_mmd_pose",
-				"webgl_loader_mmd_audio",
-				"webgl_loader_msgpack",
-				"webgl_loader_obj",
-				"webgl_loader_obj_mtl",
-				"webgl_loader_pdb",
-				"webgl_loader_ply",
-				"webgl_loader_sea3d",
-				"webgl_loader_sea3d_hierarchy",
-				"webgl_loader_sea3d_keyframe",
-				"webgl_loader_sea3d_morph",
-				"webgl_loader_sea3d_skinning",
-				"webgl_loader_sea3d_sound",
-				"webgl_loader_scene",
-				"webgl_loader_stl",
-				"webgl_loader_utf8",
-				"webgl_loader_vrml",
-				"webgl_loader_vtk",
-				"webgl_lod",
-				"webgl_marchingcubes",
-				"webgl_materials",
-				"webgl_materials_blending",
-				"webgl_materials_blending_custom",
-				"webgl_materials_bumpmap",
-				"webgl_materials_bumpmap_skin",
-				"webgl_materials_cars",
-				"webgl_materials_cubemap",
-				"webgl_materials_cubemap_balls_reflection",
-				"webgl_materials_cubemap_balls_refraction",
-				"webgl_materials_cubemap_dynamic",
-				"webgl_materials_cubemap_dynamic2",
-				"webgl_materials_cubemap_escher",
-				"webgl_materials_cubemap_refraction",
-				"webgl_materials_displacementmap",
-				"webgl_materials_envmaps",
-				"webgl_materials_grass",
-				"webgl_materials_lightmap",
-				"webgl_materials_normalmap",
-				"webgl_materials_parallaxmap",
-				"webgl_materials_shaders_fresnel",
-				"webgl_materials_skin",
-				"webgl_materials_texture_anisotropy",
-				"webgl_materials_texture_compressed",
-				"webgl_materials_texture_filters",
-				"webgl_materials_texture_hdr",
-				"webgl_materials_texture_manualmipmap",
-				"webgl_materials_texture_pvrtc",
-				"webgl_materials_texture_tga",
-				"webgl_materials_variations_basic",
-				"webgl_materials_variations_lambert",
-				"webgl_materials_variations_phong",
-				"webgl_materials_variations_standard",
-				"webgl_materials_variations_standard2",
-				"webgl_materials_video",
-				"webgl_materials_wireframe",
-				"webgl_mirror",
-				"webgl_modifier_subdivision",
-				"webgl_modifier_tessellation",
-				"webgl_morphnormals",
-				"webgl_morphtargets",
-				"webgl_morphtargets_horse",
-				"webgl_morphtargets_human",
-				"webgl_multiple_canvases_circle",
-				"webgl_multiple_canvases_complex",
-				"webgl_multiple_canvases_grid",
-				"webgl_multiple_elements",
-				"webgl_multiple_renderers",
-				"webgl_multiple_views",
-				"webgl_nearestneighbour",
-				"webgl_objects_update",
-				"webgl_octree",
-				"webgl_octree_raycasting",
-				"webgl_panorama_equirectangular",
-				"webgl_performance",
-				"webgl_performance_doublesided",
-				"webgl_performance_static",
-				"webgl_points_billboards",
-				"webgl_points_billboards_colors",
-				"webgl_points_dynamic",
-				"webgl_points_random",
-				"webgl_points_sprites",
-				"webgl_postprocessing",
-				"webgl_postprocessing_advanced",
-				"webgl_postprocessing_crossfade",
-				"webgl_postprocessing_dof",
-				"webgl_postprocessing_dof2",
-				"webgl_postprocessing_glitch",
-				"webgl_postprocessing_godrays",
-				"webgl_postprocessing_ssao",
-				"webgl_raycast_texture",
-				"webgl_read_float_buffer",
-				"webgl_rtt",
-				"webgl_sandbox",
-				"webgl_shader",
-				"webgl_shader_lava",
-				"webgl_shader2",
-				"webgl_shaders_ocean",
-				"webgl_shaders_ocean2",
-				"webgl_shaders_sky",
-				"webgl_shaders_tonemapping",
-				"webgl_shaders_vector",
-				"webgl_shading_physical",
-				"webgl_shadowmap",
-				"webgl_shadowmap_performance",
-				"webgl_shadowmap_pointlight",
-				"webgl_shadowmap_viewer",
-				"webgl_shadowmesh",
-				"webgl_skinning_simple",
-				"webgl_sprites",
-				"webgl_terrain_dynamic",
-				"webgl_test_memory",
-				"webgl_test_memory2",
-				"webgl_trails",
-				"webgl_video_panorama_equirectangular"
-			],
-			"webgl / advanced": [
-				"webgl_buffergeometry",
-				"webgl_buffergeometry_constructed_from_geometry",
-				"webgl_buffergeometry_custom_attributes_particles",
-				"webgl_buffergeometry_drawcalls",
-				"webgl_buffergeometry_instancing",
-				"webgl_buffergeometry_instancing_billboards",
-				"webgl_buffergeometry_instancing_dynamic",
-				"webgl_buffergeometry_instancing_interleaved_dynamic",
-				"webgl_buffergeometry_lines",
-				"webgl_buffergeometry_lines_indexed",
-				"webgl_buffergeometry_points",
-				"webgl_buffergeometry_rawshader",
-				"webgl_buffergeometry_selective_draw",
-				"webgl_buffergeometry_uint",
-				"webgl_custom_attributes",
-				"webgl_custom_attributes_lines",
-				"webgl_custom_attributes_points",
-				"webgl_custom_attributes_points2",
-				"webgl_custom_attributes_points3"
-			],
-			"vr": [
-				"vr_cubes",
-				"vr_video"
-			],
-			"css3d": [
-				"css3d_molecules",
-				"css3d_panorama",
-				"css3d_panorama_deviceorientation",
-				"css3d_periodictable",
-				"css3d_sandbox",
-				"css3d_sprites",
-				"css3d_youtube"
-			],
-			"css3d stereo": [
-				"css3dstereo_periodictable",
-			],
-			"misc": [
-				"misc_animation_authoring",
-				"misc_animation_keys",
-				"misc_controls_deviceorientation",
-				"misc_controls_fly",
-				"misc_controls_orbit",
-				"misc_controls_pointerlock",
-				"misc_controls_trackball",
-				"misc_controls_transform",
-				"misc_fps",
-				"misc_lights_test",
-				"misc_lookat",
-				"misc_sound",
-				"misc_ubiquity_test",
-				"misc_ubiquity_test2",
-				"misc_uv_tests"
-			],
-			"canvas": [
-				"canvas_ascii_effect",
-				"canvas_camera_orthographic",
-				"canvas_camera_orthographic2",
-				"canvas_effects_stereo",
-				"canvas_geometry_birds",
-				"canvas_geometry_cube",
-				"canvas_geometry_earth",
-				"canvas_geometry_hierarchy",
-				"canvas_geometry_nurbs",
-				"canvas_geometry_panorama",
-				"canvas_geometry_panorama_fisheye",
-				"canvas_geometry_shapes",
-				"canvas_geometry_terrain",
-				"canvas_geometry_text",
-				"canvas_interactive_cubes",
-				"canvas_interactive_cubes_tween",
-				"canvas_interactive_particles",
-				"canvas_interactive_voxelpainter",
-				"canvas_lights_pointlights",
-				"canvas_lines",
-				"canvas_lines_colors",
-				"canvas_lines_colors_2d",
-				"canvas_lines_dashed",
-				"canvas_lines_sphere",
-				"canvas_materials",
-				"canvas_materials_normal",
-				"canvas_materials_reflection",
-				"canvas_materials_video",
-				"canvas_morphtargets_horse",
-				"canvas_particles_floor",
-				"canvas_particles_random",
-				"canvas_particles_sprites",
-				"canvas_particles_waves",
-				"canvas_performance",
-				"canvas_sandbox"
-			],
-			"raytracing": [
-				"raytracing_sandbox"
-			],
-			"software": [
-				"software_geometry_earth",
-				"software_sandbox"
-			],
-			"svg": [
-				"svg_sandbox"
-			]
-		};
-
-		//
-
 		var panel = document.getElementById( 'panel' );
 		var panel = document.getElementById( 'panel' );
 		var content = document.getElementById( 'content' );
 		var content = document.getElementById( 'content' );
 		var viewer = document.getElementById( 'viewer' );
 		var viewer = document.getElementById( 'viewer' );
@@ -530,7 +229,7 @@
 		button.style.display = 'none';
 		button.style.display = 'none';
 		document.body.appendChild( button );
 		document.body.appendChild( button );
 
 
-		var divs = {};
+		var links = {};
 		var selected = null;
 		var selected = null;
 
 
 		for ( var key in files ) {
 		for ( var key in files ) {
@@ -549,18 +248,25 @@
 					name.shift();
 					name.shift();
 					name = name.join( ' / ' );
 					name = name.join( ' / ' );
 
 
-					var div = document.createElement( 'div' );
-					div.className = 'link';
-					div.textContent = name;
-					div.addEventListener( 'click', function () {
+					var link = document.createElement( 'a' );
+					link.className = 'link';
+					link.textContent = name;
+					link.href = "#" + file;
+					link.addEventListener( 'click', function ( event ) {
+
+						if ( event.button === 0 ) {
+
+							event.preventDefault();
+
+							panel.classList.toggle( 'collapsed' );
+							load( file );
 
 
-						panel.classList.toggle( 'collapsed' );
-						load( file );
+						}
 
 
 					} );
 					} );
-					container.appendChild( div );
+					container.appendChild( link );
 
 
-					divs[ file ] = div;
+					links[ file ] = link;
 
 
 				} )( section[ i ] );
 				} )( section[ i ] );
 
 
@@ -570,9 +276,9 @@
 
 
 		var load = function ( file ) {
 		var load = function ( file ) {
 
 
-			if ( selected !== null ) divs[ selected ].className = 'link';
+			if ( selected !== null ) links[ selected ].className = 'link';
 
 
-			divs[ file ].className = 'link selected';
+			links[ file ].className = 'link selected';
 
 
 			window.location.hash = file;
 			window.location.hash = file;
 			viewer.src = file + '.html';
 			viewer.src = file + '.html';

+ 2 - 2
examples/js/Car.js

@@ -299,8 +299,8 @@ THREE.Car = function () {
 			var s = scope.modelScale,
 			var s = scope.modelScale,
 				delta = new THREE.Vector3();
 				delta = new THREE.Vector3();
 
 
-			var bodyFaceMaterial = new THREE.MeshFaceMaterial( scope.bodyMaterials );
-			var wheelFaceMaterial = new THREE.MeshFaceMaterial( scope.wheelMaterials );
+			var bodyFaceMaterial = new THREE.MultiMaterial( scope.bodyMaterials );
+			var wheelFaceMaterial = new THREE.MultiMaterial( scope.wheelMaterials );
 
 
 			// body
 			// body
 
 

+ 5 - 3
examples/js/GPUParticleSystem.js

@@ -83,7 +83,7 @@ THREE.GPUParticleSystem = function(options) {
       '{',
       '{',
       'const vec4 bit_shift = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);',
       'const vec4 bit_shift = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);',
       'const vec4 bit_mask  = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);',
       'const vec4 bit_mask  = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);',
-      'vec4 res = fract(depth * bit_shift);',
+      'vec4 res = mod(depth*bit_shift*vec4(255), vec4(256))/vec4(255);',
       'res -= res.xxyz * bit_mask;',
       'res -= res.xxyz * bit_mask;',
       'return res;',
       'return res;',
       '}',
       '}',
@@ -198,10 +198,12 @@ THREE.GPUParticleSystem = function(options) {
     return ++i >= self.rand.length ? self.rand[i = 1] : self.rand[i];
     return ++i >= self.rand.length ? self.rand[i = 1] : self.rand[i];
   }
   }
 
 
-  self.particleNoiseTex = THREE.ImageUtils.loadTexture("textures/perlin-512.png");
+  var textureLoader = new THREE.TextureLoader();
+
+  self.particleNoiseTex = textureLoader.load("textures/perlin-512.png");
   self.particleNoiseTex.wrapS = self.particleNoiseTex.wrapT = THREE.RepeatWrapping;
   self.particleNoiseTex.wrapS = self.particleNoiseTex.wrapT = THREE.RepeatWrapping;
 
 
-  self.particleSpriteTex = THREE.ImageUtils.loadTexture("textures/particle2.png");
+  self.particleSpriteTex = textureLoader.load("textures/particle2.png");
   self.particleSpriteTex.wrapS = self.particleSpriteTex.wrapT = THREE.RepeatWrapping;
   self.particleSpriteTex.wrapS = self.particleSpriteTex.wrapT = THREE.RepeatWrapping;
 
 
   self.particleShaderMat = new THREE.ShaderMaterial({
   self.particleShaderMat = new THREE.ShaderMaterial({

+ 5 - 4
examples/js/MD2Character.js

@@ -212,7 +212,7 @@ THREE.MD2Character = function () {
 			}
 			}
 
 
 		}
 		}
-			
+
 	}
 	}
 
 
 	this.update = function ( delta ) {
 	this.update = function ( delta ) {
@@ -223,12 +223,13 @@ THREE.MD2Character = function () {
 
 
 	function loadTextures( baseUrl, textureUrls ) {
 	function loadTextures( baseUrl, textureUrls ) {
 
 
-		var mapping = THREE.UVMapping;
+		var textureLoader = new THREE.TextureLoader();
 		var textures = [];
 		var textures = [];
 
 
 		for ( var i = 0; i < textureUrls.length; i ++ ) {
 		for ( var i = 0; i < textureUrls.length; i ++ ) {
 
 
-			textures[ i ] = THREE.ImageUtils.loadTexture( baseUrl + textureUrls[ i ], mapping, checkLoadingComplete );
+			textures[ i ] = textureLoader.load( baseUrl + textureUrls[ i ], checkLoadingComplete );
+			textures[ i ].mapping = THREE.UVMapping;
 			textures[ i ].name = textureUrls[ i ];
 			textures[ i ].name = textureUrls[ i ];
 
 
 		}
 		}
@@ -254,7 +255,7 @@ THREE.MD2Character = function () {
 
 
 		mesh.materialTexture = materialTexture;
 		mesh.materialTexture = materialTexture;
 		mesh.materialWireframe = materialWireframe;
 		mesh.materialWireframe = materialWireframe;
-	
+
 		return mesh;
 		return mesh;
 
 
 	}
 	}

+ 3 - 2
examples/js/MD2CharacterComplex.js

@@ -506,12 +506,13 @@ THREE.MD2CharacterComplex = function () {
 
 
 	function loadTextures( baseUrl, textureUrls ) {
 	function loadTextures( baseUrl, textureUrls ) {
 
 
-		var mapping = THREE.UVMapping;
+		var textureLoader = new THREE.TextureLoader();
 		var textures = [];
 		var textures = [];
 
 
 		for ( var i = 0; i < textureUrls.length; i ++ ) {
 		for ( var i = 0; i < textureUrls.length; i ++ ) {
 
 
-			textures[ i ] = THREE.ImageUtils.loadTexture( baseUrl + textureUrls[ i ], mapping, checkLoadingComplete );
+			textures[ i ] = textureLoader.load( baseUrl + textureUrls[ i ], checkLoadingComplete );
+			textures[ i ].mapping = THREE.UVMapping;
 			textures[ i ].name = textureUrls[ i ];
 			textures[ i ].name = textureUrls[ i ];
 
 
 		}
 		}

+ 5 - 7
examples/js/ShaderSkin.js

@@ -25,8 +25,8 @@ THREE.ShaderSkin = {
 		uniforms: THREE.UniformsUtils.merge( [
 		uniforms: THREE.UniformsUtils.merge( [
 
 
 			THREE.UniformsLib[ "fog" ],
 			THREE.UniformsLib[ "fog" ],
+			THREE.UniformsLib[ "ambient" ],
 			THREE.UniformsLib[ "lights" ],
 			THREE.UniformsLib[ "lights" ],
-			THREE.UniformsLib[ "shadowmap" ],
 
 
 			{
 			{
 
 
@@ -84,6 +84,7 @@ THREE.ShaderSkin = {
 
 
 			THREE.ShaderChunk[ "common" ],
 			THREE.ShaderChunk[ "common" ],
 			THREE.ShaderChunk[ "bsdfs" ],
 			THREE.ShaderChunk[ "bsdfs" ],
+			THREE.ShaderChunk[ "ambient_pars" ],
 			THREE.ShaderChunk[ "lights_pars" ],
 			THREE.ShaderChunk[ "lights_pars" ],
 			THREE.ShaderChunk[ "shadowmap_pars_fragment" ],
 			THREE.ShaderChunk[ "shadowmap_pars_fragment" ],
 			THREE.ShaderChunk[ "fog_pars_fragment" ],
 			THREE.ShaderChunk[ "fog_pars_fragment" ],
@@ -136,7 +137,6 @@ THREE.ShaderSkin = {
 
 
 				"vec3 outgoingLight = vec3( 0.0 );",	// outgoing light does not have an alpha, the surface does
 				"vec3 outgoingLight = vec3( 0.0 );",	// outgoing light does not have an alpha, the surface does
 				"vec4 diffuseColor = vec4( diffuse, opacity );",
 				"vec4 diffuseColor = vec4( diffuse, opacity );",
-				"vec3 shadowMask = vec3( 1.0 );",
 
 
 				"vec4 colDiffuse = texture2D( tDiffuse, vUv );",
 				"vec4 colDiffuse = texture2D( tDiffuse, vUv );",
 				"colDiffuse.rgb *= colDiffuse.rgb;",
 				"colDiffuse.rgb *= colDiffuse.rgb;",
@@ -245,11 +245,6 @@ THREE.ShaderSkin = {
 
 
 				"#endif",
 				"#endif",
 
 
-				THREE.ShaderChunk[ "shadowmap_fragment" ],
-
-				"totalDiffuseLight *= shadowMask;",
-				"totalSpecularLight *= shadowMask;",
-
 				"outgoingLight += diffuseColor.xyz * ( totalDiffuseLight + ambientLightColor * diffuse ) + totalSpecularLight;",
 				"outgoingLight += diffuseColor.xyz * ( totalDiffuseLight + ambientLightColor * diffuse ) + totalSpecularLight;",
 
 
 				THREE.ShaderChunk[ "linear_to_gamma_fragment" ],
 				THREE.ShaderChunk[ "linear_to_gamma_fragment" ],
@@ -272,6 +267,7 @@ THREE.ShaderSkin = {
 			"varying vec3 vViewPosition;",
 			"varying vec3 vViewPosition;",
 
 
 			THREE.ShaderChunk[ "common" ],
 			THREE.ShaderChunk[ "common" ],
+			THREE.ShaderChunk[ "lights_pars" ],
 			THREE.ShaderChunk[ "shadowmap_pars_vertex" ],
 			THREE.ShaderChunk[ "shadowmap_pars_vertex" ],
 
 
 			"void main() {",
 			"void main() {",
@@ -315,6 +311,7 @@ THREE.ShaderSkin = {
 		uniforms: THREE.UniformsUtils.merge( [
 		uniforms: THREE.UniformsUtils.merge( [
 
 
 			THREE.UniformsLib[ "fog" ],
 			THREE.UniformsLib[ "fog" ],
+			THREE.UniformsLib[ "ambient" ],
 			THREE.UniformsLib[ "lights" ],
 			THREE.UniformsLib[ "lights" ],
 
 
 			{
 			{
@@ -373,6 +370,7 @@ THREE.ShaderSkin = {
 			"varying vec3 vViewPosition;",
 			"varying vec3 vViewPosition;",
 
 
 			THREE.ShaderChunk[ "common" ],
 			THREE.ShaderChunk[ "common" ],
+			THREE.ShaderChunk[ "ambient_pars" ],
 			THREE.ShaderChunk[ "lights_pars" ],
 			THREE.ShaderChunk[ "lights_pars" ],
 			THREE.ShaderChunk[ "fog_pars_fragment" ],
 			THREE.ShaderChunk[ "fog_pars_fragment" ],
 
 

+ 2 - 4
examples/js/ShaderTerrain.js

@@ -18,8 +18,8 @@ THREE.ShaderTerrain = {
 		uniforms: THREE.UniformsUtils.merge( [
 		uniforms: THREE.UniformsUtils.merge( [
 
 
 			THREE.UniformsLib[ "fog" ],
 			THREE.UniformsLib[ "fog" ],
+			THREE.UniformsLib[ "ambient" ],
 			THREE.UniformsLib[ "lights" ],
 			THREE.UniformsLib[ "lights" ],
-			THREE.UniformsLib[ "shadowmap" ],
 
 
 			{
 			{
 
 
@@ -84,12 +84,11 @@ THREE.ShaderTerrain = {
 			"varying vec3 vNormal;",
 			"varying vec3 vNormal;",
 			"varying vec2 vUv;",
 			"varying vec2 vUv;",
 
 
-			"uniform vec3 ambientLightColor;",
-
 			"varying vec3 vViewPosition;",
 			"varying vec3 vViewPosition;",
 
 
 			THREE.ShaderChunk[ "common" ],
 			THREE.ShaderChunk[ "common" ],
 			THREE.ShaderChunk[ "bsdfs" ],
 			THREE.ShaderChunk[ "bsdfs" ],
+			THREE.ShaderChunk[ "ambient_pars" ],
 			THREE.ShaderChunk[ "lights_pars" ],
 			THREE.ShaderChunk[ "lights_pars" ],
 			THREE.ShaderChunk[ "shadowmap_pars_fragment" ],
 			THREE.ShaderChunk[ "shadowmap_pars_fragment" ],
 			THREE.ShaderChunk[ "fog_pars_fragment" ],
 			THREE.ShaderChunk[ "fog_pars_fragment" ],
@@ -232,7 +231,6 @@ THREE.ShaderTerrain = {
 
 
 				"outgoingLight += diffuseColor.xyz * ( totalDiffuseLight + ambientLightColor + totalSpecularLight );",
 				"outgoingLight += diffuseColor.xyz * ( totalDiffuseLight + ambientLightColor + totalSpecularLight );",
 
 
-				THREE.ShaderChunk[ "shadowmap_fragment" ],
 				THREE.ShaderChunk[ "linear_to_gamma_fragment" ],
 				THREE.ShaderChunk[ "linear_to_gamma_fragment" ],
 				THREE.ShaderChunk[ "fog_fragment" ],
 				THREE.ShaderChunk[ "fog_fragment" ],
 
 

+ 22 - 21
examples/js/UCSCharacter.js

@@ -1,16 +1,16 @@
 THREE.UCSCharacter = function() {
 THREE.UCSCharacter = function() {
 
 
 	var scope = this;
 	var scope = this;
-	
+
 	var mesh;
 	var mesh;
 
 
 	this.scale = 1;
 	this.scale = 1;
 
 
 	this.root = new THREE.Object3D();
 	this.root = new THREE.Object3D();
-	
+
 	this.numSkins;
 	this.numSkins;
 	this.numMorphs;
 	this.numMorphs;
-	
+
 	this.skins = [];
 	this.skins = [];
 	this.materials = [];
 	this.materials = [];
 	this.morphs = [];
 	this.morphs = [];
@@ -18,24 +18,24 @@ THREE.UCSCharacter = function() {
 	this.mixer = new THREE.AnimationMixer( this.root );
 	this.mixer = new THREE.AnimationMixer( this.root );
 
 
 	this.onLoadComplete = function () {};
 	this.onLoadComplete = function () {};
-	
+
 	this.loadCounter = 0;
 	this.loadCounter = 0;
 
 
 	this.loadParts = function ( config ) {
 	this.loadParts = function ( config ) {
-		
+
 		this.numSkins = config.skins.length;
 		this.numSkins = config.skins.length;
 		this.numMorphs = config.morphs.length;
 		this.numMorphs = config.morphs.length;
-		
+
 		// Character geometry + number of skins
 		// Character geometry + number of skins
 		this.loadCounter = 1 + config.skins.length;
 		this.loadCounter = 1 + config.skins.length;
-		
+
 		// SKINS
 		// SKINS
 		this.skins = loadTextures( config.baseUrl + "skins/", config.skins );
 		this.skins = loadTextures( config.baseUrl + "skins/", config.skins );
 		this.materials = createMaterials( this.skins );
 		this.materials = createMaterials( this.skins );
-		
+
 		// MORPHS
 		// MORPHS
 		this.morphs = config.morphs;
 		this.morphs = config.morphs;
-		
+
 		// CHARACTER
 		// CHARACTER
 		var loader = new THREE.JSONLoader();
 		var loader = new THREE.JSONLoader();
 		console.log( config.baseUrl + config.character );
 		console.log( config.baseUrl + config.character );
@@ -43,11 +43,11 @@ THREE.UCSCharacter = function() {
 
 
 			geometry.computeBoundingBox();
 			geometry.computeBoundingBox();
 			geometry.computeVertexNormals();
 			geometry.computeVertexNormals();
-			
-			mesh = new THREE.SkinnedMesh( geometry, new THREE.MeshFaceMaterial() );
+
+			mesh = new THREE.SkinnedMesh( geometry, new THREE.MultiMaterial() );
 			mesh.name = config.character;
 			mesh.name = config.character;
 			scope.root.add( mesh );
 			scope.root.add( mesh );
-			
+
 			var bb = geometry.boundingBox;
 			var bb = geometry.boundingBox;
 			scope.root.scale.set( config.s, config.s, config.s );
 			scope.root.scale.set( config.s, config.s, config.s );
 			scope.root.position.set( config.x, config.y - bb.min.y * config.s, config.z );
 			scope.root.position.set( config.x, config.y - bb.min.y * config.s, config.z );
@@ -56,15 +56,15 @@ THREE.UCSCharacter = function() {
 			mesh.receiveShadow = true;
 			mesh.receiveShadow = true;
 
 
 			scope.mixer.clipAction( geometry.animations[0], mesh ).play();
 			scope.mixer.clipAction( geometry.animations[0], mesh ).play();
-			
+
 			scope.setSkin( 0 );
 			scope.setSkin( 0 );
-			
+
 			scope.checkLoadComplete();
 			scope.checkLoadComplete();
 
 
 		} );
 		} );
 
 
 	};
 	};
-	
+
 	this.setSkin = function( index ) {
 	this.setSkin = function( index ) {
 
 
 		if ( mesh && scope.materials ) {
 		if ( mesh && scope.materials ) {
@@ -74,7 +74,7 @@ THREE.UCSCharacter = function() {
 		}
 		}
 
 
 	};
 	};
-	
+
 	this.updateMorphs = function( influences ) {
 	this.updateMorphs = function( influences ) {
 
 
 		if ( mesh ) {
 		if ( mesh ) {
@@ -88,15 +88,16 @@ THREE.UCSCharacter = function() {
 		}
 		}
 
 
 	};
 	};
-	
+
 	function loadTextures( baseUrl, textureUrls ) {
 	function loadTextures( baseUrl, textureUrls ) {
 
 
-		var mapping = THREE.UVMapping;
+		var textureLoader = new THREE.TextureLoader();
 		var textures = [];
 		var textures = [];
 
 
 		for ( var i = 0; i < textureUrls.length; i ++ ) {
 		for ( var i = 0; i < textureUrls.length; i ++ ) {
 
 
-			textures[ i ] = THREE.ImageUtils.loadTexture( baseUrl + textureUrls[ i ], mapping, scope.checkLoadComplete );
+			textures[ i ] = textureLoader.load( baseUrl + textureUrls[ i ], scope.checkLoadingComplete );
+			textures[ i ].mapping = THREE.UVMapping;
 			textures[ i ].name = textureUrls[ i ];
 			textures[ i ].name = textureUrls[ i ];
 
 
 		}
 		}
@@ -108,7 +109,7 @@ THREE.UCSCharacter = function() {
 	function createMaterials( skins ) {
 	function createMaterials( skins ) {
 
 
 		var materials = [];
 		var materials = [];
-		
+
 		for ( var i = 0; i < skins.length; i ++ ) {
 		for ( var i = 0; i < skins.length; i ++ ) {
 
 
 			materials[ i ] = new THREE.MeshLambertMaterial( {
 			materials[ i ] = new THREE.MeshLambertMaterial( {
@@ -120,7 +121,7 @@ THREE.UCSCharacter = function() {
 			} );
 			} );
 
 
 		}
 		}
-		
+
 		return materials;
 		return materials;
 
 
 	}
 	}

+ 31 - 31
examples/js/WaterShader.js

@@ -10,7 +10,7 @@
 THREE.ShaderLib[ 'water' ] = {
 THREE.ShaderLib[ 'water' ] = {
 
 
 	uniforms: THREE.UniformsUtils.merge( [
 	uniforms: THREE.UniformsUtils.merge( [
-		THREE.UniformsLib[ "fog" ], { 
+		THREE.UniformsLib[ "fog" ], {
 			"normalSampler":    { type: "t", value: null },
 			"normalSampler":    { type: "t", value: null },
 			"mirrorSampler":    { type: "t", value: null },
 			"mirrorSampler":    { type: "t", value: null },
 			"alpha":            { type: "f", value: 1.0 },
 			"alpha":            { type: "f", value: 1.0 },
@@ -18,10 +18,10 @@ THREE.ShaderLib[ 'water' ] = {
 			"distortionScale":  { type: "f", value: 20.0 },
 			"distortionScale":  { type: "f", value: 20.0 },
 			"noiseScale":       { type: "f", value: 1.0 },
 			"noiseScale":       { type: "f", value: 1.0 },
 			"textureMatrix" :   { type: "m4", value: new THREE.Matrix4() },
 			"textureMatrix" :   { type: "m4", value: new THREE.Matrix4() },
-			"sunColor":         { type: "c", value: new THREE.Color(0x7F7F7F) },
-			"sunDirection":     { type: "v3", value: new THREE.Vector3(0.70707, 0.70707, 0) },
-			"eye":              { type: "v3", value: new THREE.Vector3(0, 0, 0) },
-			"waterColor":       { type: "c", value: new THREE.Color(0x555555) }
+			"sunColor":         { type: "c", value: new THREE.Color( 0x7F7F7F ) },
+			"sunDirection":     { type: "v3", value: new THREE.Vector3( 0.70707, 0.70707, 0 ) },
+			"eye":              { type: "v3", value: new THREE.Vector3() },
+			"waterColor":       { type: "c", value: new THREE.Color( 0x555555 ) }
 		}
 		}
 	] ),
 	] ),
 
 
@@ -31,7 +31,7 @@ THREE.ShaderLib[ 'water' ] = {
 
 
 		'varying vec4 mirrorCoord;',
 		'varying vec4 mirrorCoord;',
 		'varying vec3 worldPosition;',
 		'varying vec3 worldPosition;',
-		
+
 		'void main()',
 		'void main()',
 		'{',
 		'{',
 		'	mirrorCoord = modelMatrix * vec4( position, 1.0 );',
 		'	mirrorCoord = modelMatrix * vec4( position, 1.0 );',
@@ -43,7 +43,7 @@ THREE.ShaderLib[ 'water' ] = {
 
 
 	fragmentShader: [
 	fragmentShader: [
 		'precision highp float;',
 		'precision highp float;',
-		
+
 		'uniform sampler2D mirrorSampler;',
 		'uniform sampler2D mirrorSampler;',
 		'uniform float alpha;',
 		'uniform float alpha;',
 		'uniform float time;',
 		'uniform float time;',
@@ -56,20 +56,20 @@ THREE.ShaderLib[ 'water' ] = {
 
 
 		'varying vec4 mirrorCoord;',
 		'varying vec4 mirrorCoord;',
 		'varying vec3 worldPosition;',
 		'varying vec3 worldPosition;',
-		
+
 		'vec4 getNoise( vec2 uv )',
 		'vec4 getNoise( vec2 uv )',
 		'{',
 		'{',
 		'	vec2 uv0 = ( uv / 103.0 ) + vec2(time / 17.0, time / 29.0);',
 		'	vec2 uv0 = ( uv / 103.0 ) + vec2(time / 17.0, time / 29.0);',
 		'	vec2 uv1 = uv / 107.0-vec2( time / -19.0, time / 31.0 );',
 		'	vec2 uv1 = uv / 107.0-vec2( time / -19.0, time / 31.0 );',
 		'	vec2 uv2 = uv / vec2( 8907.0, 9803.0 ) + vec2( time / 101.0, time / 97.0 );',
 		'	vec2 uv2 = uv / vec2( 8907.0, 9803.0 ) + vec2( time / 101.0, time / 97.0 );',
 		'	vec2 uv3 = uv / vec2( 1091.0, 1027.0 ) - vec2( time / 109.0, time / -113.0 );',
 		'	vec2 uv3 = uv / vec2( 1091.0, 1027.0 ) - vec2( time / 109.0, time / -113.0 );',
-		'	vec4 noise = ( texture2D( normalSampler, uv0 ) ) +',
-        '		( texture2D( normalSampler, uv1 ) ) +',
-        '		( texture2D( normalSampler, uv2 ) ) +',
-		'		( texture2D( normalSampler, uv3 ) );',
+		'	vec4 noise = texture2D( normalSampler, uv0 ) +',
+		'		texture2D( normalSampler, uv1 ) +',
+		'		texture2D( normalSampler, uv2 ) +',
+		'		texture2D( normalSampler, uv3 );',
 		'	return noise * 0.5 - 1.0;',
 		'	return noise * 0.5 - 1.0;',
 		'}',
 		'}',
-		
+
 		'void sunLight( const vec3 surfaceNormal, const vec3 eyeDirection, float shiny, float spec, float diffuse, inout vec3 diffuseColor, inout vec3 specularColor )',
 		'void sunLight( const vec3 surfaceNormal, const vec3 eyeDirection, float shiny, float spec, float diffuse, inout vec3 diffuseColor, inout vec3 specularColor )',
 		'{',
 		'{',
 		'	vec3 reflection = normalize( reflect( -sunDirection, surfaceNormal ) );',
 		'	vec3 reflection = normalize( reflect( -sunDirection, surfaceNormal ) );',
@@ -79,7 +79,7 @@ THREE.ShaderLib[ 'water' ] = {
 		'}',
 		'}',
 
 
 		THREE.ShaderChunk[ "common" ],
 		THREE.ShaderChunk[ "common" ],
-		THREE.ShaderChunk[ "fog_pars_fragment" ],		
+		THREE.ShaderChunk[ "fog_pars_fragment" ],
 
 
 		'void main()',
 		'void main()',
 		'{',
 		'{',
@@ -92,7 +92,7 @@ THREE.ShaderLib[ 'water' ] = {
 		'	vec3 worldToEye = eye-worldPosition;',
 		'	vec3 worldToEye = eye-worldPosition;',
 		'	vec3 eyeDirection = normalize( worldToEye );',
 		'	vec3 eyeDirection = normalize( worldToEye );',
 		'	sunLight( surfaceNormal, eyeDirection, 100.0, 2.0, 0.5, diffuseLight, specularLight );',
 		'	sunLight( surfaceNormal, eyeDirection, 100.0, 2.0, 0.5, diffuseLight, specularLight );',
-		
+
 		'	float distance = length(worldToEye);',
 		'	float distance = length(worldToEye);',
 
 
 		'	vec2 distortion = surfaceNormal.xz * ( 0.001 + 1.0 / distance ) * distortionScale;',
 		'	vec2 distortion = surfaceNormal.xz * ( 0.001 + 1.0 / distance ) * distortionScale;',
@@ -105,7 +105,7 @@ THREE.ShaderLib[ 'water' ] = {
 		'	vec3 albedo = mix( sunColor * diffuseLight * 0.3 + scatter, ( vec3( 0.1 ) + reflectionSample * 0.9 + reflectionSample * specularLight ), reflectance );',
 		'	vec3 albedo = mix( sunColor * diffuseLight * 0.3 + scatter, ( vec3( 0.1 ) + reflectionSample * 0.9 + reflectionSample * specularLight ), reflectance );',
 		'	vec3 outgoingLight = albedo;',
 		'	vec3 outgoingLight = albedo;',
 			THREE.ShaderChunk[ "fog_fragment" ],
 			THREE.ShaderChunk[ "fog_fragment" ],
-		'	gl_FragColor = vec4( outgoingLight, alpha );',		
+		'	gl_FragColor = vec4( outgoingLight, alpha );',
 		'}'
 		'}'
 	].join( '\n' )
 	].join( '\n' )
 
 
@@ -123,9 +123,9 @@ THREE.Water = function ( renderer, camera, scene, options ) {
 	}
 	}
 
 
 	options = options || {};
 	options = options || {};
-	
+
 	this.matrixNeedsUpdate = true;
 	this.matrixNeedsUpdate = true;
-	
+
 	var width = optionalParameter( options.textureWidth, 512 );
 	var width = optionalParameter( options.textureWidth, 512 );
 	var height = optionalParameter( options.textureHeight, 512 );
 	var height = optionalParameter( options.textureHeight, 512 );
 	this.clipBias = optionalParameter( options.clipBias, 0.0 );
 	this.clipBias = optionalParameter( options.clipBias, 0.0 );
@@ -137,8 +137,8 @@ THREE.Water = function ( renderer, camera, scene, options ) {
 	this.waterColor = new THREE.Color( optionalParameter( options.waterColor, 0x7F7F7F ) );
 	this.waterColor = new THREE.Color( optionalParameter( options.waterColor, 0x7F7F7F ) );
 	this.eye = optionalParameter( options.eye, new THREE.Vector3( 0, 0, 0 ) );
 	this.eye = optionalParameter( options.eye, new THREE.Vector3( 0, 0, 0 ) );
 	this.distortionScale = optionalParameter( options.distortionScale, 20.0 );
 	this.distortionScale = optionalParameter( options.distortionScale, 20.0 );
-	this.side = optionalParameter(options.side, THREE.FrontSide);
-	this.fog = optionalParameter(options.fog, false);
+	this.side = optionalParameter( options.side, THREE.FrontSide );
+	this.fog = optionalParameter( options.fog, false );
 
 
 	this.renderer = renderer;
 	this.renderer = renderer;
 	this.scene = scene;
 	this.scene = scene;
@@ -149,33 +149,33 @@ THREE.Water = function ( renderer, camera, scene, options ) {
 	this.rotationMatrix = new THREE.Matrix4();
 	this.rotationMatrix = new THREE.Matrix4();
 	this.lookAtPosition = new THREE.Vector3( 0, 0, - 1 );
 	this.lookAtPosition = new THREE.Vector3( 0, 0, - 1 );
 	this.clipPlane = new THREE.Vector4();
 	this.clipPlane = new THREE.Vector4();
-	
+
 	if ( camera instanceof THREE.PerspectiveCamera )
 	if ( camera instanceof THREE.PerspectiveCamera )
 		this.camera = camera;
 		this.camera = camera;
 	else {
 	else {
 
 
 		this.camera = new THREE.PerspectiveCamera();
 		this.camera = new THREE.PerspectiveCamera();
-		console.log( this.name + ': camera is not a Perspective Camera!' )
+		console.log( this.name + ': camera is not a Perspective Camera!' );
 
 
 	}
 	}
 
 
 	this.textureMatrix = new THREE.Matrix4();
 	this.textureMatrix = new THREE.Matrix4();
 
 
 	this.mirrorCamera = this.camera.clone();
 	this.mirrorCamera = this.camera.clone();
-	
+
 	this.texture = new THREE.WebGLRenderTarget( width, height );
 	this.texture = new THREE.WebGLRenderTarget( width, height );
 	this.tempTexture = new THREE.WebGLRenderTarget( width, height );
 	this.tempTexture = new THREE.WebGLRenderTarget( width, height );
-	
+
 	var mirrorShader = THREE.ShaderLib[ "water" ];
 	var mirrorShader = THREE.ShaderLib[ "water" ];
 	var mirrorUniforms = THREE.UniformsUtils.clone( mirrorShader.uniforms );
 	var mirrorUniforms = THREE.UniformsUtils.clone( mirrorShader.uniforms );
 
 
-	this.material = new THREE.ShaderMaterial( { 
-		fragmentShader: mirrorShader.fragmentShader, 
-		vertexShader: mirrorShader.vertexShader, 
+	this.material = new THREE.ShaderMaterial( {
+		fragmentShader: mirrorShader.fragmentShader,
+		vertexShader: mirrorShader.vertexShader,
 		uniforms: mirrorUniforms,
 		uniforms: mirrorUniforms,
 		transparent: true,
 		transparent: true,
 		side: this.side,
 		side: this.side,
-		fog: this.fog		
+		fog: this.fog
 	} );
 	} );
 
 
 	this.material.uniforms.mirrorSampler.value = this.texture;
 	this.material.uniforms.mirrorSampler.value = this.texture;
@@ -187,9 +187,9 @@ THREE.Water = function ( renderer, camera, scene, options ) {
 	this.material.uniforms.waterColor.value = this.waterColor;
 	this.material.uniforms.waterColor.value = this.waterColor;
 	this.material.uniforms.sunDirection.value = this.sunDirection;
 	this.material.uniforms.sunDirection.value = this.sunDirection;
 	this.material.uniforms.distortionScale.value = this.distortionScale;
 	this.material.uniforms.distortionScale.value = this.distortionScale;
-	
+
 	this.material.uniforms.eye.value = this.eye;
 	this.material.uniforms.eye.value = this.eye;
-	
+
 	if ( ! THREE.Math.isPowerOfTwo( width ) || ! THREE.Math.isPowerOfTwo( height ) ) {
 	if ( ! THREE.Math.isPowerOfTwo( width ) || ! THREE.Math.isPowerOfTwo( height ) ) {
 
 
 		this.texture.generateMipmaps = false;
 		this.texture.generateMipmaps = false;
@@ -286,7 +286,7 @@ THREE.Water.prototype.updateTextureMatrix = function () {
 	projectionMatrix.elements[ 6 ] = c.y;
 	projectionMatrix.elements[ 6 ] = c.y;
 	projectionMatrix.elements[ 10 ] = c.z + 1.0 - this.clipBias;
 	projectionMatrix.elements[ 10 ] = c.z + 1.0 - this.clipBias;
 	projectionMatrix.elements[ 14 ] = c.w;
 	projectionMatrix.elements[ 14 ] = c.w;
-	
+
 	var worldCoordinates = new THREE.Vector3();
 	var worldCoordinates = new THREE.Vector3();
 	worldCoordinates.setFromMatrixPosition( this.camera.matrixWorld );
 	worldCoordinates.setFromMatrixPosition( this.camera.matrixWorld );
 	this.eye = worldCoordinates;
 	this.eye = worldCoordinates;

+ 118 - 113
examples/js/cameras/CinematicCamera.js

@@ -1,181 +1,186 @@
 /**
 /**
-  * @author mrdoob / http://mrdoob.com/
-  * @author greggman / http://games.greggman.com/
-  * @author zz85 / http://www.lab4games.net/zz85/blog
-  * @author kaypiKun
-  */
-
-//Inheriting PerspectiveCamera
-
-THREE.CinematicCamera = function(fov, aspect, near, far){
-  THREE.PerspectiveCamera.call(this, fov, aspect, near, far);
-  this.type = "CinematicCamera";
-
-  this.postprocessing = { enabled  : true };
-  this.shaderSettings = {
-    rings: 3,
-    samples: 4
-  };
-
-  this.material_depth = new THREE.MeshDepthMaterial();
-  //In case of cinematicCamera, having a default lens set is important
-  this.setLens();
-
-  this.initPostProcessing();
-  
+ * @author mrdoob / http://mrdoob.com/
+ * @author greggman / http://games.greggman.com/
+ * @author zz85 / http://www.lab4games.net/zz85/blog
+ * @author kaypiKun
+ */
+
+THREE.CinematicCamera = function( fov, aspect, near, far ) {
+
+	THREE.PerspectiveCamera.call( this, fov, aspect, near, far );
+
+	this.type = "CinematicCamera";
+
+	this.postprocessing = { enabled	: true };
+	this.shaderSettings = {
+		rings: 3,
+		samples: 4
+	};
+
+	this.material_depth = new THREE.MeshDepthMaterial();
+
+	// In case of cinematicCamera, having a default lens set is important
+	this.setLens();
+
+	this.initPostProcessing();
+
 };
 };
 
 
-THREE.CinematicCamera.prototype = Object.create(THREE.PerspectiveCamera.prototype);
+THREE.CinematicCamera.prototype = Object.create( THREE.PerspectiveCamera.prototype );
 THREE.CinematicCamera.prototype.constructor = THREE.CinematicCamera;
 THREE.CinematicCamera.prototype.constructor = THREE.CinematicCamera;
 
 
 
 
-//providing fnumber and coc(Circle of Confusion) as extra arguments
+// providing fnumber and coc(Circle of Confusion) as extra arguments
 THREE.CinematicCamera.prototype.setLens = function ( focalLength, frameHeight, fNumber, coc ) {
 THREE.CinematicCamera.prototype.setLens = function ( focalLength, frameHeight, fNumber, coc ) {
 
 
-  //In case of cinematicCamera, having a default lens set is important
-  if ( focalLength === undefined ) focalLength = 35;
+	// In case of cinematicCamera, having a default lens set is important
+	if ( focalLength === undefined ) focalLength = 35;
 
 
-  THREE.PerspectiveCamera.prototype.setLens.call( this, focalLength, frameHeight );
+	THREE.PerspectiveCamera.prototype.setLens.call( this, focalLength, frameHeight );
 
 
-  //if fnumber and coc are not provided, cinematicCamera tries to act as a basic PerspectiveCamera
-  if ( fNumber === undefined ) fNumber = 8;
-  if ( coc === undefined ) coc = 0.019;
+	// if fnumber and coc are not provided, cinematicCamera tries to act as a basic PerspectiveCamera
+	if ( fNumber === undefined ) fNumber = 8;
+	if ( coc === undefined ) coc = 0.019;
 
 
+	this.focalLength = focalLength;
+	this.fNumber = fNumber;
+	this.coc = coc;
 
 
+	// fNumber is focalLength by aperture
+	this.aperture = this.focalLength / this.fNumber;
 
 
-  this.focalLength = focalLength;
-  this.fNumber = fNumber;
-  this.coc = coc;
+	// hyperFocal is required to calculate depthOfField when a lens tries to focus at a distance with given fNumber and focalLength
+	this.hyperFocal = ( this.focalLength * this.focalLength ) / ( this.aperture * this.coc );
 
 
-  //fNumber is focalLength by aperture
-  this.aperture = this.focalLength/this.fNumber;
+};
 
 
-  //hyperFocal is required to calculate depthOfField when a lens tries to focus at a distance with given fNumber and focalLength
-  this.hyperFocal = (this.focalLength*this.focalLength)/(this.aperture*this.coc);
+THREE.CinematicCamera.prototype.linearize = function ( depth ) {
+
+	var zfar = this.far;
+	var znear = this.near;
+	return - zfar * znear / ( depth * ( zfar - znear ) - zfar );
 
 
 };
 };
 
 
+THREE.CinematicCamera.prototype.smoothstep = function ( near, far, depth ) {
 
 
+	var x = this.saturate( ( depth - near ) / ( far - near ) );
+	return x * x * ( 3 - 2 * x );
 
 
-THREE.CinematicCamera.prototype.linearize = function(depth) {
-	var zfar = this.far;
-	var znear = this.near;
-	return -zfar * znear / (depth * (zfar - znear) - zfar);
-}
+};
 
 
+THREE.CinematicCamera.prototype.saturate = function ( x ) {
 
 
-THREE.CinematicCamera.prototype.smoothstep = function(near, far, depth) {
-	var x = this.saturate( (depth - near) / (far - near));
-	return x * x * (3- 2*x);
-}
+	return Math.max( 0, Math.min( 1, x ) );
 
 
+};
 
 
-THREE.CinematicCamera.prototype.saturate = function(x) {
-	return Math.max(0, Math.min(1, x));
-}
+// function for focusing at a distance from the camera
+THREE.CinematicCamera.prototype.focusAt = function ( focusDistance ) {
 
 
+	if ( focusDistance === undefined ) focusDistance = 20;
 
 
-//function for focusing at a distance from the camera
-THREE.CinematicCamera.prototype.focusAt = function (focusDistance){
+	// distance from the camera (normal to frustrum) to focus on (unused)
+	this.focusDistance = focusDistance;
 
 
-  if ( focusDistance === undefined ) focusDistance = 20;
+	// the nearest point from the camera which is in focus (unused)
+	this.nearPoint = ( this.hyperFocal * this.focusDistance ) / ( this.hyperFocal + ( this.focusDistance - this.focalLength ) );
 
 
-  //distance from the camera (normal to frustrum) to focus on (unused)
-  this.focusDistance = focusDistance;
+	// the farthest point from the camera which is in focus (unused)
+	this.farPoint = ( this.hyperFocal * this.focusDistance ) / ( this.hyperFocal - ( this.focusDistance - this.focalLength ) );
 
 
-  //the nearest point from the camera which is in focus (unused)
-  this.nearPoint = (this.hyperFocal*this.focusDistance)/(this.hyperFocal+(this.focusDistance-this.focalLength));
+	// the gap or width of the space in which is everything is in focus (unused)
+	this.depthOfField = this.farPoint - this.nearPoint;
 
 
-  //the farthest point from the camera which is in focus (unused)
-  this.farPoint = (this.hyperFocal*this.focusDistance)/(this.hyperFocal-(this.focusDistance-this.focalLength));
+	// Considering minimum distance of focus for a standard lens (unused)
+	if ( this.depthOfField < 0 ) this.depthOfField = 0;
 
 
-  //the gap or width of the space in which is everything is in focus (unused)
-  this.depthOfField = this.farPoint - this.nearPoint;
+	this.sdistance = this.smoothstep( this.near, this.far, this.focusDistance );
 
 
-  //Considering minimum distance of focus for a standard lens (unused)
-  if( this.depthOfField < 0) this.depthOfField = 0;
-  
-  this.sdistance = this.smoothstep(this.near, this.far, this.focusDistance);
+	this.ldistance = this.linearize( 1 -	this.sdistance );
 
 
-	this.ldistance = this.linearize(1 -  this.sdistance);
-	
 	this.postprocessing.bokeh_uniforms[ 'focalDepth' ].value = this.ldistance;
 	this.postprocessing.bokeh_uniforms[ 'focalDepth' ].value = this.ldistance;
 
 
 };
 };
 
 
+THREE.CinematicCamera.prototype.initPostProcessing = function () {
+
+	if ( this.postprocessing.enabled ) {
 
 
+		this.postprocessing.scene = new THREE.Scene();
 
 
-THREE.CinematicCamera.prototype.initPostProcessing = function (){
-    if(this.postprocessing.enabled)
-    {
-        this.postprocessing.scene = new THREE.Scene();
+		this.postprocessing.camera = new THREE.OrthographicCamera( window.innerWidth / - 2, window.innerWidth / 2,	window.innerHeight / 2, window.innerHeight / - 2, - 10000, 10000 );
 
 
-        
-        this.postprocessing.camera = new THREE.OrthographicCamera( window.innerWidth / -2, window.innerWidth / 2,  window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
-        
-    
-        this.postprocessing.scene.add( this.postprocessing.camera );
+		this.postprocessing.scene.add( this.postprocessing.camera );
 
 
-        var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
-        this.postprocessing.rtTextureDepth = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, pars );
-        this.postprocessing.rtTextureColor = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, pars );
+		var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
+		this.postprocessing.rtTextureDepth = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, pars );
+		this.postprocessing.rtTextureColor = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, pars );
 
 
+		var bokeh_shader = THREE.BokehShader;
 
 
-        var bokeh_shader = THREE.BokehShader;
+		this.postprocessing.bokeh_uniforms = THREE.UniformsUtils.clone( bokeh_shader.uniforms );
 
 
-        this.postprocessing.bokeh_uniforms = THREE.UniformsUtils.clone( bokeh_shader.uniforms );
+		this.postprocessing.bokeh_uniforms[ "tColor" ].value = this.postprocessing.rtTextureColor;
+		this.postprocessing.bokeh_uniforms[ "tDepth" ].value = this.postprocessing.rtTextureDepth;
 
 
-        this.postprocessing.bokeh_uniforms[ "tColor" ].value = this.postprocessing.rtTextureColor;
-        this.postprocessing.bokeh_uniforms[ "tDepth" ].value = this.postprocessing.rtTextureDepth;
+		this.postprocessing.bokeh_uniforms[ "manualdof" ].value = 0;
+		this.postprocessing.bokeh_uniforms[ "shaderFocus" ].value = 0;
 
 
-        this.postprocessing.bokeh_uniforms[ "manualdof" ].value = 0;
-				this.postprocessing.bokeh_uniforms[ "shaderFocus" ].value = 0;
+		this.postprocessing.bokeh_uniforms[ "fstop" ].value = 2.8;
 
 
-        this.postprocessing.bokeh_uniforms[ "fstop" ].value = 2.8;
+		this.postprocessing.bokeh_uniforms[ "showFocus" ].value = 1;
 
 
-        this.postprocessing.bokeh_uniforms[ "showFocus" ].value = 1;
+		this.postprocessing.bokeh_uniforms[ "focalDepth" ].value = 0.1;
 
 
-        this.postprocessing.bokeh_uniforms[ "focalDepth" ].value = 0.1;
+		console.log( this.postprocessing.bokeh_uniforms[ "focalDepth" ].value );
 
 
-        console.log(this.postprocessing.bokeh_uniforms["focalDepth"].value);
+		this.postprocessing.bokeh_uniforms[ "znear" ].value = this.near;
+		this.postprocessing.bokeh_uniforms[ "zfar" ].value = this.near;
 
 
-				this.postprocessing.bokeh_uniforms[ "znear" ].value = this.near;
-				this.postprocessing.bokeh_uniforms[ "zfar" ].value = this.near;
 
 
+		this.postprocessing.bokeh_uniforms[ "textureWidth" ].value = window.innerWidth;
 
 
-        this.postprocessing.bokeh_uniforms[ "textureWidth" ].value = window.innerWidth;
+		this.postprocessing.bokeh_uniforms[ "textureHeight" ].value = window.innerHeight;
 
 
-        this.postprocessing.bokeh_uniforms[ "textureHeight" ].value = window.innerHeight;
+		this.postprocessing.materialBokeh = new THREE.ShaderMaterial( {
+			uniforms: this.postprocessing.bokeh_uniforms,
+			vertexShader: bokeh_shader.vertexShader,
+			fragmentShader: bokeh_shader.fragmentShader,
+			defines: {
+				RINGS: this.shaderSettings.rings,
+				SAMPLES: this.shaderSettings.samples
+			}
+		} );
 
 
-        this.postprocessing.materialBokeh = new THREE.ShaderMaterial({uniforms: this.postprocessing.bokeh_uniforms, vertexShader: bokeh_shader.vertexShader, fragmentShader: bokeh_shader.fragmentShader, defines: { RINGS: this.shaderSettings.rings, SAMPLES: this.shaderSettings.samples } } );
+		this.postprocessing.quad = new THREE.Mesh( new THREE.PlaneBufferGeometry( window.innerWidth, window.innerHeight ), this.postprocessing.materialBokeh );
+		this.postprocessing.quad.position.z = - 500;
+		this.postprocessing.scene.add( this.postprocessing.quad );
 
 
-        this.postprocessing.quad = new THREE.Mesh( new THREE.PlaneBufferGeometry( window.innerWidth, window.innerHeight ), this.postprocessing.materialBokeh );
-        this.postprocessing.quad.position.z = -500;
-        this.postprocessing.scene.add( this.postprocessing.quad );
-    }
+	}
 
 
-}
+};
 
 
-THREE.CinematicCamera.prototype.renderCinematic = function (scene, renderer ){
+THREE.CinematicCamera.prototype.renderCinematic = function ( scene, renderer ) {
 
 
-    if ( this.postprocessing.enabled ) {
+	if ( this.postprocessing.enabled ) {
 
 
-      renderer.clear();
+		renderer.clear();
 
 
-      // Render scene into texture
+		// Render scene into texture
 
 
-      scene.overrideMaterial = null;
-      renderer.render( scene, camera, this.postprocessing.rtTextureColor, true );
+		scene.overrideMaterial = null;
+		renderer.render( scene, camera, this.postprocessing.rtTextureColor, true );
 
 
-      // Render depth into texture
+		// Render depth into texture
 
 
-      scene.overrideMaterial = this.material_depth;
-      renderer.render( scene, camera, this.postprocessing.rtTextureDepth, true );
+		scene.overrideMaterial = this.material_depth;
+		renderer.render( scene, camera, this.postprocessing.rtTextureDepth, true );
 
 
-      // Render bokeh composite
+		// Render bokeh composite
 
 
-      renderer.render( this.postprocessing.scene, this.postprocessing.camera );
+		renderer.render( this.postprocessing.scene, this.postprocessing.camera );
 
 
-    }
+	}
 
 
-}
+};

+ 33 - 34
examples/js/controls/DragControls.js

@@ -4,7 +4,6 @@
  */
  */
 THREE.DragControls = function( _camera, _objects, _domElement ) {
 THREE.DragControls = function( _camera, _objects, _domElement ) {
 
 
-	var _projector = new THREE.Projector();
 	var _raycaster = new THREE.Raycaster();
 	var _raycaster = new THREE.Raycaster();
 
 
 	var _mouse = new THREE.Vector3(),
 	var _mouse = new THREE.Vector3(),
@@ -24,23 +23,23 @@ THREE.DragControls = function( _camera, _objects, _domElement ) {
 
 
 	var me = this;
 	var me = this;
 	this.on = function( event, handler ) {
 	this.on = function( event, handler ) {
-		
+
 		if ( ! _listeners[ event ] ) _listeners[ event ] = [];
 		if ( ! _listeners[ event ] ) _listeners[ event ] = [];
 
 
 		_listeners[ event ].push( handler );
 		_listeners[ event ].push( handler );
 		return me;
 		return me;
-	
+
 	};
 	};
 
 
 	this.off = function( event, handler ) {
 	this.off = function( event, handler ) {
-		
+
 		var l = _listeners[ event ];
 		var l = _listeners[ event ];
 		if ( ! l ) return me;
 		if ( ! l ) return me;
 
 
 		if ( l.indexOf( handler ) > - 1 ) {
 		if ( l.indexOf( handler ) > - 1 ) {
-			
+
 			l.splice( handler, 1 );
 			l.splice( handler, 1 );
-		
+
 		}
 		}
 
 
 		return me;
 		return me;
@@ -48,52 +47,52 @@ THREE.DragControls = function( _camera, _objects, _domElement ) {
 	};
 	};
 
 
 	var notify = function( event, data, member ) {
 	var notify = function( event, data, member ) {
-			
+
 		var l = _listeners[ event ];
 		var l = _listeners[ event ];
 		if ( ! l ) return;
 		if ( ! l ) return;
 
 
 		if ( ! member ) {
 		if ( ! member ) {
-					
+
 			for ( var i = 0; i < l.length; i ++ ) {
 			for ( var i = 0; i < l.length; i ++ ) {
-						
+
 				l[ i ]( data );
 				l[ i ]( data );
-					
+
 			}
 			}
-				
+
 		}
 		}
-		
+
 	};
 	};
 
 
 	this.setObjects = function( objects ) {
 	this.setObjects = function( objects ) {
-		
+
 		if ( objects instanceof THREE.Scene ) {
 		if ( objects instanceof THREE.Scene ) {
-			
+
 			_objects = objects.children;
 			_objects = objects.children;
-		
+
 		} else {
 		} else {
-			
+
 			_objects = objects;
 			_objects = objects;
-		
+
 		}
 		}
-	
+
 	};
 	};
 
 
 	this.setObjects( _objects );
 	this.setObjects( _objects );
 
 
 	this.activate = function() {
 	this.activate = function() {
-		
+
 		_domElement.addEventListener( 'mousemove', onDocumentMouseMove, false );
 		_domElement.addEventListener( 'mousemove', onDocumentMouseMove, false );
 		_domElement.addEventListener( 'mousedown', onDocumentMouseDown, false );
 		_domElement.addEventListener( 'mousedown', onDocumentMouseDown, false );
 		_domElement.addEventListener( 'mouseup', onDocumentMouseUp, false );
 		_domElement.addEventListener( 'mouseup', onDocumentMouseUp, false );
-	
+
 	};
 	};
 
 
 	this.deactivate = function() {
 	this.deactivate = function() {
-		
+
 		_domElement.removeEventListener( 'mousemove', onDocumentMouseMove, false );
 		_domElement.removeEventListener( 'mousemove', onDocumentMouseMove, false );
 		_domElement.removeEventListener( 'mousedown', onDocumentMouseDown, false );
 		_domElement.removeEventListener( 'mousedown', onDocumentMouseDown, false );
 		_domElement.removeEventListener( 'mouseup', onDocumentMouseUp, false );
 		_domElement.removeEventListener( 'mouseup', onDocumentMouseUp, false );
-	
+
 	};
 	};
 
 
 	this.dispose = function() {
 	this.dispose = function() {
@@ -116,7 +115,7 @@ THREE.DragControls = function( _camera, _objects, _domElement ) {
 
 
 
 
 		if ( _selected && me.enabled ) {
 		if ( _selected && me.enabled ) {
-			
+
 			var normal = _selected.normal;
 			var normal = _selected.normal;
 
 
 			// I found this article useful about plane-line intersections
 			// I found this article useful about plane-line intersections
@@ -128,7 +127,7 @@ THREE.DragControls = function( _camera, _objects, _domElement ) {
 				// bail
 				// bail
 				console.log( 'no or infinite solutions' );
 				console.log( 'no or infinite solutions' );
 				return;
 				return;
-			
+
 			}
 			}
 
 
 			var num = normal.dot( p3subp1.copy( _selected.point ).sub( ray.origin ) );
 			var num = normal.dot( p3subp1.copy( _selected.point ).sub( ray.origin ) );
@@ -140,24 +139,24 @@ THREE.DragControls = function( _camera, _objects, _domElement ) {
 			var xLock, yLock, zLock = false;
 			var xLock, yLock, zLock = false;
 
 
 			var moveX, moveY, moveZ;
 			var moveX, moveY, moveZ;
-			
+
 
 
 			if ( xLock ) {
 			if ( xLock ) {
-				
+
 				moveX = true;
 				moveX = true;
 				moveY = false;
 				moveY = false;
 				moveZ = false;
 				moveZ = false;
-			
+
 			} else if ( yLock ) {
 			} else if ( yLock ) {
-							
+
 				moveX = false;
 				moveX = false;
 				moveY = true;
 				moveY = true;
 				moveZ = false;
 				moveZ = false;
-						
+
 			} else {
 			} else {
-							
+
 				moveX = moveY = moveZ = true;
 				moveX = moveY = moveZ = true;
-						
+
 			}
 			}
 
 
 			// Reverse Matrix?
 			// Reverse Matrix?
@@ -181,7 +180,7 @@ THREE.DragControls = function( _camera, _objects, _domElement ) {
 			notify( 'hoveron', _hovered );
 			notify( 'hoveron', _hovered );
 
 
 		} else {
 		} else {
-			
+
 			notify( 'hoveroff', _hovered );
 			notify( 'hoveroff', _hovered );
 			_hovered = null;
 			_hovered = null;
 			_domElement.style.cursor = 'auto';
 			_domElement.style.cursor = 'auto';
@@ -203,7 +202,7 @@ THREE.DragControls = function( _camera, _objects, _domElement ) {
 
 
 		var normal = ray.direction; // normal ray to the camera position
 		var normal = ray.direction; // normal ray to the camera position
 		if ( intersects.length > 0 ) {
 		if ( intersects.length > 0 ) {
-			
+
 			_selected = intersects[ 0 ];
 			_selected = intersects[ 0 ];
 			_selected.ray = ray;
 			_selected.ray = ray;
 			_selected.normal = normal ;
 			_selected.normal = normal ;
@@ -226,7 +225,7 @@ THREE.DragControls = function( _camera, _objects, _domElement ) {
 
 
 			notify( 'dragend', _selected );
 			notify( 'dragend', _selected );
 			_selected = null;
 			_selected = null;
-		
+
 		}
 		}
 
 
 		_domElement.style.cursor = 'auto';
 		_domElement.style.cursor = 'auto';

+ 50 - 58
examples/js/controls/OrbitControls.js

@@ -235,7 +235,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		//scope.dispatchEvent( { type: 'dispose' } ); // should this be added here?
 		//scope.dispatchEvent( { type: 'dispose' } ); // should this be added here?
 
 
-	}
+	};
 
 
 	//
 	//
 	// internals
 	// internals
@@ -424,31 +424,31 @@ THREE.OrbitControls = function ( object, domElement ) {
 	// event callbacks - update the object state
 	// event callbacks - update the object state
 	//
 	//
 
 
-	var handleMouseDownRotate = function( event ) {
+	function handleMouseDownRotate( event ) {
 
 
 		//console.log( 'handleMouseDownRotate' );
 		//console.log( 'handleMouseDownRotate' );
 
 
 		rotateStart.set( event.clientX, event.clientY );
 		rotateStart.set( event.clientX, event.clientY );
 
 
-	};
+	}
 
 
-	var handleMouseDownDolly = function( event ) {
+	function handleMouseDownDolly( event ) {
 
 
 		//console.log( 'handleMouseDownDolly' );
 		//console.log( 'handleMouseDownDolly' );
 
 
 		dollyStart.set( event.clientX, event.clientY );
 		dollyStart.set( event.clientX, event.clientY );
 
 
-	};
+	}
 
 
-	var handleMouseDownPan = function( event ) {
+	function handleMouseDownPan( event ) {
 
 
 		//console.log( 'handleMouseDownPan' );
 		//console.log( 'handleMouseDownPan' );
 
 
 		panStart.set( event.clientX, event.clientY );
 		panStart.set( event.clientX, event.clientY );
 
 
-	};
+	}
 
 
-	var handleMouseMoveRotate = function( event ) {
+	function handleMouseMoveRotate( event ) {
 
 
 		//console.log( 'handleMouseMoveRotate' );
 		//console.log( 'handleMouseMoveRotate' );
 
 
@@ -467,9 +467,9 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		scope.update();
 		scope.update();
 
 
-	};
+	}
 
 
-	var handleMouseMoveDolly = function( event ) {
+	function handleMouseMoveDolly( event ) {
 
 
 		//console.log( 'handleMouseMoveDolly' );
 		//console.log( 'handleMouseMoveDolly' );
 
 
@@ -491,9 +491,9 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		scope.update();
 		scope.update();
 
 
-	};
+	}
 
 
-	var handleMouseMovePan = function( event ) {
+	function handleMouseMovePan( event ) {
 
 
 		//console.log( 'handleMouseMovePan' );
 		//console.log( 'handleMouseMovePan' );
 
 
@@ -507,15 +507,15 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		scope.update();
 		scope.update();
 
 
-	};
+	}
 
 
-	var handleMouseUp = function( event ) {
+	function handleMouseUp( event ) {
 
 
 		//console.log( 'handleMouseUp' );
 		//console.log( 'handleMouseUp' );
 
 
-	};
+	}
 
 
-	var handleMouseWheel = function( event ) {
+	function handleMouseWheel( event ) {
 
 
 		//console.log( 'handleMouseWheel' );
 		//console.log( 'handleMouseWheel' );
 
 
@@ -547,9 +547,9 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		scope.update();
 		scope.update();
 
 
-	};
+	}
 
 
-	var handleKeyDown = function( event ) {
+	function handleKeyDown( event ) {
 
 
 		//console.log( 'handleKeyDown' );
 		//console.log( 'handleKeyDown' );
 
 
@@ -577,17 +577,17 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		}
 		}
 
 
-	};
+	}
 
 
-	var handleTouchStartRotate = function( event ) {
+	function handleTouchStartRotate( event ) {
 
 
 		//console.log( 'handleTouchStartRotate' );
 		//console.log( 'handleTouchStartRotate' );
 
 
 		rotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
 		rotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
 
 
-	};
+	}
 
 
-	var handleTouchStartDolly = function( event ) {
+	function handleTouchStartDolly( event ) {
 
 
 		//console.log( 'handleTouchStartDolly' );
 		//console.log( 'handleTouchStartDolly' );
 
 
@@ -598,17 +598,17 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		dollyStart.set( 0, distance );
 		dollyStart.set( 0, distance );
 
 
-	};
+	}
 
 
-	var handleTouchStartPan = function( event ) {
+	function handleTouchStartPan( event ) {
 
 
 		//console.log( 'handleTouchStartPan' );
 		//console.log( 'handleTouchStartPan' );
 
 
 		panStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
 		panStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
 
 
-	};
+	}
 
 
-	var handleTouchMoveRotate = function( event ) {
+	function handleTouchMoveRotate( event ) {
 
 
 		//console.log( 'handleTouchMoveRotate' );
 		//console.log( 'handleTouchMoveRotate' );
 
 
@@ -627,9 +627,9 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		scope.update();
 		scope.update();
 
 
-	};
+	}
 
 
-	var handleTouchMoveDolly = function( event ) {
+	function handleTouchMoveDolly( event ) {
 
 
 		//console.log( 'handleTouchMoveDolly' );
 		//console.log( 'handleTouchMoveDolly' );
 
 
@@ -656,9 +656,9 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		scope.update();
 		scope.update();
 
 
-	};
+	}
 
 
-	var handleTouchMovePan = function( event ) {
+	function handleTouchMovePan( event ) {
 
 
 		//console.log( 'handleTouchMovePan' );
 		//console.log( 'handleTouchMovePan' );
 
 
@@ -672,13 +672,13 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		scope.update();
 		scope.update();
 
 
-	};
+	}
 
 
-	var handleTouchEnd = function( event ) {
+	function handleTouchEnd( event ) {
 
 
 		//console.log( 'handleTouchEnd' );
 		//console.log( 'handleTouchEnd' );
 
 
-	};
+	}
 
 
 	//
 	//
 	// event handlers - FSM: listen for events and reset state
 	// event handlers - FSM: listen for events and reset state
@@ -726,7 +726,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		}
 		}
 
 
-	};
+	}
 
 
 	function onMouseMove( event ) {
 	function onMouseMove( event ) {
 
 
@@ -754,7 +754,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		}
 		}
 
 
-	};
+	}
 
 
 	function onMouseUp( event ) {
 	function onMouseUp( event ) {
 
 
@@ -770,7 +770,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		state = STATE.NONE;
 		state = STATE.NONE;
 
 
-	};
+	}
 
 
 	function onMouseWheel( event ) {
 	function onMouseWheel( event ) {
 
 
@@ -784,7 +784,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 		scope.dispatchEvent( startEvent ); // not sure why these are here...
 		scope.dispatchEvent( startEvent ); // not sure why these are here...
 		scope.dispatchEvent( endEvent );
 		scope.dispatchEvent( endEvent );
 
 
-	};
+	}
 
 
 	function onKeyDown( event ) {
 	function onKeyDown( event ) {
 
 
@@ -792,7 +792,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		handleKeyDown( event );
 		handleKeyDown( event );
 
 
-	};
+	}
 
 
 	function onTouchStart( event ) {
 	function onTouchStart( event ) {
 
 
@@ -842,7 +842,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		}
 		}
 
 
-	};
+	}
 
 
 	function onTouchMove( event ) {
 	function onTouchMove( event ) {
 
 
@@ -886,7 +886,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		}
 		}
 
 
-	};
+	}
 
 
 	function onTouchEnd( event ) {
 	function onTouchEnd( event ) {
 
 
@@ -898,11 +898,9 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 		state = STATE.NONE;
 		state = STATE.NONE;
 
 
-	};
-
-	onContextMenu = function( event ) {
+	}
 
 
-		//console.log( 'onContextMenu' );
+	function onContextMenu( event ) {
 
 
 		event.preventDefault();
 		event.preventDefault();
 
 
@@ -910,23 +908,17 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 
 	//
 	//
 
 
-	function init() {
-
-		scope.domElement.addEventListener( 'contextmenu', onContextMenu, false );
+	scope.domElement.addEventListener( 'contextmenu', onContextMenu, false );
 
 
-		scope.domElement.addEventListener( 'mousedown', onMouseDown, false );
-		scope.domElement.addEventListener( 'mousewheel', onMouseWheel, false );
-		scope.domElement.addEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox
+	scope.domElement.addEventListener( 'mousedown', onMouseDown, false );
+	scope.domElement.addEventListener( 'mousewheel', onMouseWheel, false );
+	scope.domElement.addEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox
 
 
-		scope.domElement.addEventListener( 'touchstart', onTouchStart, false );
-		scope.domElement.addEventListener( 'touchend', onTouchEnd, false );
-		scope.domElement.addEventListener( 'touchmove', onTouchMove, false );
-
-		window.addEventListener( 'keydown', onKeyDown, false );
-
-	};
+	scope.domElement.addEventListener( 'touchstart', onTouchStart, false );
+	scope.domElement.addEventListener( 'touchend', onTouchEnd, false );
+	scope.domElement.addEventListener( 'touchmove', onTouchMove, false );
 
 
-	init();
+	window.addEventListener( 'keydown', onKeyDown, false );
 
 
 	// force an update at start
 	// force an update at start
 
 

+ 2 - 2
examples/js/controls/PointerLockControls.js

@@ -35,7 +35,7 @@ THREE.PointerLockControls = function ( camera ) {
 
 
 		document.removeEventListener( 'mousemove', onMouseMove, false );
 		document.removeEventListener( 'mousemove', onMouseMove, false );
 
 
-	}
+	};
 
 
 	document.addEventListener( 'mousemove', onMouseMove, false );
 	document.addEventListener( 'mousemove', onMouseMove, false );
 
 
@@ -62,7 +62,7 @@ THREE.PointerLockControls = function ( camera ) {
 
 
 			return v;
 			return v;
 
 
-		}
+		};
 
 
 	}();
 	}();
 
 

+ 1 - 1
examples/js/controls/TrackballControls.js

@@ -579,7 +579,7 @@ THREE.TrackballControls = function ( object, domElement ) {
 		window.removeEventListener( 'keydown', keydown, false );
 		window.removeEventListener( 'keydown', keydown, false );
 		window.removeEventListener( 'keyup', keyup, false );
 		window.removeEventListener( 'keyup', keyup, false );
 
 
-	}
+	};
 
 
 	this.domElement.addEventListener( 'contextmenu', contextmenu, false );
 	this.domElement.addEventListener( 'contextmenu', contextmenu, false );
 	this.domElement.addEventListener( 'mousedown', mousedown, false );
 	this.domElement.addEventListener( 'mousedown', mousedown, false );

+ 5 - 29
examples/js/controls/VRControls.js

@@ -9,36 +9,8 @@ THREE.VRControls = function ( object, onError ) {
 
 
 	var vrInputs = [];
 	var vrInputs = [];
 
 
-	function filterInvalidDevices( devices ) {
-
-		// Exclude Cardboard position sensor if Oculus exists.
-
-		var oculusDevices = devices.filter( function ( device ) {
-
-			return device.deviceName.toLowerCase().indexOf( 'oculus' ) !== - 1;
-
-		} );
-
-		if ( oculusDevices.length >= 1 ) {
-
-			return devices.filter( function ( device ) {
-
-				return device.deviceName.toLowerCase().indexOf( 'cardboard' ) === - 1;
-
-			} );
-
-		} else {
-
-			return devices;
-
-		}
-
-	}
-
 	function gotVRDevices( devices ) {
 	function gotVRDevices( devices ) {
 
 
-		devices = filterInvalidDevices( devices );
-
 		for ( var i = 0; i < devices.length; i ++ ) {
 		for ( var i = 0; i < devices.length; i ++ ) {
 
 
 			if ( devices[ i ] instanceof PositionSensorVRDevice ) {
 			if ( devices[ i ] instanceof PositionSensorVRDevice ) {
@@ -49,7 +21,11 @@ THREE.VRControls = function ( object, onError ) {
 
 
 		}
 		}
 
 
-		if ( onError ) onError( 'HMD not available' );
+		if ( vrInputs.length === 0 ) {
+
+			if ( onError ) onError( 'PositionSensorVRDevice not available' );
+
+		}
 
 
 	}
 	}
 
 

+ 1 - 1
examples/js/crossfade/scenes.js

@@ -86,7 +86,7 @@ function Scene ( type, numObjects, cameraZ, fov, rotationSpeed, clearColor ) {
 	this.scene.add( light );
 	this.scene.add( light );
 
 
 	this.rotationSpeed = rotationSpeed;
 	this.rotationSpeed = rotationSpeed;
-	defaultMaterial = new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors	} );
+	defaultMaterial = new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } );
 	this.mesh = new THREE.Mesh( generateGeometry( type, numObjects ), defaultMaterial );
 	this.mesh = new THREE.Mesh( generateGeometry( type, numObjects ), defaultMaterial );
 	this.scene.add( this.mesh );
 	this.scene.add( this.mesh );
 
 

+ 28 - 28
examples/js/crossfade/transition.js

@@ -1,13 +1,13 @@
 function Transition ( sceneA, sceneB ) {
 function Transition ( sceneA, sceneB ) {
 
 
 	this.scene = new THREE.Scene();
 	this.scene = new THREE.Scene();
-	
+
 	this.cameraOrtho = new THREE.OrthographicCamera( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, - 10, 10 );
 	this.cameraOrtho = new THREE.OrthographicCamera( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, - 10, 10 );
 
 
 	this.textures = [];
 	this.textures = [];
 	for ( var i = 0; i < 6; i ++ )
 	for ( var i = 0; i < 6; i ++ )
-		this.textures[ i ] = new THREE.ImageUtils.loadTexture( 'textures/transition/transition' + ( i + 1 ) + '.png' );
-				
+		this.textures[ i ] = new THREE.TextureLoader().load( 'textures/transition/transition' + ( i + 1 ) + '.png' );
+
 	this.quadmaterial = new THREE.ShaderMaterial( {
 	this.quadmaterial = new THREE.ShaderMaterial( {
 
 
 		uniforms: {
 		uniforms: {
@@ -56,7 +56,7 @@ function Transition ( sceneA, sceneB ) {
 			"uniform sampler2D tDiffuse1;",
 			"uniform sampler2D tDiffuse1;",
 			"uniform sampler2D tDiffuse2;",
 			"uniform sampler2D tDiffuse2;",
 			"uniform sampler2D tMixTexture;",
 			"uniform sampler2D tMixTexture;",
-			
+
 			"uniform int useTexture;",
 			"uniform int useTexture;",
 			"uniform float threshold;",
 			"uniform float threshold;",
 
 
@@ -66,18 +66,18 @@ function Transition ( sceneA, sceneB ) {
 
 
 			"vec4 texel1 = texture2D( tDiffuse1, vUv );",
 			"vec4 texel1 = texture2D( tDiffuse1, vUv );",
 			"vec4 texel2 = texture2D( tDiffuse2, vUv );",
 			"vec4 texel2 = texture2D( tDiffuse2, vUv );",
-			
+
 			"if (useTexture==1) {",
 			"if (useTexture==1) {",
-				
+
 				"vec4 transitionTexel = texture2D( tMixTexture, vUv );",
 				"vec4 transitionTexel = texture2D( tMixTexture, vUv );",
 				"float r = mixRatio * (1.0 + threshold * 2.0) - threshold;",
 				"float r = mixRatio * (1.0 + threshold * 2.0) - threshold;",
 				"float mixf=clamp((transitionTexel.r - r)*(1.0/threshold), 0.0, 1.0);",
 				"float mixf=clamp((transitionTexel.r - r)*(1.0/threshold), 0.0, 1.0);",
-				
+
 				"gl_FragColor = mix( texel1, texel2, mixf );",
 				"gl_FragColor = mix( texel1, texel2, mixf );",
 			"} else {",
 			"} else {",
-				
+
 				"gl_FragColor = mix( texel2, texel1, mixRatio );",
 				"gl_FragColor = mix( texel2, texel1, mixRatio );",
-				
+
 			"}",
 			"}",
 		"}"
 		"}"
 
 
@@ -86,7 +86,7 @@ function Transition ( sceneA, sceneB ) {
 	} );
 	} );
 
 
 	quadgeometry = new THREE.PlaneBufferGeometry( window.innerWidth, window.innerHeight );
 	quadgeometry = new THREE.PlaneBufferGeometry( window.innerWidth, window.innerHeight );
-	
+
 	this.quad = new THREE.Mesh( quadgeometry, this.quadmaterial );
 	this.quad = new THREE.Mesh( quadgeometry, this.quadmaterial );
 	this.scene.add( this.quad );
 	this.scene.add( this.quad );
 
 
@@ -98,33 +98,33 @@ function Transition ( sceneA, sceneB ) {
 	this.quadmaterial.uniforms.tDiffuse2.value = sceneB.fbo;
 	this.quadmaterial.uniforms.tDiffuse2.value = sceneB.fbo;
 
 
 	this.needChange = false;
 	this.needChange = false;
-	
+
 	this.setTextureThreshold = function ( value ) {
 	this.setTextureThreshold = function ( value ) {
-	
+
 		this.quadmaterial.uniforms.threshold.value = value;
 		this.quadmaterial.uniforms.threshold.value = value;
 
 
 	};
 	};
-	
+
 	this.useTexture = function ( value ) {
 	this.useTexture = function ( value ) {
-	
+
 		this.quadmaterial.uniforms.useTexture.value = value ? 1 : 0;
 		this.quadmaterial.uniforms.useTexture.value = value ? 1 : 0;
 
 
 	};
 	};
-	
+
 	this.setTexture = function ( i ) {
 	this.setTexture = function ( i ) {
-		
+
 		this.quadmaterial.uniforms.tMixTexture.value = this.textures[ i ];
 		this.quadmaterial.uniforms.tMixTexture.value = this.textures[ i ];
-		
+
 	};
 	};
-	
+
 	this.render = function( delta ) {
 	this.render = function( delta ) {
-		
+
 		// Transition animation
 		// Transition animation
 		if ( transitionParams.animateTransition ) {
 		if ( transitionParams.animateTransition ) {
 
 
 			var t = ( 1 + Math.sin( transitionParams.transitionSpeed * clock.getElapsedTime() / Math.PI ) ) / 2;
 			var t = ( 1 + Math.sin( transitionParams.transitionSpeed * clock.getElapsedTime() / Math.PI ) ) / 2;
 			transitionParams.transition = THREE.Math.smoothstep( t, 0.3, 0.7 );
 			transitionParams.transition = THREE.Math.smoothstep( t, 0.3, 0.7 );
-			
+
 			// Change the current alpha texture after each transition
 			// Change the current alpha texture after each transition
 			if ( transitionParams.loopTexture && ( transitionParams.transition == 0 || transitionParams.transition == 1 ) ) {
 			if ( transitionParams.loopTexture && ( transitionParams.transition == 0 || transitionParams.transition == 1 ) ) {
 
 
@@ -138,24 +138,24 @@ function Transition ( sceneA, sceneB ) {
 
 
 			} else
 			} else
 				this.needChange = true;
 				this.needChange = true;
-				
+
 		}
 		}
-		
+
 		this.quadmaterial.uniforms.mixRatio.value = transitionParams.transition;
 		this.quadmaterial.uniforms.mixRatio.value = transitionParams.transition;
 
 
 		// Prevent render both scenes when it's not necessary
 		// Prevent render both scenes when it's not necessary
 		if ( transitionParams.transition == 0 ) {
 		if ( transitionParams.transition == 0 ) {
-			
+
 			this.sceneB.render( delta, false );
 			this.sceneB.render( delta, false );
-		
+
 		} else if ( transitionParams.transition == 1 ) {
 		} else if ( transitionParams.transition == 1 ) {
-		
+
 			this.sceneA.render( delta, false );
 			this.sceneA.render( delta, false );
-			
+
 		} else {
 		} else {
-			
+
 			// When 0<transition<1 render transition between two scenes
 			// When 0<transition<1 render transition between two scenes
-			
+
 			this.sceneA.render( delta, true );
 			this.sceneA.render( delta, true );
 			this.sceneB.render( delta, true );
 			this.sceneB.render( delta, true );
 			renderer.render( this.scene, this.cameraOrtho, null, true );
 			renderer.render( this.scene, this.cameraOrtho, null, true );

+ 8 - 83
examples/js/effects/AnaglyphEffect.js

@@ -6,21 +6,12 @@
 
 
 THREE.AnaglyphEffect = function ( renderer, width, height ) {
 THREE.AnaglyphEffect = function ( renderer, width, height ) {
 
 
-	var eyeRight = new THREE.Matrix4();
-	var eyeLeft = new THREE.Matrix4();
-	var focalLength = 125;
-	var _aspect, _near, _far, _fov;
-
-	var _cameraL = new THREE.PerspectiveCamera();
-	_cameraL.matrixAutoUpdate = false;
-
-	var _cameraR = new THREE.PerspectiveCamera();
-	_cameraR.matrixAutoUpdate = false;
-
 	var _camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
 	var _camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
 
 
 	var _scene = new THREE.Scene();
 	var _scene = new THREE.Scene();
 
 
+	var _stereo = new THREE.StereoCamera();
+
 	var _params = { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat };
 	var _params = { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat };
 
 
 	if ( width === undefined ) width = 512;
 	if ( width === undefined ) width = 512;
@@ -80,89 +71,23 @@ THREE.AnaglyphEffect = function ( renderer, width, height ) {
 
 
 	this.setSize = function ( width, height ) {
 	this.setSize = function ( width, height ) {
 
 
-		if ( _renderTargetL ) _renderTargetL.dispose();
-		if ( _renderTargetR ) _renderTargetR.dispose();
-		_renderTargetL = new THREE.WebGLRenderTarget( width, height, _params );
-		_renderTargetR = new THREE.WebGLRenderTarget( width, height, _params );
-
-		_material.uniforms[ "mapLeft" ].value = _renderTargetL;
-		_material.uniforms[ "mapRight" ].value = _renderTargetR;
+		_renderTargetL.setSize( width, height );
+		_renderTargetR.setSize( width, height );
 
 
 		renderer.setSize( width, height );
 		renderer.setSize( width, height );
 
 
 	};
 	};
 
 
-	/*
-	 * Renderer now uses an asymmetric perspective projection
-	 * (http://paulbourke.net/miscellaneous/stereographics/stereorender/).
-	 *
-	 * Each camera is offset by the eye seperation and its projection matrix is
-	 * also skewed asymetrically back to converge on the same projection plane.
-	 * Added a focal length parameter to, this is where the parallax is equal to 0.
-	 */
-
 	this.render = function ( scene, camera ) {
 	this.render = function ( scene, camera ) {
 
 
 		scene.updateMatrixWorld();
 		scene.updateMatrixWorld();
 
 
 		if ( camera.parent === null ) camera.updateMatrixWorld();
 		if ( camera.parent === null ) camera.updateMatrixWorld();
 
 
-		var hasCameraChanged = ( _aspect !== camera.aspect ) || ( _near !== camera.near ) || ( _far !== camera.far ) || ( _fov !== camera.fov );
-
-		if ( hasCameraChanged ) {
-
-			_aspect = camera.aspect;
-			_near = camera.near;
-			_far = camera.far;
-			_fov = camera.fov;
-
-			var projectionMatrix = camera.projectionMatrix.clone();
-			var eyeSep = focalLength / 30 * 0.5;
-			var eyeSepOnProjection = eyeSep * _near / focalLength;
-			var ymax = _near * Math.tan( THREE.Math.degToRad( _fov * 0.5 ) );
-			var xmin, xmax;
-
-			// translate xOffset
-
-			eyeRight.elements[ 12 ] = eyeSep;
-			eyeLeft.elements[ 12 ] = - eyeSep;
-
-			// for left eye
-
-			xmin = - ymax * _aspect + eyeSepOnProjection;
-			xmax = ymax * _aspect + eyeSepOnProjection;
-
-			projectionMatrix.elements[ 0 ] = 2 * _near / ( xmax - xmin );
-			projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );
-
-			_cameraL.projectionMatrix.copy( projectionMatrix );
-
-			// for right eye
-
-			xmin = - ymax * _aspect - eyeSepOnProjection;
-			xmax = ymax * _aspect - eyeSepOnProjection;
-
-			projectionMatrix.elements[ 0 ] = 2 * _near / ( xmax - xmin );
-			projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );
-
-			_cameraR.projectionMatrix.copy( projectionMatrix );
-
-		}
-
-		_cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( eyeLeft );
-		_cameraL.position.copy( camera.position );
-		_cameraL.near = camera.near;
-		_cameraL.far = camera.far;
-
-		renderer.render( scene, _cameraL, _renderTargetL, true );
-
-		_cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( eyeRight );
-		_cameraR.position.copy( camera.position );
-		_cameraR.near = camera.near;
-		_cameraR.far = camera.far;
-
-		renderer.render( scene, _cameraR, _renderTargetR, true );
+		_stereo.update( camera );
 
 
+		renderer.render( scene, _stereo.cameraL, _renderTargetL, true );
+		renderer.render( scene, _stereo.cameraR, _renderTargetR, true );
 		renderer.render( _scene, _camera );
 		renderer.render( _scene, _camera );
 
 
 	};
 	};
@@ -172,6 +97,6 @@ THREE.AnaglyphEffect = function ( renderer, width, height ) {
 		if ( _renderTargetL ) _renderTargetL.dispose();
 		if ( _renderTargetL ) _renderTargetL.dispose();
 		if ( _renderTargetR ) _renderTargetR.dispose();
 		if ( _renderTargetR ) _renderTargetR.dispose();
 
 
-	}
+	};
 
 
 };
 };

+ 102 - 0
examples/js/effects/CardboardEffect.js

@@ -0,0 +1,102 @@
+/**
+ * @author mrdoob / http://mrdoob.com/
+ */
+
+THREE.CardboardEffect = function ( renderer ) {
+
+	var _camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
+
+	var _scene = new THREE.Scene();
+
+	var _stereo = new THREE.StereoCamera();
+	_stereo.aspect = 0.5;
+
+	var _params = { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat };
+
+	var _renderTarget = new THREE.WebGLRenderTarget( 512, 512, _params );
+	_renderTarget.scissorTest = true;
+
+	// Distortion Mesh ported from:
+	// https://github.com/borismus/webvr-boilerplate/blob/master/src/distortion/barrel-distortion-fragment.js
+
+	var distortion = new THREE.Vector2( 0.441, 0.156 );
+
+	var geometry = new THREE.PlaneBufferGeometry( 1, 1, 10, 20 ).removeAttribute( 'normal' ).toNonIndexed();
+
+	var positions = geometry.attributes.position.array;
+	var uvs = geometry.attributes.uv.array;
+
+	// duplicate
+
+	var positions2 = new Float32Array( positions.length * 2 );
+	positions2.set( positions );
+	positions2.set( positions, positions.length );
+
+	var uvs2 = new Float32Array( uvs.length * 2 );
+	uvs2.set( uvs );
+	uvs2.set( uvs, uvs.length );
+
+	var vector = new THREE.Vector2();
+	var length = positions.length / 3;
+
+	for ( var i = 0, l = positions2.length / 3; i < l; i ++ ) {
+
+		vector.x = positions2[ i * 3 + 0 ];
+		vector.y = positions2[ i * 3 + 1 ];
+
+		var dot = vector.dot( vector );
+		var scalar = 1.5 + ( distortion.x + distortion.y * dot ) * dot;
+
+		var offset = i < length ? 0 : 1;
+
+		positions2[ i * 3 + 0 ] = ( vector.x / scalar ) * 1.5 - 0.5 + offset;
+		positions2[ i * 3 + 1 ] = ( vector.y / scalar ) * 3.0;
+
+		uvs2[ i * 2 ] = ( uvs2[ i * 2 ] + offset ) * 0.5;
+
+	}
+
+	geometry.attributes.position.array = positions2;
+	geometry.attributes.uv.array = uvs2;
+
+	//
+
+	// var material = new THREE.MeshBasicMaterial( { wireframe: true } );
+	var material = new THREE.MeshBasicMaterial( { map: _renderTarget } );
+	var mesh = new THREE.Mesh( geometry, material );
+	_scene.add( mesh );
+
+	//
+
+	this.setSize = function ( width, height ) {
+
+		_renderTarget.setSize( width, height );
+
+		renderer.setSize( width, height );
+
+	};
+
+	this.render = function ( scene, camera ) {
+
+		scene.updateMatrixWorld();
+
+		if ( camera.parent === null ) camera.updateMatrixWorld();
+
+		_stereo.update( camera );
+
+		var width = _renderTarget.width / 2;
+		var height = _renderTarget.height;
+
+		_renderTarget.scissor.set( 0, 0, width, height );
+		_renderTarget.viewport.set( 0, 0, width, height );
+		renderer.render( scene, _stereo.cameraL, _renderTarget );
+
+		_renderTarget.scissor.set( width, 0, width, height );
+		_renderTarget.viewport.set( width, 0, width, height );
+		renderer.render( scene, _stereo.cameraR, _renderTarget );
+
+		renderer.render( _scene, _camera );
+
+	};
+
+};

Some files were not shown because too many files changed in this diff