Browse Source

Merge branch 'dev'

Mr.doob 8 years ago
parent
commit
acdac7de18
100 changed files with 789 additions and 1525 deletions
  1. 60 37
      build/three.js
  2. 362 355
      build/three.min.js
  3. 60 37
      build/three.module.js
  4. 1 1
      docs/api/constants/CustomBlendingEquations.html
  5. 1 1
      docs/api/constants/Materials.html
  6. 1 1
      docs/api/constants/Renderer.html
  7. 8 3
      docs/api/constants/Textures.html
  8. 4 0
      docs/api/core/BufferAttribute.html
  9. 4 1
      docs/api/core/Object3D.html
  10. 2 2
      docs/api/extras/CurveUtils.html
  11. 6 6
      docs/api/extras/ShapeUtils.html
  12. 1 14
      docs/api/helpers/SkeletonHelper.html
  13. 1 1
      docs/api/helpers/SpotLightHelper.html
  14. 1 1
      docs/api/lights/DirectionalLight.html
  15. 1 1
      docs/api/loaders/AnimationLoader.html
  16. 1 1
      docs/api/loaders/AudioLoader.html
  17. 1 1
      docs/api/loaders/BufferGeometryLoader.html
  18. 1 1
      docs/api/loaders/CompressedTextureLoader.html
  19. 1 1
      docs/api/loaders/CubeTextureLoader.html
  20. 1 1
      docs/api/loaders/DataTextureLoader.html
  21. 3 3
      docs/api/loaders/FileLoader.html
  22. 1 1
      docs/api/loaders/FontLoader.html
  23. 1 1
      docs/api/loaders/JSONLoader.html
  24. 1 1
      docs/api/loaders/ObjectLoader.html
  25. 1 1
      docs/api/loaders/TextureLoader.html
  26. 10 3
      docs/api/materials/MeshBasicMaterial.html
  27. 6 2
      docs/api/materials/MeshLambertMaterial.html
  28. 10 3
      docs/api/materials/MeshPhongMaterial.html
  29. 11 3
      docs/api/materials/MeshStandardMaterial.html
  30. 4 13
      docs/api/math/Euler.html
  31. 1 1
      docs/api/math/Matrix4.html
  32. 9 0
      docs/api/math/Vector4.html
  33. 1 1
      docs/api/objects/Group.html
  34. 11 7
      docs/api/renderers/WebGLRenderer.html
  35. 11 2
      docs/api/textures/Texture.html
  36. 0 128
      docs/examples/collada/Animation.html
  37. 0 102
      docs/examples/collada/AnimationHandler.html
  38. 0 116
      docs/examples/collada/KeyFrameAnimation.html
  39. 1 1
      docs/examples/loaders/BabylonLoader.html
  40. 12 10
      docs/examples/loaders/GLTF2Loader.html
  41. 1 1
      docs/examples/loaders/MTLLoader.html
  42. 1 1
      docs/examples/loaders/OBJLoader.html
  43. 1 1
      docs/examples/loaders/OBJLoader2.html
  44. 1 1
      docs/examples/loaders/PCDLoader.html
  45. 1 1
      docs/examples/loaders/PDBLoader.html
  46. 1 1
      docs/examples/loaders/SVGLoader.html
  47. 1 1
      docs/examples/loaders/TGALoader.html
  48. 0 6
      docs/list.js
  49. 1 2
      docs/manual/introduction/Animation-system.html
  50. 9 9
      docs/manual/introduction/Creating-a-scene.html
  51. 1 1
      docs/manual/introduction/Creating-text.html
  52. 0 8
      docs/manual/introduction/Useful-links.html
  53. 1 1
      docs/manual/introduction/WebGL-compatibility-check.html
  54. 0 2
      docs/scenes/bones-browser.html
  55. 4 1
      editor/index.html
  56. 1 1
      editor/js/History.js
  57. 15 1
      editor/js/Loader.js
  58. 0 23
      editor/js/Viewport.js
  59. 1 241
      editor/js/libs/tern-threejs/threejs.js
  60. 1 0
      examples/canvas_ascii_effect.html
  61. 3 19
      examples/canvas_camera_orthographic.html
  62. 3 19
      examples/canvas_camera_orthographic2.html
  63. 15 18
      examples/canvas_geometry_birds.html
  64. 1 1
      examples/canvas_geometry_earth.html
  65. 1 1
      examples/canvas_geometry_nurbs.html
  66. 1 1
      examples/canvas_geometry_panorama.html
  67. 1 1
      examples/canvas_geometry_panorama_fisheye.html
  68. 1 1
      examples/canvas_geometry_shapes.html
  69. 1 1
      examples/canvas_geometry_terrain.html
  70. 1 1
      examples/canvas_interactive_cubes.html
  71. 1 1
      examples/canvas_interactive_cubes_tween.html
  72. 1 1
      examples/canvas_interactive_particles.html
  73. 3 19
      examples/canvas_interactive_voxelpainter.html
  74. 2 2
      examples/canvas_lights_pointlights.html
  75. 1 1
      examples/canvas_lines_colors.html
  76. 2 2
      examples/canvas_lines_colors_2d.html
  77. 1 1
      examples/canvas_lines_dashed.html
  78. 3 31
      examples/canvas_materials.html
  79. 2 2
      examples/canvas_materials_normal.html
  80. 2 2
      examples/canvas_materials_reflection.html
  81. 7 7
      examples/canvas_materials_video.html
  82. 1 1
      examples/canvas_morphtargets_horse.html
  83. 4 20
      examples/canvas_performance.html
  84. 15 160
      examples/canvas_sandbox.html
  85. 1 1
      examples/css3d_molecules.html
  86. 1 1
      examples/css3d_panorama.html
  87. 1 1
      examples/css3d_panorama_deviceorientation.html
  88. 1 1
      examples/css3d_periodictable.html
  89. 2 2
      examples/css3d_sandbox.html
  90. 1 1
      examples/css3d_sprites.html
  91. 1 0
      examples/css3d_youtube.html
  92. 13 6
      examples/files.js
  93. 1 1
      examples/js/Cloth.js
  94. 9 8
      examples/js/GPUParticleSystem.js
  95. 25 17
      examples/js/Mirror.js
  96. 1 1
      examples/js/TimelinerController.js
  97. 1 3
      examples/js/WaterShader.js
  98. 1 1
      examples/js/controls/EditorControls.js
  99. 2 0
      examples/js/controls/OrbitControls.js
  100. 2 0
      examples/js/controls/TrackballControls.js

File diff suppressed because it is too large
+ 60 - 37
build/three.js


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


File diff suppressed because it is too large
+ 60 - 37
build/three.module.js


+ 1 - 1
docs/api/constants/CustomBlendingEquations.html

@@ -22,7 +22,7 @@
 		material.blending = THREE.CustomBlending;
 		material.blendEquation = THREE.AddEquation; //default
 		material.blendSrc = THREE.SrcAlphaFactor; //default
-		material.blendDst = THREE.OneMinusDstAlphaFactor; //default
+		material.blendDst = THREE.OneMinusSrcAlphaFactor; //default
 		</code>
 
 		<h2>Blending Equations</h2>

+ 1 - 1
docs/api/constants/Materials.html

@@ -87,7 +87,7 @@
 		[page:Materials LessEqualDepth] is the default and will return true if the incoming pixel Z-depth is less than or equal to the current buffer Z-depth.<br />
 		[page:Materials GreaterEqualDepth] will return true if the incoming pixel Z-depth is greater than or equal to the current buffer Z-depth.<br />
 		[page:Materials GreaterDepth] will return true if the incoming pixel Z-depth is greater than the current buffer Z-depth.<br />
-		[page:Materials NotEqualDepth] will return true if the incoming pixel Z-depth is equal to the current buffer Z-depth.<br />
+		[page:Materials NotEqualDepth] will return true if the incoming pixel Z-depth is not equal to the current buffer Z-depth.<br />
 		</div>
 
 		<h2>Texture Combine Operations</h2>

+ 1 - 1
docs/api/constants/Renderer.html

@@ -33,7 +33,7 @@
 		<div>
 		These are used by the WebGLRenderer's [page:WebGLRenderer.setFaceCulling setFaceCulling] method.<br /><br />
 		[page:constant FrontFaceDirectionCW] sets the winding order for polygons to clockwise.<br />
-		[page:constant FrontFaceDirectionCW] sets the winding order for polygons to counter-clockwise (default).
+		[page:constant FrontFaceDirectionCCW] sets the winding order for polygons to counter-clockwise (default).
 		</div>
 
 		<h2>Shadow Types</h2>

+ 8 - 3
docs/api/constants/Textures.html

@@ -33,9 +33,14 @@
 		[page:Constant CubeReflectionMapping] is the default for a [page:CubeTexture CubeTexture]. <br /><br />
 
 		[page:Constant EquirectangularReflectionMapping] and [page:Constant EquirectangularRefractionMapping]
-		are for use with an equirectangular environment map.<br /><br />
-
-		[page:Constant SphericalReflectionMapping] is for use with a spherical reflection map.<br /><br />
+		are for use with an equirectangular environment map.  Also called a lat-long map, an equirectangular 
+		texture represents a 360-degree view along the horizontal centerline, and a 180-degree view along the 
+		vertical axis, with the top and bottom edges of the image corresponding to the north and south poles 
+		of a mapped sphere.<br /><br />
+
+		[page:Constant SphericalReflectionMapping] is for use with a spherical reflection map such as may be obtained
+		by cropping a photograph of a mirrored ball.  Sphere maps will be rendered "facing" the camera, irrespective
+		of the position of the camera relative to the cubemapped object or surface.<br /><br />
 
 		See the [example:webgl_materials_envmaps materials / envmaps] example.
 		</div>

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

@@ -78,6 +78,10 @@
 		<h3>[property:Integer itemSize]</h3>
 		<div>The length of vectors that are being stored in the [page:BufferAttribute.array array].</div>
 
+		<h3>[property:String name]</h3>
+		<div>
+		Optional name for this attribute instance. Default is an empty string.
+		</div>
 
 		<h3>[property:Boolean needsUpdate]</h3>
 		<div>

+ 4 - 1
docs/api/core/Object3D.html

@@ -196,7 +196,10 @@
 		</div>
 
 		<h3>[method:null applyMatrix]( [page:Matrix4 matrix] )</h3>
-		<div>This updates the position, rotation and scale with the matrix.</div>
+		<div>Applies the matrix transform to the object and updates the object's position, rotation and scale.</div>
+
+		<h3>[method:Object3D applyQuaternion]( [page:Quaternion quaternion] )</h3>
+		<div>Applies the rotation represented by the quaternion to the object.</div>
 
 		<h3>[method:Object3D clone]( [page:Boolean recursive] )</h3>
 		<div>

+ 2 - 2
docs/api/extras/CurveUtils.html

@@ -11,9 +11,9 @@
 		<h1>[name]</h1>
 
 		<div class="desc">
-		A class containing utility functions for curves.<br />
+		A class containing utility functions for curves.<br /><br />
 
-		Note that these are all linear functions so it is neccessary to calculate seperately for
+		Note that these are all linear functions so it is neccessary to calculate separately for
 		x, y (and z, w if present) components of a curve.
 		</div>
 

+ 6 - 6
docs/api/extras/ShapeUtils.html

@@ -11,10 +11,10 @@
 		<h1>[name]</h1>
 
 		<div class="desc">
-		A class containing utility functions for shapes.<br />
+		A class containing utility functions for shapes.<br /><br />
 
-		Note that these are all linear functions so it is neccessary to calculate seperately for
-		x, y (an z, w if present) components of a vector.
+		Note that these are all linear functions so it is neccessary to calculate separately for
+		x, y (and z, w if present) components of a vector.
 		</div>
 
 
@@ -33,7 +33,7 @@
 		t -- number<br />
 		p0, p1, p2 -- x, y, z or w components of a quadratic bezier curve.<br /><br />
 
-		Note that this is a linear function so it is neccessary to calculate seperately for
+		Note that this is a linear function so it is neccessary to calculate separately for
 		x, y (and z for 3D curves) components of a curve.<br /><br />
 
 		Used internally by [page:QuadraticBezierCurve QuadraticBezierCurve],
@@ -45,7 +45,7 @@
 		t -- number. <br />
 		p0, p1, p2, p3 -- x, y or z components of a cubic bezier curve..<br /><br />
 
-		Note that this is a linear function so it is neccessary to calculate seperately for
+		Note that this is a linear function so it is neccessary to calculate separately for
 		x, y (and z for 3D curves) components of a curve.<br /><br />
 
 		Used internally by [page:CubicBezierCurve CubicBezierCurve],
@@ -56,7 +56,7 @@
 		<div>
 		pts -- points defining a 2D polygon<br /><br />
 
-		Note that this is a linear function so it is neccessary to calculate seperately for
+		Note that this is a linear function so it is neccessary to calculate separately for
 		x, y  components of a polygon.<br /><br />
 
 		Used internally by [page:Path Path],

+ 1 - 14
docs/api/helpers/SkeletonHelper.html

@@ -53,20 +53,7 @@ scene.add( helper );
 		<div>
 		The object passed in the constructor.
 		</div>
-
-		<h2>Methods</h2>
-
-		<h3>[method:Array getBoneList]( object )</h3>
-		<div>
-		getBoneList -- the object used in the constructor.<br /><br />
-
-		This is called automatically to generate a list of bones from the object passed in the constructor.
-		</div>
-
-		<h3>[method:null update]()</h3>
-		<div>
-		Update the helper. Call in the render loop if animating the model.
-		</div>
+		
 
 		<h2>Source</h2>
 

+ 1 - 1
docs/api/helpers/SpotLightHelper.html

@@ -62,7 +62,7 @@
 		<h2>Methods</h2>
 		<div>See the base [page:Object3D] class for common methods.</div>
 
-		<h3>[method:null update]()</h3>
+		<h3>[method:null dispose]()</h3>
 		<div>Disposes of the light helper.</div>
 
 		<h3>[method:null update]()</h3>

+ 1 - 1
docs/api/lights/DirectionalLight.html

@@ -43,7 +43,7 @@
 			[example:canvas_morphtargets_horse morphtargets / horse ]<br />
 			[example:misc_controls_fly controls / fly ]<br />
 			[example:misc_lights_test lights / test ]<br />
-			[example:vr_cubes cubes ]<br />
+			[example:webvr_cubes cubes ]<br />
 			[example:webgl_effects_parallaxbarrier effects / parallaxbarrier ]<br />
 			[example:webgl_effects_stereo effects / stereo ]<br />
 			[example:webgl_geometry_extrude_splines geometry / extrude / splines ]<br />

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

@@ -63,7 +63,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Animation animation].<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called if load errors.<br /><br />
 
 		Begin loading from url and pass the loaded animation to onLoad.

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

@@ -82,7 +82,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded text response.<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

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

@@ -69,7 +69,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].d<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:BufferGeometry].<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

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

@@ -53,7 +53,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded texture.<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

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

@@ -76,7 +76,7 @@ scene.background = new THREE.CubeTextureLoader()
 		[page:String urls] — array of 6 urls to images, one for each side of the CubeTexture. These can also be
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URIs].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Texture texture].<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

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

@@ -49,7 +49,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded texture.<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 3 - 3
docs/api/loaders/FileLoader.html

@@ -12,7 +12,7 @@
 		<h1>[name]</h1>
 
 		<div class="desc">
-			A low level class for loading resources with XmlHttpRequest, used internaly by most loaders.
+			A low level class for loading resources with XMLHttpRequest, used internaly by most loaders.
 			It can also be used directly to load any file type that does not have a loader.
 		</div>
 
@@ -100,8 +100,8 @@ loader.load(
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when loading completes. The argument will be the loaded response.<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance,
-			that contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance,
+			which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called if an error occurs.<br /><br />
 
 		Load the URL and pass the response to the onLoad function.

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

@@ -71,7 +71,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Texture texture].<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br /><br />
 
 		Begin loading from url and pass the loaded [page:Texture texture] to onLoad.

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

@@ -74,7 +74,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI]..<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded text response.<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

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

@@ -99,7 +99,7 @@ scene.add( object );
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Object3D object].<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

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

@@ -86,7 +86,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Texture texture].<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br /><br />
 
 		Begin loading from url and pass the loaded [page:Texture texture] to onLoad.

+ 10 - 3
docs/api/materials/MeshBasicMaterial.html

@@ -63,7 +63,9 @@
 		</div>
 
 		<h3>[property:Texture aoMap]</h3>
-		<div>The ambient occlusion map. Default is null.</div>
+		<div>The red channel of this texture is used as the ambient occlusion map. Default is null. 
+		The aoMap requires a second set of UVs, and consequently will ignore the [page:Texture repeat]
+		and [page:Texture offset] Texture properties.</div>
 
 		<h3>[property:Float aoMapIntensity]</h3>
 		<div>Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.</div>
@@ -91,7 +93,9 @@
 		<div>The environment map. Default is null.</div>
 
 		<h3>[property:Texture lightMap]</h3>
-		<div>The light map. Default is null. The lightMap requires a second set of UVs.</div>
+		<div>The light map. Default is null. The lightMap requires a second set of UVs, 
+		and consequently will ignore the [page:Texture repeat] and [page:Texture offset] 
+		Texture properties.</div>
 
 		<h3>[property:Float lightMapIntensity]</h3>
 		<div>Intensity of the baked light. Default is 1.</div>
@@ -107,7 +111,10 @@
 
 
 		<h3>[property:Float reflectivity]</h3>
-		<div>How much the environment map affects the surface; also see [page:.combine].</div>
+		<div>
+			How much the environment map affects the surface; also see [page:.combine]. 
+			The default value is 1 and the valid range is between 0 (no reflections) and 1 (full reflections).
+		</div>
 
 		<h3>[property:Float refractionRatio]</h3>
 		<div>The index of refraction for an environment map using [page:Textures THREE.CubeRefractionMapping]. Default is *0.98*.</div>

+ 6 - 2
docs/api/materials/MeshLambertMaterial.html

@@ -74,7 +74,9 @@
 		</div>
 
 		<h3>[property:Texture aoMap]</h3>
-		<div>The ambient occlusion map. Default is null.</div>
+		<div>The red channel of this texture is used as the ambient occlusion map. Default is null. 
+		The aoMap requires a second set of UVs, and consequently will ignore the [page:Texture repeat]
+		and [page:Texture offset] Texture properties.</div>
 
 		<h3>[property:Float aoMapIntensity]</h3>
 		<div>Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.</div>
@@ -118,7 +120,9 @@
 		</div>
 
 		<h3>[property:Texture lightMap]</h3>
-		<div>The light map. Default is null. The lightMap requires a second set of UVs.</div>
+		<div>The light map. Default is null. The lightMap requires a second set of UVs, 
+		and consequently will ignore the [page:Texture repeat] and [page:Texture offset] 
+		Texture properties.</div>
 
 		<h3>[property:Float lightMapIntensity]</h3>
 		<div>Intensity of the baked light. Default is 1.</div>

+ 10 - 3
docs/api/materials/MeshPhongMaterial.html

@@ -73,7 +73,9 @@
 		</div>
 
 		<h3>[property:Texture aoMap]</h3>
-		<div>The ambient occlusion map. Default is null.</div>
+		<div>The red channel of this texture is used as the ambient occlusion map. Default is null. 
+		The aoMap requires a second set of UVs, and consequently will ignore the [page:Texture repeat]
+		and [page:Texture offset] Texture properties.</div>
 
 		<h3>[property:Float aoMapIntensity]</h3>
 		<div>Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.</div>
@@ -151,7 +153,9 @@
 
 
 		<h3>[property:Texture lightMap]</h3>
-		<div>The light map. Default is null. The lightMap requires a second set of UVs.</div>
+		<div>The light map. Default is null. The lightMap requires a second set of UVs, 
+		and consequently will ignore the [page:Texture repeat] and [page:Texture offset] 
+		Texture properties.</div>
 
 		<h3>[property:Float lightMapIntensity]</h3>
 		<div>Intensity of the baked light. Default is 1.</div>
@@ -182,7 +186,10 @@
 
 
 		<h3>[property:Float reflectivity]</h3>
-		<div>How much the environment map affects the surface; also see [page:.combine].</div>
+		<div>
+			How much the environment map affects the surface; also see [page:.combine]. 
+			The default value is 1 and the valid range is between 0 (no reflections) and 1 (full reflections).
+		</div>
 
 		<h3>[property:Float refractionRatio]</h3>
 		<div>The index of refraction for an environment map using [page:Textures THREE.CubeRefractionMapping]. Default is *0.98*.</div>

+ 11 - 3
docs/api/materials/MeshStandardMaterial.html

@@ -97,7 +97,9 @@
 		</div>
 
 		<h3>[property:Texture aoMap]</h3>
-		<div>The red channel of this texture is used as the ambient occlusion map. Default is null.</div>
+		<div>The red channel of this texture is used as the ambient occlusion map. Default is null. 
+		The aoMap requires a second set of UVs, and consequently will ignore the [page:Texture repeat]
+		and [page:Texture offset] Texture properties.</div>
 
 		<h3>[property:Float aoMapIntensity]</h3>
 		<div>Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.</div>
@@ -164,7 +166,11 @@
 		<div>Intensity of the emissive light. Modulates the emissive color. Default is 1.</div>
 
 		<h3>[property:TextureCube envMap]</h3>
-		<div>The environment map. Default is null.</div>
+		<div>The environment map. Default is null.  Note that in order for the material roughness 
+		property to correctly blur out the environment map, the shader must have access to mipmaps 
+		of the env texture.  TextureCubes created with default settings are correctly configured; 
+		if adjusting texture parameters manually, ensure minFilter is set to one of the MipMap options, 
+		and that mip maps have not been otherwise forcibly disabled.</div>
 
 		<h3>[property:Float envMapIntensity]</h3>
 		<div>Scales the effect of the environment map by multiplying its color.</div>
@@ -178,7 +184,9 @@
 
 
 		<h3>[property:Texture lightMap]</h3>
-		<div>The light map. Default is null. The lightMap requires a second set of UVs.</div>
+		<div>The light map. Default is null. The lightMap requires a second set of UVs, 
+		and consequently will ignore the [page:Texture repeat] and [page:Texture offset] 
+		Texture properties.</div>
 
 		<h3>[property:Float lightMapIntensity]</h3>
 		<div>Intensity of the baked light. Default is 1.</div>

+ 4 - 13
docs/api/math/Euler.html

@@ -54,19 +54,10 @@
 			rotated around its X axis, then its Y axis and finally its Z axis. Other possibilities are:
 			'YZX', 'ZXY', 'XZY', 'YXZ' and 'ZYX'. These must be in upper case.<br /><br />
 
-			Three.js uses <em>intrinsic</em> (Tait-Bryan) ordering, also known as <em>yaw</em>, <em>pitch</em>
-			and <em>roll</em>. This means that rotations are performed with respect to the <em>local</em>
-			coordinate system. That is, for order 'XYZ', the rotation is first around world-X, then around
-			local-Y (which may now be different from the world Y-axis), then local-Z (which may be different
-			from the world Z-axis).<br /><br />
-
-			Some implementations may use <em>extrinsic</em> (proper) ordering, in which case rotations are performed
-			with respect to the <em>world</em> coordinate system, so that for order 'XYZ', the rotations
-			are around world-X, world-Y, and world-Z.<br /><br />
-
-			Converting between the two types is relatively straightforward, you just need to reverse the order
-			and the rotation, so that an intrinsic (three.js) Euler rotation of angles a, b, c about XYZ
-			will be equivalent to to an extrinsic Euler rotation of angles c, b, a about ZYX.<br /><br />
+			Three.js uses <em>intrinsic</em> Tait-Bryan angles. This means that rotations are performed with respect
+			to the <em>local</em> coordinate system. That is, for order 'XYZ', the rotation is first around the local-X
+			axis (which is the same as the world-X axis), then around local-Y (which may now be different from the
+			world Y-axis), then local-Z (which may be different from the world Z-axis).<br /><br />
 
 			If the order is changed, [page:.onChangeCallback onChangeCallback] will be called.
 		</div>

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

@@ -75,7 +75,7 @@ m.elements = [ 11, 21, 31, 41,
 		and internally all calculations are performed using column-major ordering. However, as the actual ordering
 		makes no difference mathematically and most people are used to thinking about matrices in row-major order,
 		the three.js documentation shows matrices in row-major order. Just bear in mind that if you are reading the source
-		code, you'll have to take the [link: https://en.wikipedia.org/wiki/Transpose transpose] of any matrices outlined here to make sense of the calculations.
+		code, you'll have to take the [link:https://en.wikipedia.org/wiki/Transpose transpose] of any matrices outlined here to make sense of the calculations.
 		</div>
 
 

+ 9 - 0
docs/api/math/Vector4.html

@@ -110,6 +110,15 @@ var d = a.dot( b );
 		If this vector's x, y, z or w value is less than the min vector's x, y, z or w value, it is replaced by the corresponding value.
 		</div>
 
+		<h3>[method:Vector4 clampLength]( [page:Float min], [page:Float max] )</h3>
+		<div>
+		[page:Float min] - the minimum value the length will be clamped to <br />
+		[page:Float max] - the maximum value the length will be clamped to<br /><br />
+
+		If this vector's length is greater than the max value, it is replaced by the max value. <br /><br />
+		If this vector's length is less than the min value, it is replaced by the min value.
+		</div>
+
 		<h3>[method:Vector4 clampScalar]( [page:Float min], [page:Float max] )</h3>
 		<div>
 		[page:Float min] - the minimum value the components will be clamped to <br />

+ 1 - 1
docs/api/objects/Group.html

@@ -34,7 +34,7 @@
 		//These cubes can now be rotated / scaled etc as a group
 		var group = new THREE.Group();
 		group.add( cubeA );
-		group.add( cubeB )
+		group.add( cubeB );
 
 		scene.add( group );
 		</code>

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

@@ -212,6 +212,11 @@
 		Used internally by the renderer to keep track of various sub object properties.
 		</div>
 
+		<h3>[property:WebGLRenderLists renderLists]</h3>
+		<div>
+		Used internally to handle ordering of scene object rendering.
+		</div>
+
 		<h3>[property:WebGLShadowMap shadowMap]</h3>
 		<div>
 		This contains the reference to the shadow map, if used.
@@ -307,7 +312,7 @@
 
 		<h3>[method:null compile]( [page:Scene scene], [page:Camera camera] )</h3>
 		<div>Compiles all materials in the scene with the camera. This is useful to precompile shaders before the first rendering.</div>
-		
+
 		<h3>[method:null dispose]( )</h3>
 		<div>Dispose of the current rendering context.</div>
 
@@ -348,6 +353,9 @@
 		<h3>[method:Number getMaxAnisotropy]()</h3>
 		<div>This returns the anisotropy level of the textures.</div>
 
+		<h3>[method:Object getDrawingBufferSize]()</h3>
+		<div>Returns an object containing the width and height of the renderer's drawing buffer, in pixels.</div>
+
 		<h3>[method:number getPixelRatio]()</h3>
 		<div>Returns current device pixel ratio used.</div>
 
@@ -421,12 +429,8 @@
 
 		<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..<br /><br />
-
-		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.
+		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:Boolean supportsVertexTextures]()</h3>

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

@@ -130,12 +130,21 @@
 		<h3>[property:Vector2 offset]</h3>
 		<div>
 		How much a single repetition of the texture is offset from the beginning, in each direction U and V.
-		Typical range is *0.0* to *1.0*.
+		Typical range is *0.0* to *1.0*.  _Note:_ The offset property is a convenience modifier and only affects 
+		the Texture's application to the first set of UVs on a model.  If the Texture is used as a map requiring
+		additional UV sets (e.g. the aoMap or lightMap of most stock materials), those UVs must be manually 
+		assigned to achieve the desired offset.
 		</div>
 
 		<h3>[property:Vector2 repeat]</h3>
 		<div>
-		How many times the texture is repeated across the surface, in each direction U and V.
+		How many times the texture is repeated across the surface, in each direction U and V.  If repeat is set 
+		greater than 1 in either direction, the corresponding Wrap parameter should also be set to 
+		[page:Textures THREE.RepeatWrapping] or [page:Textures THREE.MirroredRepeatWrapping] to achieve the desired 
+		tiling effect.  _Note:_ The repeat property is a convenience modifier and only affects 
+		the Texture's application to the first set of UVs on a model.  If the Texture is used as a map requiring
+		additional UV sets (e.g. the aoMap or lightMap of most stock materials), those UVs must be manually 
+		assigned to achieve the desired repetiton.
 		</div>
 
 		<h3>[property:boolean generateMipmaps]</h3>

+ 0 - 128
docs/examples/collada/Animation.html

@@ -1,128 +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">This class animates an object based on an hierarchy. This hierarchy can be Object3ds or bones.</div>
-
-
-		<h2>Constructor</h2>
-
-
-		<h3>[name]([page:Object3d root], [page:String name])</h3>
-		<div>
-		root -- The mesh to animate. <br />
-		name -- The name of the animation.
-		</div>
-		<div>
-		Creates an animation for root. The animation data is gathered from AnimationHandler based on its name.
-		</div>
-
-		<h2>Properties</h2>
-
-		<h3>[property:Object3d root]</h3>
-		<div>
-		The root object of the animation.
-		</div>
-
-		<h3>[property:Object data]</h3>
-		<div>
-		The data containing the animation.
-		</div>
-
-		<h3>[property:Array hierarchy]</h3>
-		<div>
-		The objects that are influenced by the animation.
-		</div>
-
-		<h3>[property:number currentTime]</h3>
-		<div>
-		The time elapsed since the last start/restart of the animation.
-		</div>
-
-		<h3>[property:number timeScale]</h3>
-		<div>
-		How much to scale the speed of the animation. Defaults to 1.
-		</div>
-
-		<h3>[property:boolean isPlaying]</h3>
-		<div>
-		Indicates whether the animation is playing. This shouldn't be adapted by user code.
-		</div>
-
-		<h3>[property:boolean isPaused]</h3>
-		<div>
-		Indicates whether the animation is paused. This shouldn't be adapted by user code.
-		</div>
-
-		<h3>[property:boolean loop]</h3>
-		<div>
-		Set to make the animation restart when the animation ends.
-		</div>
-
-		<h3>[property:number interpolationType]</h3>
-		<div>
-		The type to indicate how to interpolate between 2 data points.
-		</div>
-
-		<h2>Methods</h2>
-
-		<h3>[method:null play]([page:Number startTime])</h3>
-		<div>
-		Starts the animation at the startTime (in seconds) of the animation.
-		</div>
-
-		<h3>[method:null stop]()</h3>
-		<div>
-		Stops the animation.
-		</div>
-
-		<h3>[method:Boolean update]([page:Number deltaTimeMS])</h3>
-		<div>
-		deltaTimeMS -- The time elapsed between the previous frame and this frame in milliseconds.
-		</div>
-		<div>
-		Updates the animation in time. This shouldn't be called by user code. The animationHandler calls this method.
-		</div>
-
-		<h3>[method:array interpolateCatmullRom]([page:Array points], [page:Number scale])</h3>
-		<div>
-		points -- The 4 control point to calculate CatMullRom. <br />
-		scale -- The scale between the previous key and the next key.
-		</div>
-		<div>
-		Interpolates the point based on the key. Is used in update.
-		</div>
-
-		<h3>[method:Object getNextKeyWith]([page:String type], [page:Object h], [page:Number key])</h3>
-		<div>
-		type -- The animationtype for the key. Can be "pos", "rot" and "scl".<br />
-		h -- The object of the hierarchy that contains the key. <br />
-		key -- The index of the next possible key.
-		</div>
-		<div>
-		Gets the next key. Is used in Update.
-		</div>
-
-		<h3>[method:Object getPrevKeyWith]([page:String type], [page:Object h], [page:Number key])</h3>
-		<div>
-		type -- The animationtype for the key. Can be "pos", "rot" and "scl".<br />
-		h -- The object of the hierarchy that contains the key. <br />
-		key -- The index of the prev possible key.
-		</div>
-		<div>
-		Gets the previous key. Is used in Update.
-		</div>
-
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/collada/[name].js examples/js/loaders/collada/[name].js]
-	</body>
-</html>

+ 0 - 102
docs/examples/collada/AnimationHandler.html

@@ -1,102 +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">
-		The AnimationHandler handles the initialisation of the Animation data and
-		the animations itself. It keeps track of every animation and if it's active or not.
-		It also update all animations which are active if its method *update* is called.
-		</div>
-
-
-		<h2>Constructor</h2>
-
-
-		<h3>[name]()</h3>
-		<div>
-		The animationHandler can't be called as constructor.
-		</div>
-
-		<h2>Properties</h2>
-
-
-		<h3>[property:number CATMULLROM]</h3>
-		<div>
-		Enum Value to indicate that the animation needs to be interpolated as CATMULLROM.
-		</div>
-
-		<h3>[property:number CATMULLROM_FORWARD]</h3>
-		<div>
-		Enum Value to indicate that the animation needs to be interpolated as CATMULLROM_FORWARD.
-		</div>
-
-		<h3>[property:number LINEAR]</h3>
-		<div>
-		Enum Value to indicate that the animation needs to be interpolated as LINEAR.
-		</div>
-
-		<h2>Methods</h2>
-
-
-
-		<h3>[method:null removeFromUpdate]([page:Animation animation])</h3>
-		<div>
-		animation -- The Animation to remove from the update.
-		</div>
-		<div>
-		Removes the animation from the update cycle. This gets called when the animation stops. This shouldn't be called by usercode.
-		</div>
-
-		<h3>[method:Object get]([page:String name])</h3>
-		<div>
-		name -- The name of the animationData
-		</div>
-		<div>
-		Gets the animationData from its library.
-		</div>
-
-		<h3>[method:null update]([page:Number deltaTimeMS]) </h3>
-		<div>
-		deltaTimeMS -- Time elapsed since last update in milliseconds.
-		</div>
-		<div>
-		Updates all active animations with deltaTime.
-		</div>
-
-		<h3>[method:null parse]([page:Object root])</h3>
-		<div>
-		root -- object
-		</div>
-		<div>
-		Parses the object to get the hierachy.
-		</div>
-
-		<h3>[method:null add]([page:object data])</h3>
-		<div>
-		data -- The animationData
-		</div>
-		<div>
-		Adds the animationData from its library.
-		</div>
-
-		<h3>[method:null addToUpdate]([page:Animation animation]) </h3>
-		<div>
-		animation -- The Animation to add from the update.
-		</div>
-		<div>
-		Adds the animation from the update cycle. This gets called when the animation starts. This shouldn't be called by user code.
-		</div>
-
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/collada/[name].js examples/js/loaders/collada/[name].js]
-	</body>
-</html>

+ 0 - 116
docs/examples/collada/KeyFrameAnimation.html

@@ -1,116 +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">Runs a keyframe animation as imported from the [page:ColladaLoader].</div>
-
-		<h2>Examples</h2>
-
-		<div>[example:webgl_loader_collada_keyframe loader / collada / keyframe ]</div>
-
-
-		<h2>Constructor</h2>
-
-
-		<h3>[name]([page:Object data])</h3>
-		<div>
-		data -- An individual animation object from a the [page:ColladaLoader], e.g. loadedColladaObj.animations[0] <br />
-		</div>
-		<div>
-		Creates a new keyframe animation and initializes it to the first keyframes.
-		</div>
-
-
-		<h2>Properties</h2>
-
-		<h3>[property:Object3D root]</h3>
-		<div>
-		The root object of the animation
-		</div>
-
-		<h3>[property:Object data]</h3>
-		<div>
-		The data containing the animation
-		</div>
-
-		<h3>[property:Array hierarchy]</h3>
-		<div>
-		The objects that are influenced by the animation.
-		</div>
-
-		<h3>[property:number currentTime]</h3>
-		<div>
-		The time elapsed since the last start/restart of the animation.
-		</div>
-
-		<h3>[property:number timeScale]</h3>
-		<div>
-		How much to scale the speed of the animation. Defaults to 1.
-		</div>
-
-		<h3>[property:boolean isPlaying]</h3>
-		<div>
-		Indicates whether the animation is playing. This shouldn't be adapted by user code.
-		</div>
-
-		<h3>[property:boolean isPaused]</h3>
-		<div>
-		Indicates whether the animation is paused. This shouldn't be adapted by user code.
-		</div>
-
-		<h3>[property:boolean loop]</h3>
-		<div>
-		Set to make the animation restart when the animation ends.
-		</div>
-
-		<h2>Methods</h2>
-
-		<h3>[method:null play]([page:Number startTime])</h3>
-		<div>
-		Starts the animation at the startTime (in seconds) of the animation.
-		</div>
-
-		<h3>[method:null stop]()</h3>
-		<div>
-		Stops the animation.
-		</div>
-
-		<h3>[method:null update]([page:Float deltaTime])</h3>
-		<div>
-		deltaTime -- The change in time in seconds
-		</div>
-		<div>
-		Updates the keyframe animation
-		</div>
-
-		<h3>[method:Object getNextKeyWith]([page:String sid], [page:Integer h], [page:Integer key])</h3>
-		<div>
-		sid -- The string id <br />
-		h -- The index in the heirarchy to use<br />
-		key -- The index of which key to start from
-		</div>
-		<div>
-		Used internally to traverse the animation
-		</div>
-
-		<h3>[method:Object getPrevKeyWith]([page:String sid], [page:Integer h], [page:Integer key])</h3>
-		<div>
-		sid -- The string id <br />
-		h -- The index in the heirarchy to use<br />
-		key -- The index of which key to start from
-		</div>
-		<div>
-		Used internally to traverse the animation
-		</div>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/collada/[name].js examples/js/loaders/collada/[name].js]
-	</body>
-</html>

+ 1 - 1
docs/examples/loaders/BabylonLoader.html

@@ -59,7 +59,7 @@
 		<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 12 - 10
docs/examples/loaders/GLTF2Loader.html

@@ -14,13 +14,12 @@
 		<div class="desc">
 		A loader for *glTF* 2.0 resources.
 		<br /><br />
-		<a href="https://www.khronos.org/gltf">glTF</a> (GL Transmission Format) is an open format
-		specification for efficient delivery and loading of 3D content. Assets may be provided either
-		in JSON (.gltf) or binary (.glb) format. External files store textures (.jpg, .png, ...) and
-		additional binary data (.bin). A glTF asset may deliver one or more scenes, including meshes,
-		materials, textures, shaders, skins, skeletons, animations, lights, and/or cameras. Morph target
-		animations are not yet finalized in the
-		<a href="https://github.com/KhronosGroup/glTF/tree/master/specification">glTF specification</a>.
+		<a href="https://www.khronos.org/gltf">glTF</a> (GL Transmission Format) is an
+		<a href="https://github.com/KhronosGroup/glTF/tree/master/specification/2.0">open format specification</a>
+		for efficient delivery and loading of 3D content. Assets may be provided either in JSON (.gltf)
+		or binary (.glb) format. External files store textures (.jpg, .png, ...) and additional binary
+		data (.bin). A glTF asset may deliver one or more scenes, including meshes, materials,
+		textures, shaders, skins, skeletons, morph targets, animations, lights, and/or cameras.
 		</div>
 
 		<h2>Extensions</h2>
@@ -31,15 +30,18 @@
 
 		<ul>
 			<li>
-				<a target="_blank" href="https://github.com/KhronosGroup/glTF/blob/master/extensions/Khronos/KHR_binary_glTF">
-					KHR_binary_glTF
-				</a>
+				KHR_lights
 			</li>
 			<li>
 				<a target="_blank" href="https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_materials_common">
 					KHR_materials_common
 				</a>
 			</li>
+			<li>
+				<a target="_blank" href="https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_materials_pbrSpecularGlossiness">
+					KHR_materials_pbrSpecularGlossiness
+				</a>
+			</li>
 		</ul>
 
 		<h2>Example</h2>

+ 1 - 1
docs/examples/loaders/MTLLoader.html

@@ -33,7 +33,7 @@
 		<div>
 			[page:String url] — required<br />
 			[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:MTLLoaderMaterialCreator MTLLoader.MaterialCreator] instance.<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 			[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/examples/loaders/OBJLoader.html

@@ -53,7 +53,7 @@
 		<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/examples/loaders/OBJLoader2.html

@@ -50,7 +50,7 @@
 		<div>
 			[page:String url] — URL of the file to load<br />
 			[page:Function onLoad] — Called after loading was successfully completed. The argument will be the loaded [page:Object3D].<br />
-			[page:Function onProgress] — Called to report progress of loading. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+			[page:Function onProgress] — Called to report progress of loading. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 			[page:Function onError]  Called after an error occurred during loading.<br />
 			[page:boolean useArrayBuffer] — Set this to false to force string based parsing<br />
 		</div>

+ 1 - 1
docs/examples/loaders/PCDLoader.html

@@ -58,7 +58,7 @@
 		<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/examples/loaders/PDBLoader.html

@@ -64,7 +64,7 @@
 		<div>
 		[page:String url] — required. URL to the <em>.pdb</em> file<br />
 		[page:Function onLoad] — Will be called when load completes. The arguments will be an [page:BufferGeometry geometryAtoms], [page:BufferGeometry geometryBonds] and the [page:Object JSON] structure.<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/examples/loaders/SVGLoader.html

@@ -33,7 +33,7 @@
 		<div>
 		[page:String url] — required<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:SVGDocument].<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/examples/loaders/TGALoader.html

@@ -62,7 +62,7 @@
 		<div>
 		[page:String url] — required<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:DataTexture].<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 onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 0 - 6
docs/list.js

@@ -332,12 +332,6 @@ var list = {
 
 	"Examples": {
 
-		"Collada Animation": {
-			"ColladaAnimation": "examples/collada/Animation",
-			"AnimationHandler": "examples/collada/AnimationHandler",
-			"KeyFrameAnimation": "examples/collada/KeyFrameAnimation"
-		},
-
 		"Geometries": {
 			"ConvexBufferGeometry": "examples/geometries/ConvexBufferGeometry",
 			"ConvexGeometry": "examples/geometries/ConvexGeometry"

+ 1 - 2
docs/manual/introduction/Animation-system.html

@@ -94,7 +94,7 @@
 		<div class="desc">
 
 			If you want a group of objects to receive a shared animation state, you can use an
-			[page:AnimationObjectGroup]. 
+			[page:AnimationObjectGroup].
 
 		</div>
 
@@ -111,7 +111,6 @@
 				<li>[page:ObjectLoader THREE.ObjectLoader]</li>
 				<li>THREE.BVHLoader</li>
 				<li>THREE.FBXLoader</li>
-				<li>THREE.FBXLoader2</li>
 				<li>[page:GLTF2Loader THREE.GLTF2Loader]</li>
 				<li>THREE.MMDLoader</li>
 				<li>THREE.SEA3DLoader</li>

+ 9 - 9
docs/manual/introduction/Creating-a-scene.html

@@ -86,14 +86,14 @@
 
 		<h2>Rendering the scene</h2>
 
-		<div>If you copied the code from above into the HTML file we created earlier, you wouldn't be able to see anything. This is because we're not actually rendering anything yet. For that, we need what's called a <strong>render loop</strong>.</div>
+		<div>If you copied the code from above into the HTML file we created earlier, you wouldn't be able to see anything. This is because we're not actually rendering anything yet. For that, we need what's called a <strong>render or animate loop</strong>.</div>
 
 		<code>
-		function render() {
-			requestAnimationFrame( render );
+		function animate() {
+			requestAnimationFrame( animate );
 			renderer.render( scene, camera );
 		}
-		render();
+		animate();
 		</code>
 
 		<div>This will create a loop that causes the renderer to draw the scene 60 times per second. If you're new to writing games in the browser, you might say "why don't we just  create a <strong>setInterval</strong>? The thing is - we could, but <strong>requestAnimationFrame</strong> has a number of advantages. Perhaps the most important one is that it pauses when the user navigates to another browser tab, hence not wasting their precious processing power and battery life.</div>
@@ -102,14 +102,14 @@
 
 		<div>If you insert all the code above into the file you created before we began, you should see a green box. Let's make it all a little more interesting by rotating it.</div>
 
-		<div>Add the following right above the <strong>renderer.render</strong> call in your <strong>render</strong> function:</div>
+		<div>Add the following right above the <strong>renderer.render</strong> call in your <strong>animate</strong> function:</div>
 
 		<code>
 		cube.rotation.x += 0.1;
 		cube.rotation.y += 0.1;
 		</code>
 
-		<div>This will be run every frame (60 times per second), and give the cube a nice rotation animation. Basically, anything you want to move or change while the app is running has to go through the render loop. You can of course call other functions from there, so that you don't end up with a <strong>render</strong> function that's hundreds of lines.
+		<div>This will be run every frame (60 times per second), and give the cube a nice rotation animation. Basically, anything you want to move or change while the app is running has to go through the animate loop. You can of course call other functions from there, so that you don't end up with a <strong>animate</strong> function that's hundreds of lines.
 		</div>
 
 		<h2>The result</h2>
@@ -143,8 +143,8 @@
 
 					camera.position.z = 5;
 
-					var render = function () {
-						requestAnimationFrame( render );
+					var animate = function () {
+						requestAnimationFrame( animate );
 
 						cube.rotation.x += 0.1;
 						cube.rotation.y += 0.1;
@@ -152,7 +152,7 @@
 						renderer.render(scene, camera);
 					};
 
-					render();
+					animate();
 				&lt;/script&gt;
 			&lt;/body&gt;
 		&lt;/html&gt;

+ 1 - 1
docs/manual/introduction/Creating-text.html

@@ -68,7 +68,7 @@
 				<code>new THREE.TextGeometry( text, parameters );</code>
 			</p>
 			<p>
-				In order for this to work, however, your TextGeomety will need an instance of THREE.Font 
+				In order for this to work, however, your TextGeometry will need an instance of THREE.Font 
 				to be set on its "font" parameter.
 
 				See the [page:TextGeometry] page for more info on how this can be done, descriptions of each

+ 0 - 8
docs/manual/introduction/Useful-links.html

@@ -73,14 +73,6 @@
 
 		</ul>
 
-
-		<h2>More documentation</h2>
-		<ul>
-			<li>
-				[link:http://ushiroad.com/3j/ Three.js walking map] - a graphical breakdown of the structure of a three.js scene.
-			</li>
-		</ul>
-
 		<h2>News and Updates</h2>
 		<ul>
 			<li>

+ 1 - 1
docs/manual/introduction/WebGL-compatibility-check.html

@@ -21,7 +21,7 @@
 
 <code>
 if (Detector.webgl) {
-    init();
+    // Initiate function or other initializations here
     animate();
 } else {
     var warning = Detector.getWebGLErrorMessage();

+ 0 - 2
docs/scenes/bones-browser.html

@@ -253,8 +253,6 @@
 
 				}
 
-				skeletonHelper.update();
-
 				renderer.render( scene, camera );
 
 			}

+ 4 - 1
editor/index.html

@@ -16,11 +16,13 @@
 		<script src="../examples/js/controls/TransformControls.js"></script>
 
 		<script src="../examples/js/libs/jszip.min.js"></script>
+		<script src="../examples/js/libs/inflate.min.js"></script> <!-- FBX -->
+
 		<script src="../examples/js/loaders/AMFLoader.js"></script>
 		<script src="../examples/js/loaders/AWDLoader.js"></script>
 		<script src="../examples/js/loaders/BabylonLoader.js"></script>
 		<script src="../examples/js/loaders/ColladaLoader2.js"></script>
-		<script src="../examples/js/loaders/FBXLoader2.js"></script>
+		<script src="../examples/js/loaders/FBXLoader.js"></script>
 		<script src="../examples/js/loaders/GLTFLoader.js"></script>
 		<script src="../examples/js/loaders/KMZLoader.js"></script>
 		<script src="../examples/js/loaders/MD2Loader.js"></script>
@@ -29,6 +31,7 @@
 		<script src="../examples/js/loaders/PLYLoader.js"></script>
 		<script src="../examples/js/loaders/STLLoader.js"></script>
 		<script src="../examples/js/loaders/TGALoader.js"></script>
+		<script src="../examples/js/loaders/TDSLoader.js"></script>
 		<script src="../examples/js/loaders/UTF8Loader.js"></script>
 		<script src="../examples/js/loaders/VRMLLoader.js"></script>
 		<script src="../examples/js/loaders/VTKLoader.js"></script>

+ 1 - 1
editor/js/History.js

@@ -273,7 +273,7 @@ History.prototype = {
 
 				if ( cmd === undefined || id === cmd.id ) break;
 
-				cmd = this.undo();
+				this.undo();
 
 			}
 

+ 15 - 1
editor/js/Loader.js

@@ -25,6 +25,20 @@ var Loader = function ( editor ) {
 
 		switch ( extension ) {
 
+			case '3ds':
+
+				reader.addEventListener( 'load', function ( event ) {
+
+					var loader = new THREE.TDSLoader();
+					var object = loader.parse( event.target.result );
+
+					editor.execute( new AddObjectCommand( object ) );
+
+				}, false );
+				reader.readAsArrayBuffer( file );
+
+				break;
+
 			case 'amf':
 
 				reader.addEventListener( 'load', function ( event ) {
@@ -151,7 +165,7 @@ var Loader = function ( editor ) {
 					editor.execute( new AddObjectCommand( object ) );
 
 				}, false );
-				reader.readAsText( file );
+				reader.readAsArrayBuffer( file );
 
 				break;
 

+ 0 - 23
editor/js/Viewport.js

@@ -561,29 +561,6 @@ var Viewport = function ( editor ) {
 
 		requestAnimationFrame( animate );
 
-		/*
-
-		// animations
-
-		if ( THREE.AnimationHandler.animations.length > 0 ) {
-
-			THREE.AnimationHandler.update( 0.016 );
-
-			for ( var i = 0, l = sceneHelpers.children.length; i < l; i ++ ) {
-
-				var helper = sceneHelpers.children[ i ];
-
-				if ( helper instanceof THREE.SkeletonHelper ) {
-
-					helper.update();
-
-				}
-
-			}
-
-		}
-		*/
-
 		if ( vrEffect && vrEffect.isPresenting ) {
 
 			render();

+ 1 - 241
editor/js/libs/tern-threejs/threejs.js

@@ -969,246 +969,6 @@
       },
       "!doc": "A class containing useful utility functions for scene manipulation."
     },
-    "Animation": {
-      "!url": "http://threejs.org/docs/#Reference/extras/collada-animation/Animation",
-      "prototype": {
-        "root": {
-          "!type": "Object3d",
-          "!doc": "The root object of the animation."
-        },
-        "data": {
-          "!type": "object",
-          "!doc": "The data containing the animation"
-        },
-        "hierarchy": {
-          "!type": "[]",
-          "!doc": "The objects that are influenced by the animation."
-        },
-        "currentTime": {
-          "!type": "number",
-          "!doc": "The time elapsed since the last start/restart of the animation."
-        },
-        "timeScale": {
-          "!type": "number",
-          "!doc": "The timez"
-        },
-        "isPlaying": {
-          "!type": "boolean",
-          "!doc": "Indicates whether the animation is playing. This shouldn't be adapted by user code."
-        },
-        "isPaused": {
-          "!type": "boolean",
-          "!doc": "Indicates whether the animation is paused. This shouldn't be adapted by user code."
-        },
-        "loop": {
-          "!type": "boolean",
-          "!doc": "Set to make the animation restart when the animation ends."
-        },
-        "interpolationType": {
-          "!type": "number",
-          "!doc": "The type to indicate how to interpolate between 2 data points."
-        },
-        "play": {
-          "!type": "fn(startTime: number)",
-          "!doc": "Starts the animation from a moment startTime in the animation."
-        },
-        "stop": {
-          "!type": "fn()",
-          "!doc": "Stops the animation."
-        },
-        "update": {
-          "!type": "fn(deltaTimeMS: number) -> bool",
-          "!doc": "Updates the animation in time. This shouldn't be called by user code. The animationHandler calls this method."
-        },
-        "interpolateCatmullRom": {
-          "!type": "fn(points: [], scale: number) -> array",
-          "!doc": "Interpolates the point based on the key. Is used in update."
-        },
-        "getNextKeyWith": {
-          "!type": "fn(type: string, h: object, key: number) -> object",
-          "!doc": "Gets the next key. Is used in Update."
-        },
-        "getPrevKeyWith": {
-          "!type": "fn(type: string, h: object, key: number) -> object",
-          "!doc": "Gets the previous key. Is used in Update."
-        }
-      },
-      "!doc": "This class animates an object based on an hierarchy. This hierarchy can be Object3ds or bones.",
-      "!type": "fn(root: Object3d, name: string)"
-    },
-    "AnimationHandler": {
-      "!url": "http://threejs.org/docs/#Reference/extras/collada-animation/AnimationHandler",
-      "prototype": {
-        "CATMULLROM": {
-          "!type": "number",
-          "!doc": "Enum Value to indicate that the animation needs to be interpolated as CATMULLROM."
-        },
-        "CATMULLROM_FORWARD": {
-          "!type": "number",
-          "!doc": "Enum Value to indicate that the animation needs to be interpolated as CATMULLROM_FORWARD."
-        },
-        "LINEAR": {
-          "!type": "number",
-          "!doc": "Enum Value to indicate that the animation needs to be interpolated as LINEAR."
-        },
-        "removeFromUpdate": {
-          "!type": "fn(animation: +THREE.Animation)",
-          "!doc": "Removes the animation from the update cycle. This gets called when the animation stops. This shouldn't be called by usercode."
-        },
-        "get": {
-          "!type": "fn(name: string) -> object",
-          "!doc": "Gets the animationData from its library."
-        },
-        "update": {
-          "!type": "fn(deltaTimeMS: number)",
-          "!doc": "Updates all active animations with deltaTime."
-        },
-        "parse": {
-          "!type": "fn(root: object)",
-          "!doc": "Parses the object to get the hierachy."
-        },
-        "add": {
-          "!type": "fn(data: object)",
-          "!doc": "Adds the animationData from its library."
-        },
-        "addToUpdate": {
-          "!type": "fn(animation: +THREE.Animation)",
-          "!doc": "Adds the animation from the update cycle. This gets called when the animation starts. This shouldn't be called by user code."
-        }
-      },
-      "!doc": "The AnimationHandler handles the initialisation of the Animation data and \n\t\tthe animations itself. It keeps track of every animation and if it's active or not.\n\t\tIt also update all animations which are active if its method *update* is called.",
-      "!type": "fn()"
-    },
-    "AnimationMorphTarget": {
-      "!url": "http://threejs.org/docs/#Reference/extras/collada-animation/AnimationMorphTarget",
-      "prototype": {
-        "root": {
-          "!type": "todo",
-          "!doc": "todo"
-        },
-        "data": {
-          "!type": "todo",
-          "!doc": "todo"
-        },
-        "hierarchy": {
-          "!type": "todo",
-          "!doc": "todo"
-        },
-        "currentTime": {
-          "!type": "number",
-          "!doc": "todo"
-        },
-        "timeScale": {
-          "!type": "number",
-          "!doc": "todo"
-        },
-        "isPlaying": {
-          "!type": "boolean",
-          "!doc": "todo"
-        },
-        "isPaused": {
-          "!type": "boolean",
-          "!doc": "todo"
-        },
-        "loop": {
-          "!type": "boolean",
-          "!doc": "todo"
-        },
-        "influence": {
-          "!type": "number",
-          "!doc": "todo"
-        },
-        "play": {
-          "!type": "fn() -> todo",
-          "!doc": "todo"
-        },
-        "pause": {
-          "!type": "fn() -> todo",
-          "!doc": "todo"
-        },
-        "stop": {
-          "!type": "fn() -> todo",
-          "!doc": "todo"
-        },
-        "update": {
-          "!type": "fn(deltaTimeMS: todo) -> todo",
-          "!doc": "todo"
-        }
-      },
-      "!doc": "todo",
-      "!type": "fn(root: todo, data: todo)"
-    },
-    "KeyFrameAnimation": {
-      "!url": "http://threejs.org/docs/#Reference/extras/collada-animation/KeyFrameAnimation",
-      "prototype": {
-        "root": {
-          "!type": "todo",
-          "!doc": "todo"
-        },
-        "data": {
-          "!type": "todo",
-          "!doc": "todo"
-        },
-        "hierarchy": {
-          "!type": "todo",
-          "!doc": "todo"
-        },
-        "currentTime": {
-          "!type": "number",
-          "!doc": "todo"
-        },
-        "timeScale": {
-          "!type": "number",
-          "!doc": "todo"
-        },
-        "isPlaying": {
-          "!type": "boolean",
-          "!doc": "todo"
-        },
-        "isPaused": {
-          "!type": "boolean",
-          "!doc": "todo"
-        },
-        "loop": {
-          "!type": "boolean",
-          "!doc": "todo"
-        },
-        "JITCompile": {
-          "!type": "boolean",
-          "!doc": "todo"
-        },
-        "play": {
-          "!type": "fn() -> todo",
-          "!doc": "todo"
-        },
-        "pause": {
-          "!type": "fn() -> todo",
-          "!doc": "todo"
-        },
-        "stop": {
-          "!type": "fn() -> todo",
-          "!doc": "todo"
-        },
-        "update": {
-          "!type": "fn(deltaTimeMS: todo) -> todo",
-          "!doc": "todo"
-        },
-        "interpolateCatmullRom": {
-          "!type": "fn(points: todo, scale: todo) -> todo",
-          "!doc": "todo"
-        },
-        "getNextKeyWith": {
-          "!type": "fn(sid: todo, h: todo, key: todo) -> todo",
-          "!doc": "todo"
-        },
-        "getPrevKeyWith": {
-          "!type": "fn(sid: todo, h: todo, key: todo) -> todo",
-          "!doc": "todo"
-        }
-      },
-      "!doc": "todo",
-      "!type": "fn(root: todo, data: todo, JITCompile: todo)"
-    },
     "Curve": {
       "!url": "http://threejs.org/docs/#Reference/extras/core/Curve",
       "prototype": {
@@ -2523,7 +2283,7 @@
           "!doc": "[page:String value] — the empty string (default), \"arraybuffer\", \"blob\", \"document\", \"json\", or \"text\"."
         }
       },
-      "!doc": "A low level class for loading resources with XmlHttpRequest, used internaly by most loaders.",
+      "!doc": "A low level class for loading resources with XMLHttpRequest, used internaly by most loaders.",
       "!type": "fn(manager: +THREE.LoadingManager)"
     },
     "GLTFLoader": {

+ 1 - 0
examples/canvas_ascii_effect.html

@@ -30,6 +30,7 @@
 			var container, stats;
 
 			var camera, controls, scene, renderer;
+			var effect;
 
 			var sphere, plane;
 

+ 3 - 19
examples/canvas_camera_orthographic.html

@@ -40,7 +40,7 @@
 				info.style.top = '10px';
 				info.style.width = '100%';
 				info.style.textAlign = 'center';
-				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> - orthographic view';
+				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - orthographic view';
 				container.appendChild( info );
 
 				camera = new THREE.OrthographicCamera( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, - 500, 1000 );
@@ -52,24 +52,8 @@
 
 				// Grid
 
-				var size = 500, step = 50;
-
-				var geometry = new THREE.Geometry();
-
-				for ( var i = - size; i <= size; i += step ) {
-
-					geometry.vertices.push( new THREE.Vector3( - size, 0, i ) );
-					geometry.vertices.push( new THREE.Vector3(   size, 0, i ) );
-
-					geometry.vertices.push( new THREE.Vector3( i, 0, - size ) );
-					geometry.vertices.push( new THREE.Vector3( i, 0,   size ) );
-
-				}
-
-				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } );
-
-				var line = new THREE.LineSegments( geometry, material );
-				scene.add( line );
+				var gridHelper = new THREE.GridHelper( 1000, 20 );
+				scene.add( gridHelper );
 
 				// Cubes
 

+ 3 - 19
examples/canvas_camera_orthographic2.html

@@ -30,7 +30,7 @@
 		<script src="js/libs/stats.min.js"></script>
 
 		<div style="position: absolute; top: 10px; width: 100%; text-align: center; ">
-			<a href="http://threejs.org" target="_blank">three.js</a> - Combo Camera<br>
+			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - Combo Camera<br>
 			View: <a href="#" onclick="setOrthographic();return false;"> Orthographic</a> |
 				<a href="#" onclick="setPerspective();return false;">Perspective</a><br>
 			Lens: <a href="#" onclick="setLens(12);return false;">12mm</a> |
@@ -121,24 +121,8 @@
 
 				// Grid
 
-				var size = 500, step = 50;
-
-				var geometry = new THREE.Geometry();
-
-				for ( var i = - size; i <= size; i += step ) {
-
-					geometry.vertices.push( new THREE.Vector3( - size, 0, i ) );
-					geometry.vertices.push( new THREE.Vector3(   size, 0, i ) );
-
-					geometry.vertices.push( new THREE.Vector3( i, 0, - size ) );
-					geometry.vertices.push( new THREE.Vector3( i, 0,   size ) );
-
-				}
-
-				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } );
-
-				var line = new THREE.LineSegments( geometry, material );
-				scene.add( line );
+				var gridHelper = new THREE.GridHelper( 1000, 20 );
+				scene.add( gridHelper );
 
 				// Cubes
 

+ 15 - 18
examples/canvas_geometry_birds.html

@@ -26,7 +26,7 @@
 	<body>
 
 		<div id="container"></div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - birds demo</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - birds demo</div>
 
 		<script src="../build/three.js"></script>
 
@@ -209,16 +209,15 @@
 
 				this.alignment = function ( boids ) {
 
-					var boid, velSum = new THREE.Vector3(),
-					count = 0;
+					var count = 0;
+					var velSum = new THREE.Vector3();
 
 					for ( var i = 0, il = boids.length; i < il; i++ ) {
 
 						if ( Math.random() > 0.6 ) continue;
 
-						boid = boids[ i ];
-
-						distance = boid.position.distanceTo( this.position );
+						var boid = boids[ i ];
+						var distance = boid.position.distanceTo( this.position );
 
 						if ( distance > 0 && distance <= _neighborhoodRadius ) {
 
@@ -249,17 +248,16 @@
 
 				this.cohesion = function ( boids ) {
 
-					var boid, distance,
-					posSum = new THREE.Vector3(),
-					steer = new THREE.Vector3(),
-					count = 0;
+					var count = 0;
+					var posSum = new THREE.Vector3();
+					var steer = new THREE.Vector3();
 
 					for ( var i = 0, il = boids.length; i < il; i ++ ) {
 
 						if ( Math.random() > 0.6 ) continue;
 
-						boid = boids[ i ];
-						distance = boid.position.distanceTo( this.position );
+						var boid = boids[ i ];
+						var distance = boid.position.distanceTo( this.position );
 
 						if ( distance > 0 && distance <= _neighborhoodRadius ) {
 
@@ -292,16 +290,15 @@
 
 				this.separation = function ( boids ) {
 
-					var boid, distance,
-					posSum = new THREE.Vector3(),
-					repulse = new THREE.Vector3();
+					var posSum = new THREE.Vector3();
+					var repulse = new THREE.Vector3();
 
 					for ( var i = 0, il = boids.length; i < il; i ++ ) {
 
 						if ( Math.random() > 0.6 ) continue;
 
-						boid = boids[ i ];
-						distance = boid.position.distanceTo( this.position );
+						var boid = boids[ i ];
+						var distance = boid.position.distanceTo( this.position );
 
 						if ( distance > 0 && distance <= _neighborhoodRadius ) {
 
@@ -432,7 +429,7 @@
 					bird = birds[ i ];
 					bird.position.copy( boids[ i ].position );
 
-					color = bird.material.color;
+					var color = bird.material.color;
 					color.r = color.g = color.b = ( 500 - bird.position.z ) / 1000;
 
 					bird.rotation.y = Math.atan2( - boid.velocity.z, boid.velocity.x );

+ 1 - 1
examples/canvas_geometry_earth.html

@@ -32,7 +32,7 @@
 	<body>
 
 		<div id="container"></div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - earth demo</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - earth demo</div>
 
 		<script src="../build/three.js"></script>
 

+ 1 - 1
examples/canvas_geometry_nurbs.html

@@ -23,7 +23,7 @@
 	<body>
 		<canvas id="debug" style="position:absolute; left:100px"></canvas>
 
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - NURBS curve example</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - NURBS curve example</div>
 
 		<script src="../build/three.js"></script>
 

+ 1 - 1
examples/canvas_geometry_panorama.html

@@ -30,7 +30,7 @@
 	<body>
 
 		<div id="container"></div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - panorama demo. cubemap by <a href="http://www.zfight.com/" target="_blank">Jochum Skoglund</a>.</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - panorama demo. cubemap by <a href="http://www.zfight.com/" target="_blank" rel="noopener">Jochum Skoglund</a>.</div>
 
 		<script src="../build/three.js"></script>
 

+ 1 - 1
examples/canvas_geometry_panorama_fisheye.html

@@ -30,7 +30,7 @@
 	<body>
 
 		<div id="container"></div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - panorama fisheye demo. cubemap by <a href="http://www.zfight.com/" target="_blank">Jochum Skoglund</a>. (mousewheel: change fov)</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - panorama fisheye demo. cubemap by <a href="http://www.zfight.com/" target="_blank" rel="noopener">Jochum Skoglund</a>. (mousewheel: change fov)</div>
 
 		<script src="../build/three.js"></script>
 

+ 1 - 1
examples/canvas_geometry_shapes.html

@@ -23,7 +23,7 @@
 	<body>
 		<canvas id="debug" style="position:absolute; left:100px"></canvas>
 
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - shape geometry</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - shape geometry</div>
 
 		<script src="../build/three.js"></script>
 

+ 1 - 1
examples/canvas_geometry_terrain.html

@@ -32,7 +32,7 @@
 	<body>
 
 		<div id="container"><br /><br /><br /><br /><br />Generating...</div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - terrain demo. <a href="canvas_geometry_terrain.html">generate another</a></div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - terrain demo. <a href="canvas_geometry_terrain.html">generate another</a></div>
 
 		<script src="../build/three.js"></script>
 

+ 1 - 1
examples/canvas_interactive_cubes.html

@@ -46,7 +46,7 @@
 				info.style.top = '10px';
 				info.style.width = '100%';
 				info.style.textAlign = 'center';
-				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> - clickable objects';
+				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - clickable objects';
 				container.appendChild( info );
 
 				camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 10000 );

+ 1 - 1
examples/canvas_interactive_cubes_tween.html

@@ -44,7 +44,7 @@
 				info.style.top = '10px';
 				info.style.width = '100%';
 				info.style.textAlign = 'center';
-				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> - clickable objects';
+				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - clickable objects';
 				container.appendChild( info );
 
 				camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 10000 );

+ 1 - 1
examples/canvas_interactive_particles.html

@@ -64,7 +64,7 @@
 				info.style.top = '10px';
 				info.style.width = '100%';
 				info.style.textAlign = 'center';
-				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> canvas - interactive particles';
+				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> canvas - interactive particles';
 				container.appendChild( info );
 
 				camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 10000 );

+ 3 - 19
examples/canvas_interactive_voxelpainter.html

@@ -46,7 +46,7 @@
 				info.style.top = '10px';
 				info.style.width = '100%';
 				info.style.textAlign = 'center';
-				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> - voxel painter<br><strong>click</strong>: add voxel, <strong>shift + click</strong>: remove voxel, <a href="javascript:save()">save .png</a>';
+				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - voxel painter<br><strong>click</strong>: add voxel, <strong>shift + click</strong>: remove voxel, <a href="javascript:save()">save .png</a>';
 				container.appendChild( info );
 
 				camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 10000 );
@@ -57,24 +57,8 @@
 
 				// Grid
 
-				var size = 500, step = 50;
-
-				var geometry = new THREE.Geometry();
-
-				for ( var i = - size; i <= size; i += step ) {
-
-					geometry.vertices.push( new THREE.Vector3( - size, 0, i ) );
-					geometry.vertices.push( new THREE.Vector3(   size, 0, i ) );
-
-					geometry.vertices.push( new THREE.Vector3( i, 0, - size ) );
-					geometry.vertices.push( new THREE.Vector3( i, 0,   size ) );
-
-				}
-
-				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } );
-
-				var line = new THREE.LineSegments( geometry, material );
-				scene.add( line );
+				var gridHelper = new THREE.GridHelper( 1000, 20 );
+				scene.add( gridHelper );
 
 				//
 

+ 2 - 2
examples/canvas_lights_pointlights.html

@@ -35,8 +35,8 @@
 
 		<div id="container"></div>
 		<div id="info">
-			<a href="http://threejs.org" target="_blank">three.js</a> - point lights demo.<br />
-			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank">David OReilly</a>
+			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - point lights demo.<br />
+			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank" rel="noopener">David OReilly</a>
 		</div>
 
 		<script src="../build/three.js"></script>

+ 1 - 1
examples/canvas_lines_colors.html

@@ -40,7 +40,7 @@
 	<body>
 
 		<div id="info">
-			<a href="http://threejs.org" target="_blank">three.js</a> - color lines
+			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - color lines
 			[<a href="http://en.wikipedia.org/wiki/Hilbert_curve">Hilbert curve</a> thanks to <a href="http://www.openprocessing.org/visuals/?visualID=15599">Thomas Diewald</a>]
 		</div>
 

+ 2 - 2
examples/canvas_lines_colors_2d.html

@@ -40,7 +40,7 @@
 	<body>
 
 		<div id="info">
-			<a href="http://threejs.org" target="_blank">three.js</a> - color lines WebGL demo
+			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - color lines WebGL demo
 			[<a href="http://en.wikipedia.org/wiki/Hilbert_curve">Hilbert curve</a> thanks to <a href="http://www.openprocessing.org/visuals/?visualID=15599">Thomas Diewald</a>]
 		</div>
 
@@ -86,7 +86,7 @@
 				container.appendChild( renderer.domElement );
 
 				var geometry3 = new THREE.Geometry(),
-					points = hilbert2D( new THREE.Vector3( 0,0,0 ), 400.0, 4, 0, 1, 2, 3, 4, 5, 6, 7 ),
+					points = hilbert2D( new THREE.Vector3( 0,0,0 ), 400.0, 4 ),
 					colors3 = [];
 
 				for ( i = 0; i < points.length; i ++ ) {

+ 1 - 1
examples/canvas_lines_dashed.html

@@ -28,7 +28,7 @@
 	</head>
 
 	<body>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - dashed lines example</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - dashed lines example</div>
 		<div id="container"></div>
 
 		<script src="../build/three.js"></script>

+ 3 - 31
examples/canvas_materials.html

@@ -44,24 +44,9 @@
 
 				// Grid
 
-				var size = 500, step = 100;
-
-				var geometry = new THREE.Geometry();
-
-				for ( var i = - size; i <= size; i += step ) {
-
-					geometry.vertices.push( new THREE.Vector3( - size, - 120, i ) );
-					geometry.vertices.push( new THREE.Vector3(   size, - 120, i ) );
-
-					geometry.vertices.push( new THREE.Vector3( i, - 120, - size ) );
-					geometry.vertices.push( new THREE.Vector3( i, - 120,   size ) );
-
-				}
-
-				var material = new THREE.LineBasicMaterial( { color: 0xffffff, opacity: 0.2 } );
-
-				var line = new THREE.LineSegments( geometry, material );
-				scene.add( line );
+				var gridHelper = new THREE.GridHelper( 1000, 10 );
+				gridHelper.position.y = - 120;
+				scene.add( gridHelper );
 
 				// Spheres
 
@@ -146,19 +131,6 @@
 				renderer.setSize( window.innerWidth, window.innerHeight );
 				container.appendChild( renderer.domElement );
 
-				var debugCanvas = document.createElement( 'canvas' );
-				debugCanvas.width = 512;
-				debugCanvas.height = 512;
-				debugCanvas.style.position = 'absolute';
-				debugCanvas.style.top = '0px';
-				debugCanvas.style.left = '0px';
-
-				container.appendChild( debugCanvas );
-
-				debugContext = debugCanvas.getContext( '2d' );
-				debugContext.setTransform( 1, 0, 0, 1, 256, 256 );
-				debugContext.strokeStyle = '#000000';
-
 				stats = new Stats();
 				container.appendChild(stats.dom);
 

+ 2 - 2
examples/canvas_materials_normal.html

@@ -35,8 +35,8 @@
 
 		<div id="container"></div>
 		<div id="info">
-			<a href="http://threejs.org" target="_blank">three.js</a> - normal material.<br />
-			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank">David OReilly</a>
+			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - normal material.<br />
+			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank" rel="noopener">David OReilly</a>
 		</div>
 
 		<script src="../build/three.js"></script>

+ 2 - 2
examples/canvas_materials_reflection.html

@@ -34,8 +34,8 @@
 
 		<div id="container"></div>
 		<div id="info">
-			<a href="http://threejs.org" target="_blank">three.js</a> - spherical reflection demo.<br />
-			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank">David OReilly</a>. Reflection texture by <a href="http://kewlers.scene.org/" target="_blank">Kewlers</a>.
+			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - spherical reflection demo.<br />
+			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank" rel="noopener">David OReilly</a>. Reflection texture by <a href="http://kewlers.scene.org/" target="_blank" rel="noopener">Kewlers</a>.
 		</div>
 
 		<script src="../build/three.js"></script>

+ 7 - 7
examples/canvas_materials_video.html

@@ -60,7 +60,7 @@
 				info.style.top = '10px';
 				info.style.width = '100%';
 				info.style.textAlign = 'center';
-				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> - video demo. playing <a href="http://durian.blender.org/" target="_blank">sintel</a> trailer';
+				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - video demo. playing <a href="http://durian.blender.org/" target="_blank" rel="noopener">sintel</a> trailer';
 				container.appendChild( info );
 
 				camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 10000 );
@@ -138,12 +138,12 @@
 
 					for ( var iy = 0; iy < amounty; iy++ ) {
 
-						particle = new THREE.Sprite( material );
-						particle.position.x = ix * separation - ( ( amountx * separation ) / 2 );
-						particle.position.y = -153;
-						particle.position.z = iy * separation - ( ( amounty * separation ) / 2 );
-						particle.scale.x = particle.scale.y = 2;
-						scene.add( particle );
+						var sprite = new THREE.Sprite( material );
+						sprite.position.x = ix * separation - ( ( amountx * separation ) / 2 );
+						sprite.position.y = -153;
+						sprite.position.z = iy * separation - ( ( amounty * separation ) / 2 );
+						sprite.scale.setScalar( 2 );
+						scene.add( sprite );
 
 					}
 

+ 1 - 1
examples/canvas_morphtargets_horse.html

@@ -41,7 +41,7 @@
 				info.style.top = '10px';
 				info.style.width = '100%';
 				info.style.textAlign = 'center';
-				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> canvas - morph targets - horse. model by <a href="http://mirada.com/">mirada</a> from <a href="http://ro.me">rome</a>';
+				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> canvas - morph targets - horse. model by <a href="http://mirada.com/">mirada</a> from <a href="http://ro.me">rome</a>';
 				container.appendChild( info );
 
 				//

+ 4 - 20
examples/canvas_performance.html

@@ -47,29 +47,13 @@
 
 				// Grid
 
-				var size = 500, step = 100;
-
-				var geometry = new THREE.Geometry();
-
-				for ( var i = - size; i <= size; i += step ) {
-
-					geometry.vertices.push( new THREE.Vector3( - size, 0, i ) );
-					geometry.vertices.push( new THREE.Vector3(   size, 0, i ) );
-
-					geometry.vertices.push( new THREE.Vector3( i, 0, - size ) );
-					geometry.vertices.push( new THREE.Vector3( i, 0,   size ) );
-
-				}
-
-				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.5 } );
-
-				var line = new THREE.LineSegments( geometry, material );
-				scene.add( line );
+				var gridHelper = new THREE.GridHelper( 1000, 10 );
+				scene.add( gridHelper );
 
 				// Spheres
 
-				geometry = new THREE.SphereGeometry( 100, 26, 18 );
-				material = new THREE.MeshLambertMaterial( { color: 0xffffff, overdraw: 0.5 } );
+				var geometry = new THREE.SphereGeometry( 100, 26, 18 );
+				var material = new THREE.MeshLambertMaterial( { color: 0xffffff, overdraw: 0.5 } );
 
 				for ( var i = 0; i < 20; i ++ ) {
 

+ 15 - 160
examples/canvas_sandbox.html

@@ -17,6 +17,7 @@
 
 		<script src="../build/three.js"></script>
 
+		<script src="js/controls/OrbitControls.js"></script>
 		<script src="js/renderers/Projector.js"></script>
 		<script src="js/renderers/CanvasRenderer.js"></script>
 
@@ -26,31 +27,8 @@
 
 			var container, stats;
 
-			var camera, scene, renderer, objects;
-			var pointLight;
-
-			var sphere;
-
-			var targetRotation = 0;
-			var targetRotationOnMouseDown = 0;
-
-			var mouseX = 0;
-			var mouseXOnMouseDown = 0;
-
-			var windowHalfX = window.innerWidth / 2;
-			var windowHalfY = window.innerHeight / 2;
-
-			var moveForward = false;
-			var moveBackwards = false;
-			var moveLeft = false;
-			var moveRight = false;
-			var moveUp = false;
-			var moveDown = false;
-
-			var targetMoveLeft = false;
-			var targetMoveRight = false;
-
-			var debugContext;
+			var camera, scene, renderer;
+			var controls, group;
 
 			init();
 			animate();
@@ -62,46 +40,31 @@
 
 				camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 10000 );
 				camera.position.set( 0, 150, 400 );
-				camera.target = new THREE.Vector3( 0, 150, 0 );
 
-				scene = new THREE.Scene();
+				var controls = new THREE.OrbitControls( camera );
 
+				scene = new THREE.Scene();
 
 				// Grid
 
-				var size = 500, step = 100;
-
-				var geometry = new THREE.Geometry();
-
-				for ( var i = - size; i <= size; i += step ) {
-
-					geometry.vertices.push( new THREE.Vector3( - size, 0, i ) );
-					geometry.vertices.push( new THREE.Vector3(   size, 0, i ) );
-
-					geometry.vertices.push( new THREE.Vector3( i, 0, - size ) );
-					geometry.vertices.push( new THREE.Vector3( i, 0,   size ) );
-
-				}
-
-				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.5 } );
-
-				var line = new THREE.LineSegments( geometry, material );
-				scene.add( line );
+				var gridHelper = new THREE.GridHelper( 1000, 10 );
+				scene.add( gridHelper );
 
 				// Spheres
 
-				objects = [];
+				group = new THREE.Group();
+				scene.add( group );
 
-				geometry = new THREE.IcosahedronGeometry( 100, 1 );
+				var geometry = new THREE.IcosahedronGeometry( 100, 1 );
 
 				var envMap = new THREE.TextureLoader().load( 'textures/metal.jpg' );
 				envMap.mapping = THREE.SphericalReflectionMapping;
 
-				material = new THREE.MeshBasicMaterial( { envMap: envMap, overdraw: 0.5 } );
+				var material = new THREE.MeshBasicMaterial( { envMap: envMap, overdraw: 0.5 } );
 
 				for ( var i = 0; i < 10; i ++ ) {
 
-					sphere = new THREE.Mesh( geometry, material );
+					var sphere = new THREE.Mesh( geometry, material );
 
 					sphere.position.x = Math.random() * 1000 - 500;
 					sphere.position.y = Math.random() * 1000 - 500;
@@ -113,52 +76,19 @@
 
 					sphere.scale.x = sphere.scale.y = sphere.scale.z = Math.random() + 0.5;
 
-					objects.push( sphere );
-
-					scene.add( sphere );
+					group.add( sphere );
 
 				}
 
-				// Lights
-
-				var ambientLight = new THREE.AmbientLight( Math.random() * 0x202020 );
-				scene.add( ambientLight );
-
-				var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
-				directionalLight.position.x = Math.random() - 0.5;
-				directionalLight.position.y = Math.random() - 0.5;
-				directionalLight.position.z = Math.random() - 0.5;
-				directionalLight.position.normalize();
-				scene.add( directionalLight );
-
-				pointLight = new THREE.PointLight( 0xff0000, 1 );
-				scene.add( pointLight );
-
 				renderer = new THREE.CanvasRenderer();
 				renderer.setClearColor( 0xf0f0f0 );
 				renderer.setPixelRatio( window.devicePixelRatio );
 				renderer.setSize( window.innerWidth, window.innerHeight );
 				container.appendChild( renderer.domElement );
 
-				var debugCanvas = document.createElement( 'canvas' );
-				debugCanvas.width = 512;
-				debugCanvas.height = 512;
-				debugCanvas.style.position = 'absolute';
-				debugCanvas.style.top = '0px';
-				debugCanvas.style.left = '0px';
-
-				container.appendChild( debugCanvas );
-
-				debugContext = debugCanvas.getContext( '2d' );
-				debugContext.setTransform( 1, 0, 0, 1, 256, 256 );
-				debugContext.strokeStyle = '#000000';
-
 				stats = new Stats();
 				container.appendChild(stats.dom);
 
-				document.addEventListener( 'keydown', onDocumentKeyDown, false );
-				document.addEventListener( 'keyup', onDocumentKeyUp, false );
-
 				//
 
 				window.addEventListener( 'resize', onWindowResize, false );
@@ -167,9 +97,6 @@
 
 			function onWindowResize() {
 
-				windowHalfX = window.innerWidth / 2;
-				windowHalfY = window.innerHeight / 2;
-
 				camera.aspect = window.innerWidth / window.innerHeight;
 				camera.updateProjectionMatrix();
 
@@ -177,40 +104,6 @@
 
 			}
 
-			function onDocumentKeyDown( event ) {
-
-				switch ( event.keyCode ) {
-
-					case 38: moveForward = true; break; // up
-					case 40: moveBackwards = true; break; // down
-					case 37: moveLeft = true; break; // left
-					case 39: moveRight = true; break; // right
-					case 87: moveUp = true; break; // w
-					case 83: moveDown = true; break; // s
-					case 65: targetMoveLeft = true; break; // a
-					case 68: targetMoveRight = true; break; // d
-
-				}
-
-			}
-
-			function onDocumentKeyUp( event ) {
-
-				switch ( event.keyCode ) {
-
-					case 38: moveForward = false; break; // up
-					case 40: moveBackwards = false; break; // down
-					case 37: moveLeft = false; break; // left
-					case 39: moveRight = false; break; // right
-					case 87: moveUp = false; break; // w
-					case 83: moveDown = false; break; // s
-					case 65: targetMoveLeft = false; break; // a
-					case 68: targetMoveRight = false; break; // d
-
-				}
-
-			}
-
 			//
 
 			function animate() {
@@ -224,54 +117,16 @@
 
 			function render() {
 
-				if ( moveForward ) camera.position.z -= 10;
-				if ( moveBackwards ) camera.position.z += 10;
+				for ( var i = 0, l = group.children.length; i < l; i++ ) {
 
-				if ( moveLeft ) camera.position.x -= 10;
-				if ( moveRight ) camera.position.x += 10;
-
-				if ( moveUp ) camera.position.y += 10;
-				if ( moveDown ) camera.position.y -= 10;
-
-				if ( targetMoveLeft ) camera.target.x -= 10;
-				if ( targetMoveRight ) camera.target.x += 10;
-
-				camera.lookAt( camera.target );
-
-				debugContext.clearRect( -256, -256, 512, 512 );
-
-				debugContext.beginPath();
-
-				// center
-				debugContext.moveTo( -10, 0 );
-				debugContext.lineTo( 10, 0 );
-				debugContext.moveTo( 0, -10 );
-				debugContext.lineTo( 0, 10 );
-
-				// camera
-
-				debugContext.moveTo( camera.position.x * 0.1, camera.position.z * 0.1 );
-				debugContext.lineTo( camera.target.x * 0.1, camera.target.z * 0.1 );
-				debugContext.rect( camera.position.x * 0.1 - 5, camera.position.z * 0.1 - 5, 10, 10 );
-				debugContext.rect( camera.target.x * 0.1 - 5, camera.target.z * 0.1 - 5, 10, 10 );
-				debugContext.rect( - 50, - 50, 100, 100 );
-
-				for ( var i = 0, l = objects.length; i < l; i++ ) {
-
-					var object = objects[ i ];
+					var object = group.children[ i ];
 
 					object.rotation.x += 0.01;
 					object.rotation.y += 0.005;
 					object.position.y = Math.sin( object.rotation.x ) * 200;
 
-					debugContext.rect( object.position.x * 0.1 - 5, object.position.z * 0.1 - 5, 10, 10 );
-
 				}
 
-
-				debugContext.closePath();
-				debugContext.stroke();
-
 				renderer.render( scene, camera );
 
 			}

+ 1 - 1
examples/css3d_molecules.html

@@ -92,7 +92,7 @@
 		<script src="js/loaders/PDBLoader.js"></script>
 
 		<div id="container"></div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js css3d</a> - molecules</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js css3d</a> - molecules</div>
 		<div id="topmenu">
 			<button id="b_a">Atoms</button>
 			<button id="b_b">Bonds</button>

+ 1 - 1
examples/css3d_panorama.html

@@ -33,7 +33,7 @@
 		<script src="../build/three.js"></script>
 		<script src="js/renderers/CSS3DRenderer.js"></script>
 
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js css3d</a> - panorama demo. cubemap by <a href="http://www.humus.name/index.php?page=Textures" target="_blank">Humus</a>.</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js css3d</a> - panorama demo. cubemap by <a href="http://www.humus.name/index.php?page=Textures" target="_blank" rel="noopener">Humus</a>.</div>
 
 		<script>
 

+ 1 - 1
examples/css3d_panorama_deviceorientation.html

@@ -34,7 +34,7 @@
 		<script src="js/controls/DeviceOrientationControls.js"></script>
 		<script src="js/renderers/CSS3DRenderer.js"></script>
 
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js css3d</a> - panorama - decideorientation. cubemap by <a href="http://www.humus.name/index.php?page=Textures" target="_blank">Humus</a>.</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js css3d</a> - panorama - decideorientation. cubemap by <a href="http://www.humus.name/index.php?page=Textures" target="_blank" rel="noopener">Humus</a>.</div>
 
 		<script>
 

+ 1 - 1
examples/css3d_periodictable.html

@@ -105,7 +105,7 @@
 		<script src="js/renderers/CSS3DRenderer.js"></script>
 
 		<div id="container"></div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js css3d</a> - periodic table. <a href="https://plus.google.com/113862800338869870683/posts/QcFk5HrWran" target="_blank">info</a>.</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js css3d</a> - periodic table. <a href="https://plus.google.com/113862800338869870683/posts/QcFk5HrWran" target="_blank" rel="noopener">info</a>.</div>
 		<div id="menu">
 			<button id="table">TABLE</button>
 			<button id="sphere">SPHERE</button>

+ 2 - 2
examples/css3d_sandbox.html

@@ -28,7 +28,7 @@
 		</style>
 	</head>
 	<body>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - css3d sandbox</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - css3d sandbox</div>
 
 		<script src="../build/three.js"></script>
 
@@ -66,7 +66,7 @@
 					var element = document.createElement( 'div' );
 					element.style.width = '100px';
 					element.style.height = '100px';
-					element.style.opacity = 0.5;
+					element.style.opacity = ( i < 5 ) ? 0.5 : 1;
 					element.style.background = new THREE.Color( Math.random() * 0xffffff ).getStyle();
 
 					var object = new THREE.CSS3DObject( element );

+ 1 - 1
examples/css3d_sprites.html

@@ -40,7 +40,7 @@
 		<script src="js/renderers/CSS3DRenderer.js"></script>
 
 		<div id="container"></div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js css3d</a> - sprites.</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js css3d</a> - sprites.</div>
 
 		<script>
 

+ 1 - 0
examples/css3d_youtube.html

@@ -30,6 +30,7 @@
 		<script>
 
 			var camera, scene, renderer;
+			var controls;
 
 			var Element = function ( id, x, y, z, ry ) {
 

+ 13 - 6
examples/files.js

@@ -6,6 +6,7 @@ var files = {
 		"webgl_animation_skinning_blending",
 		"webgl_animation_skinning_morph",
 		"webgl_camera",
+		"webgl_camera_array",
 		"webgl_camera_cinematic",
 		"webgl_camera_logarithmicdepthbuffer",
 		"webgl_clipping",
@@ -75,6 +76,7 @@ var files = {
 		"webgl_lines_dashed",
 		"webgl_lines_sphere",
 		"webgl_lines_splines",
+		"webgl_loader_3ds",
 		"webgl_loader_3mf",
 		"webgl_loader_amf",
 		"webgl_loader_assimp",
@@ -83,15 +85,14 @@ var files = {
 		"webgl_loader_babylon",
 		"webgl_loader_bvh",
 		"webgl_loader_collada",
-		"webgl_loader_collada_keyframe",
 		"webgl_loader_collada_kinematics",
 		"webgl_loader_collada_skinning",
 		"webgl_loader_ctm",
 		"webgl_loader_ctm_materials",
 		"webgl_loader_draco",
 		"webgl_loader_fbx",
-		"webgl_loader_gltf",
 		"webgl_loader_gltf2",
+		"webgl_loader_imagebitmap",
 		"webgl_loader_json_blender",
 		"webgl_loader_json_claraio",
 		"webgl_loader_json_objconverter",
@@ -110,6 +111,7 @@ var files = {
 		"webgl_loader_pcd",
 		"webgl_loader_pdb",
 		"webgl_loader_ply",
+		"webgl_loader_prwm",
 		"webgl_loader_ttf",
 		"webgl_loader_sea3d",
 		"webgl_loader_sea3d_hierarchy",
@@ -144,6 +146,7 @@ var files = {
 		"webgl_materials_envmaps_hdr",
 		"webgl_materials_grass",
 		"webgl_materials_lightmap",
+		"webgl_materials_modified",
 		"webgl_materials_nodes",
 		"webgl_materials_normalmap",
 		"webgl_materials_parallaxmap",
@@ -152,13 +155,13 @@ var files = {
 		"webgl_materials_skin",
 		"webgl_materials_standard",
 		"webgl_materials_texture_anisotropy",
+		"webgl_materials_texture_canvas",
 		"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_texture_canvas",
 		"webgl_materials_transparency",
 		"webgl_materials_variations_basic",
 		"webgl_materials_variations_lambert",
@@ -194,11 +197,11 @@ var files = {
 		"webgl_performance",
 		"webgl_performance_doublesided",
 		"webgl_performance_static",
-		"webgl_physics_terrain",
-		"webgl_physics_rope",
 		"webgl_physics_cloth",
-		"webgl_physics_volume",
 		"webgl_physics_convex_break",
+		"webgl_physics_rope",
+		"webgl_physics_terrain",
+		"webgl_physics_volume",
 		"webgl_points_billboards",
 		"webgl_points_billboards_colors",
 		"webgl_points_dynamic",
@@ -243,6 +246,7 @@ var files = {
 		"webgl_simple_gi",
 		"webgl_skinning_simple",
 		"webgl_sprites",
+		"webgl_sprites_nodes",
 		"webgl_terrain_dynamic",
 		"webgl_test_memory",
 		"webgl_test_memory2",
@@ -277,9 +281,11 @@ var files = {
 	"webgl deferred": [
 		"webgldeferred_animation"
 	],
+	/*
 	"webgl2": [
 		"webgl2_sandbox"
 	],
+	*/
 	"webvr": [
 		"webvr_cubes",
 		"webvr_daydream",
@@ -364,6 +370,7 @@ var files = {
 		"software_sandbox"
 	],
 	"svg": [
+		"svg_lines",
 		"svg_sandbox"
 	]
 };

+ 1 - 1
examples/js/Cloth.js

@@ -286,7 +286,7 @@ function simulate( time ) {
 		for ( particles = cloth.particles, i = 0, il = particles.length; i < il; i ++ ) {
 
 			particle = particles[ i ];
-			pos = particle.position;
+			var pos = particle.position;
 			diff.subVectors( pos, ballPosition );
 			if ( diff.length() < ballSize ) {
 

+ 9 - 8
examples/js/GPUParticleSystem.js

@@ -330,7 +330,7 @@ THREE.GPUParticleContainer = function( maxParticles, particleSystem ) {
 
 		if ( this.DPR !== undefined ) size *= this.DPR;
 
-		i = this.PARTICLE_CURSOR;
+		var i = this.PARTICLE_CURSOR;
 
 		// position
 
@@ -461,13 +461,14 @@ THREE.GPUParticleContainer = function( maxParticles, particleSystem ) {
 				sizeAttribute.updateRange.offset = 0;
 				lifeTimeAttribute.updateRange.offset = 0;
 
-				positionStartAttribute.updateRange.count = positionStartAttribute.count;
-				startTimeAttribute.updateRange.count = startTimeAttribute.count;
-				velocityAttribute.updateRange.count = velocityAttribute.count;
-				turbulenceAttribute.updateRange.count = turbulenceAttribute.count;
-				colorAttribute.updateRange.count = colorAttribute.count;
-				sizeAttribute.updateRange.count = sizeAttribute.count;
-				lifeTimeAttribute.updateRange.count = lifeTimeAttribute.count;
+				// Use -1 to update the entire buffer, see #11476
+				positionStartAttribute.updateRange.count = -1;
+				startTimeAttribute.updateRange.count = -1;
+				velocityAttribute.updateRange.count = -1;
+				turbulenceAttribute.updateRange.count = -1;
+				colorAttribute.updateRange.count = -1;
+				sizeAttribute.updateRange.count = -1;
+				lifeTimeAttribute.updateRange.count = -1;
 
 			}
 

+ 25 - 17
examples/js/Mirror.js

@@ -27,10 +27,13 @@ THREE.Mirror = function ( width, height, options ) {
 	var lookAtPosition = new THREE.Vector3( 0, 0, - 1 );
 	var clipPlane = new THREE.Vector4();
 
+	var view = new THREE.Vector3();
+	var target = new THREE.Vector3();
+	var q = new THREE.Vector4();
+
 	var textureMatrix = new THREE.Matrix4();
 
 	var mirrorCamera = new THREE.PerspectiveCamera();
-	mirrorCamera.matrixAutoUpdate = true;
 
 	var parameters = {
 		minFilter: THREE.LinearFilter,
@@ -106,11 +109,6 @@ THREE.Mirror = function ( width, height, options ) {
 
 	function updateTextureMatrix( camera ) {
 
-		camera.updateMatrixWorld();
-
-		mirrorCamera.copy( camera );
-		mirrorCamera.updateProjectionMatrix();
-
 		scope.updateMatrixWorld();
 
 		mirrorWorldPosition.setFromMatrixPosition( scope.matrixWorld );
@@ -121,7 +119,7 @@ THREE.Mirror = function ( width, height, options ) {
 		normal.set( 0, 0, 1 );
 		normal.applyMatrix4( rotationMatrix );
 
-		var view = mirrorWorldPosition.clone().sub( cameraWorldPosition );
+		view.subVectors( mirrorWorldPosition, cameraWorldPosition );
 		view.reflect( normal ).negate();
 		view.add( mirrorWorldPosition );
 
@@ -131,7 +129,7 @@ THREE.Mirror = function ( width, height, options ) {
 		lookAtPosition.applyMatrix4( rotationMatrix );
 		lookAtPosition.add( cameraWorldPosition );
 
-		var target = mirrorWorldPosition.clone().sub( lookAtPosition );
+		target.subVectors( mirrorWorldPosition, lookAtPosition );
 		target.reflect( normal ).negate();
 		target.add( mirrorWorldPosition );
 
@@ -141,9 +139,11 @@ THREE.Mirror = function ( width, height, options ) {
 		mirrorCamera.up.reflect( normal ).negate();
 		mirrorCamera.lookAt( target );
 
-		mirrorCamera.updateProjectionMatrix();
+		mirrorCamera.near = camera.near;
+		mirrorCamera.far = camera.far;
+
 		mirrorCamera.updateMatrixWorld();
-		mirrorCamera.matrixWorldInverse.getInverse( mirrorCamera.matrixWorld );
+		mirrorCamera.updateProjectionMatrix();
 
 		// Update the texture matrix
 		textureMatrix.set(
@@ -162,7 +162,6 @@ THREE.Mirror = function ( width, height, options ) {
 
 		clipPlane.set( mirrorPlane.normal.x, mirrorPlane.normal.y, mirrorPlane.normal.z, mirrorPlane.constant );
 
-		var q = new THREE.Vector4();
 		var projectionMatrix = mirrorCamera.projectionMatrix;
 
 		q.x = ( Math.sign( clipPlane.x ) + projectionMatrix.elements[ 8 ] ) / projectionMatrix.elements[ 0 ];
@@ -171,14 +170,13 @@ THREE.Mirror = function ( width, height, options ) {
 		q.w = ( 1.0 + projectionMatrix.elements[ 10 ] ) / projectionMatrix.elements[ 14 ];
 
 		// Calculate the scaled plane vector
-		var c = new THREE.Vector4();
-		c = clipPlane.multiplyScalar( 2.0 / clipPlane.dot( q ) );
+		clipPlane.multiplyScalar( 2.0 / clipPlane.dot( q ) );
 
 		// Replacing the third row of the projection matrix
-		projectionMatrix.elements[ 2 ] = c.x;
-		projectionMatrix.elements[ 6 ] = c.y;
-		projectionMatrix.elements[ 10 ] = c.z + 1.0 - clipBias;
-		projectionMatrix.elements[ 14 ] = c.w;
+		projectionMatrix.elements[ 2 ] = clipPlane.x;
+		projectionMatrix.elements[ 6 ] = clipPlane.y;
+		projectionMatrix.elements[ 10 ] = clipPlane.z + 1.0 - clipBias;
+		projectionMatrix.elements[ 14 ] = clipPlane.w;
 
 	}
 
@@ -190,7 +188,17 @@ THREE.Mirror = function ( width, height, options ) {
 
 		var currentRenderTarget = renderer.getRenderTarget();
 
+		var currentVrEnabled = renderer.vr.enabled;
+		var currentShadowAutoUpdate = renderer.shadowMap.autoUpdate;
+
+		renderer.vr.enabled = false; // Avoid camera modification and recursion
+		renderer.shadowMap.autoUpdate = false; // Avoid re-computing shadows
+
 		renderer.render( scene, mirrorCamera, renderTarget, true );
+
+		renderer.vr.enabled = currentVrEnabled;
+		renderer.shadowMap.autoUpdate = currentShadowAutoUpdate;
+
 		renderer.setRenderTarget( currentRenderTarget );
 
 		scope.visible = true;

+ 1 - 1
examples/js/TimelinerController.js

@@ -221,7 +221,7 @@ THREE.TimelinerController.prototype = {
 		for ( var i = 0, n = names.length; i !== n; ++ i ) {
 
 			var name = names[ i ],
-				track = tracks[ name ];
+				track = tracks[ name ],
 				data = channels[ name ];
 
 			this._setArray( track.times, data.times );

+ 1 - 3
examples/js/WaterShader.js

@@ -279,7 +279,6 @@ THREE.Water.prototype.updateTextureMatrix = function () {
 
 	this.mirrorCamera.updateProjectionMatrix();
 	this.mirrorCamera.updateMatrixWorld();
-	this.mirrorCamera.matrixWorldInverse.getInverse( this.mirrorCamera.matrixWorld );
 
 	// Update the texture matrix
 	this.textureMatrix.set(
@@ -307,8 +306,7 @@ THREE.Water.prototype.updateTextureMatrix = function () {
 	q.w = ( 1.0 + projectionMatrix.elements[ 10 ] ) / projectionMatrix.elements[ 14 ];
 
 	// Calculate the scaled plane vector
-	var c = new THREE.Vector4();
-	c = this.clipPlane.multiplyScalar( 2.0 / this.clipPlane.dot( q ) );
+	var c = this.clipPlane.multiplyScalar( 2.0 / this.clipPlane.dot( q ) );
 
 	// Replacing the third row of the projection matrix
 	projectionMatrix.elements[ 2 ] = c.x;

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

@@ -263,7 +263,7 @@ THREE.EditorControls = function ( object, domElement ) {
 			case 2:
 				touches[ 0 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );
 				touches[ 1 ].set( event.touches[ 1 ].pageX, event.touches[ 1 ].pageY, 0 );
-				distance = touches[ 0 ].distanceTo( touches[ 1 ] );
+				var distance = touches[ 0 ].distanceTo( touches[ 1 ] );
 				scope.zoom( new THREE.Vector3( 0, 0, prevDistance - distance ) );
 				prevDistance = distance;
 

+ 2 - 0
examples/js/controls/OrbitControls.js

@@ -888,6 +888,8 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 	function onContextMenu( event ) {
 
+		if ( scope.enabled === false ) return;
+
 		event.preventDefault();
 
 	}

+ 2 - 0
examples/js/controls/TrackballControls.js

@@ -579,6 +579,8 @@ THREE.TrackballControls = function ( object, domElement ) {
 
 	function contextmenu( event ) {
 
+		if ( _this.enabled === false ) return;
+
 		event.preventDefault();
 
 	}

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