Explorar o código

Updated all examples so they use the renamed geometry classes.

Mr.doob %!s(int64=14) %!d(string=hai) anos
pai
achega
bfdb10a85a
Modificáronse 91 ficheiros con 752 adicións e 1235 borrados
  1. 13 13
      build/Three.js
  2. 13 13
      build/custom/ThreeExtras.js
  3. 1 1
      examples/canvas_camera_orthographic.html
  4. 2 2
      examples/canvas_geometry_cube.html
  5. 2 2
      examples/canvas_geometry_earth.html
  6. 1 1
      examples/canvas_geometry_hierarchy.html
  7. 1 1
      examples/canvas_geometry_panorama.html
  8. 1 1
      examples/canvas_geometry_panorama_fisheye.html
  9. 1 1
      examples/canvas_geometry_terrain.html
  10. 2 2
      examples/canvas_geometry_text.html
  11. 1 1
      examples/canvas_interactive_cubes.html
  12. 1 1
      examples/canvas_interactive_cubes_tween.html
  13. 2 2
      examples/canvas_interactive_voxelpainter.html
  14. 1 1
      examples/canvas_materials.html
  15. 2 2
      examples/canvas_materials_depth.html
  16. 1 1
      examples/canvas_materials_video.html
  17. 1 1
      examples/canvas_performance.html
  18. 28 13
      examples/canvas_sandbox.html
  19. 1 1
      examples/misc_camera_path.html
  20. 1 1
      examples/misc_camera_roll.html
  21. 1 1
      examples/misc_camera_trackball.html
  22. 1 1
      examples/misc_lights_test.html
  23. 2 2
      examples/misc_lookat.html
  24. 3 3
      examples/misc_materials_multimaterials.html
  25. 4 4
      examples/misc_sound.html
  26. 20 13
      examples/misc_ubiquity_test.html
  27. 2 2
      examples/webgl_collisions_box.html
  28. 14 20
      examples/webgl_collisions_primitives.html
  29. 5 8
      examples/webgl_collisions_reaction.html
  30. 1 1
      examples/webgl_collisions_terrain.html
  31. 5 9
      examples/webgl_collisions_trigger.html
  32. 2 2
      examples/webgl_flycamera_earth.html
  33. 8 8
      examples/webgl_geometries.html
  34. 4 4
      examples/webgl_geometry_colors.html
  35. 1 1
      examples/webgl_geometry_dynamic.html
  36. 1 1
      examples/webgl_geometry_hierarchy.html
  37. 1 1
      examples/webgl_geometry_hierarchy2.html
  38. 1 1
      examples/webgl_geometry_large_mesh.html
  39. 1 1
      examples/webgl_geometry_minecraft.html
  40. 1 1
      examples/webgl_geometry_minecraft_ao.html
  41. 1 1
      examples/webgl_geometry_terrain.html
  42. 1 1
      examples/webgl_geometry_terrain_fog.html
  43. 488 330
      examples/webgl_geometry_text.html
  44. 1 1
      examples/webgl_hdr.html
  45. 1 1
      examples/webgl_interactive_cubes.html
  46. 3 3
      examples/webgl_interactive_voxelpainter.html
  47. 1 1
      examples/webgl_lights_pointlights.html
  48. 1 1
      examples/webgl_lines_colors.html
  49. 1 1
      examples/webgl_lines_splines.html
  50. 4 4
      examples/webgl_lod.html
  51. 4 4
      examples/webgl_materials.html
  52. 1 1
      examples/webgl_materials_cars_camaro.html
  53. 1 1
      examples/webgl_materials_cars_camaro_crosseyed.html
  54. 1 1
      examples/webgl_materials_cubemap.html
  55. 1 1
      examples/webgl_materials_cubemap_balls_reflection.html
  56. 1 1
      examples/webgl_materials_cubemap_balls_reflection_anaglyph.html
  57. 1 1
      examples/webgl_materials_cubemap_balls_refraction.html
  58. 1 1
      examples/webgl_materials_cubemap_balls_refraction_crosseyed.html
  59. 1 1
      examples/webgl_materials_cubemap_escher.html
  60. 1 1
      examples/webgl_materials_cubemap_refraction.html
  61. 1 1
      examples/webgl_materials_grass.html
  62. 1 1
      examples/webgl_materials_normalmap.html
  63. 2 2
      examples/webgl_materials_shaders.html
  64. 1 1
      examples/webgl_materials_shaders_fresnel.html
  65. 2 2
      examples/webgl_materials_texture_filters.html
  66. 2 2
      examples/webgl_materials_video.html
  67. 1 1
      examples/webgl_morphtargets.html
  68. 4 4
      examples/webgl_multiple_canvases_complex.html
  69. 4 4
      examples/webgl_multiple_canvases_grid.html
  70. 4 10
      examples/webgl_objconvert_test.html
  71. 1 1
      examples/webgl_panorama_equirectangular.html
  72. 3 3
      examples/webgl_particles_dynamic.html
  73. 1 1
      examples/webgl_postprocessing.html
  74. 4 4
      examples/webgl_postprocessing_dof.html
  75. 1 1
      examples/webgl_ribbons.html
  76. 2 2
      examples/webgl_rtt.html
  77. 18 11
      examples/webgl_sandbox.html
  78. 1 1
      examples/webgl_scene_test.html
  79. 1 1
      examples/webgl_scene_test_blender.html
  80. 1 1
      examples/webgl_shader.html
  81. 1 1
      examples/webgl_shader2.html
  82. 2 2
      examples/webgl_shader_lava.html
  83. 6 6
      examples/webgl_stencil.html
  84. 6 6
      examples/webgl_stencilLensFlare.html
  85. 0 651
      examples/webgl_text.html
  86. 1 1
      examples/webgl_trackballcamera_earth.html
  87. 1 1
      src/extras/SceneUtils.js
  88. 3 3
      src/extras/cameras/PathCamera.js
  89. 6 6
      src/extras/io/SceneLoader.js
  90. 1 1
      src/extras/objects/Trident.js
  91. 1 1
      src/extras/renderers/AnaglyphWebGLRenderer.js

+ 13 - 13
build/Three.js

@@ -346,7 +346,7 @@ clamp:function(b,c,d){return b<c?c:b>d?d:b}};THREE.ColorUtils.__hsv={h:0,s:0,v:0
 var GeometryUtils={merge:function(b,c){var d=c instanceof THREE.Mesh,e=b.vertices.length,g=d?c.geometry:c,f=b.vertices,j=g.vertices,k=b.faces,m=g.faces,n=b.faceVertexUvs[0],g=g.faceVertexUvs[0];d&&c.matrixAutoUpdate&&c.updateMatrix();for(var o=0,p=j.length;o<p;o++){var t=new THREE.Vertex(j[o].position.clone());d&&c.matrix.multiplyVector3(t.position);f.push(t)}o=0;for(p=m.length;o<p;o++){var j=m[o],u,v,z=j.vertexNormals,t=j.vertexColors;j instanceof THREE.Face3?u=new THREE.Face3(j.a+e,j.b+e,j.c+e):
 j instanceof THREE.Face4&&(u=new THREE.Face4(j.a+e,j.b+e,j.c+e,j.d+e));u.normal.copy(j.normal);d=0;for(f=z.length;d<f;d++)v=z[d],u.vertexNormals.push(v.clone());u.color.copy(j.color);d=0;for(f=t.length;d<f;d++)v=t[d],u.vertexColors.push(v.clone());u.materials=j.materials.slice();u.centroid.copy(j.centroid);k.push(u)}o=0;for(p=g.length;o<p;o++){e=g[o];k=[];d=0;for(f=e.length;d<f;d++)k.push(new THREE.UV(e[d].u,e[d].v));n.push(k)}}};
 THREE.ImageUtils={loadTexture:function(b,c,d){var e=new Image,g=new THREE.Texture(e,c);e.onload=function(){g.needsUpdate=!0;d&&d(this)};e.src=b;return g},loadTextureCube:function(b,c,d){var e,g=[],f=new THREE.Texture(g,c),c=g.loadCount=0;for(e=b.length;c<e;++c)g[c]=new Image,g[c].onload=function(){g.loadCount+=1;if(g.loadCount==6)f.needsUpdate=!0;d&&d(this)},g[c].src=b[c];return f}};
-THREE.SceneUtils={addMesh:function(b,c,d,e,g,f,j,k,m,n){c=new THREE.Mesh(c,n);c.scale.x=c.scale.y=c.scale.z=d;c.position.x=e;c.position.y=g;c.position.z=f;c.rotation.x=j;c.rotation.y=k;c.rotation.z=m;b.addObject(c);return c},addPanoramaCubeWebGL:function(b,c,d){var e=THREE.ShaderUtils.lib.cube;e.uniforms.tCube.texture=d;d=new THREE.MeshShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms});c=new THREE.Mesh(new THREE.Cube(c,c,c,1,1,1,null,!0),d);b.addObject(c);
+THREE.SceneUtils={addMesh:function(b,c,d,e,g,f,j,k,m,n){c=new THREE.Mesh(c,n);c.scale.x=c.scale.y=c.scale.z=d;c.position.x=e;c.position.y=g;c.position.z=f;c.rotation.x=j;c.rotation.y=k;c.rotation.z=m;b.addObject(c);return c},addPanoramaCubeWebGL:function(b,c,d){var e=THREE.ShaderUtils.lib.cube;e.uniforms.tCube.texture=d;d=new THREE.MeshShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms});c=new THREE.Mesh(new THREE.CubeGeometry(c,c,c,1,1,1,null,!0),d);b.addObject(c);
 return c},addPanoramaCube:function(b,c,d){var e=[];e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[0])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[1])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[2])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[3])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[4])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(d[5])}));c=new THREE.Mesh(new THREE.Cube(c,c,c,1,1,e,!0),
 new THREE.MeshFaceMaterial);b.addObject(c);return c},addPanoramaCubePlanes:function(b,c,d){var e=c/2,c=new THREE.Plane(c,c),g=Math.PI,f=Math.PI/2;THREE.SceneUtils.addMesh(b,c,1,0,0,-e,0,0,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(d[5])}));THREE.SceneUtils.addMesh(b,c,1,-e,0,0,0,f,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(d[0])}));THREE.SceneUtils.addMesh(b,c,1,e,0,0,0,-f,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(d[1])}));THREE.SceneUtils.addMesh(b,c,1,0,e,0,f,0,g,
 new THREE.MeshBasicMaterial({map:new THREE.Texture(d[2])}));THREE.SceneUtils.addMesh(b,c,1,0,-e,0,-f,0,g,new THREE.MeshBasicMaterial({map:new THREE.Texture(d[3])}))},showHierarchy:function(b,c){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=c})},traverseHierarchy:function(b,c){var d,e,g=b.children.length;for(e=0;e<g;e++)d=b.children[e],c(d),THREE.SceneUtils.traverseHierarchy(d,c)}};
@@ -388,15 +388,15 @@ this.heightSpeed?this.tdiff*((this.position.y<this.heightMin?this.heightMin:this
 !1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};THREE.QuakeCamera.prototype=new THREE.Camera;THREE.QuakeCamera.prototype.constructor=THREE.QuakeCamera;THREE.QuakeCamera.prototype.supr=THREE.Camera.prototype;
 THREE.QuakeCamera.prototype.translate=function(b,c){this.matrix.rotateAxis(c);if(this.noFly)c.y=0;this.position.addSelf(c.multiplyScalar(b));this.target.position.addSelf(c.multiplyScalar(b))};
 THREE.PathCamera=function(b){function c(b,c,d,e){var f={name:d,fps:0.6,length:e,hierarchy:[]},g,j=c.getControlPointsArray(),k=c.getLength(),m=j.length,D=0;g=m-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:j[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[g]={time:e,pos:j[g],rot:[0,0,0,1],scl:[1,1,1]};for(g=1;g<m-1;g++)D=e*k.chunks[g]/k.total,c.keys[g]={time:D,pos:j[g]};f.hierarchy[0]=c;THREE.AnimationHandler.add(f);return new THREE.Animation(b,d,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function d(b,c){var d,
-e,f=new THREE.Geometry;for(d=0;d<b.points.length*c;d++)e=d/(b.points.length*c),e=b.getPoint(e),f.vertices[d]=new THREE.Vertex(new THREE.Vector3(e.x,e.y,e.z));return f}function e(b,c){var e=d(c,10),f=d(c,10),g=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(e,g);particleObj=new THREE.ParticleSystem(f,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.addChild(lineObj);particleObj.scale.set(1,1,1);b.addChild(particleObj);f=new THREE.Sphere(1,
+e,f=new THREE.Geometry;for(d=0;d<b.points.length*c;d++)e=d/(b.points.length*c),e=b.getPoint(e),f.vertices[d]=new THREE.Vertex(new THREE.Vector3(e.x,e.y,e.z));return f}function e(b,c){var e=d(c,10),f=d(c,10),g=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(e,g);particleObj=new THREE.ParticleSystem(f,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.addChild(lineObj);particleObj.scale.set(1,1,1);b.addChild(particleObj);f=new THREE.SphereGeometry(1,
 16,8);g=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)e=new THREE.Mesh(f,g),e.position.copy(c.points[i]),e.updateMatrix(),b.addChild(e)}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookHorizontal=
 this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(b){if(b.duration!==void 0)this.duration=b.duration*1E3;if(b.waypoints!==void 0)this.waypoints=b.waypoints;if(b.useConstantSpeed!==void 0)this.useConstantSpeed=b.useConstantSpeed;if(b.resamplingCoef!==void 0)this.resamplingCoef=b.resamplingCoef;if(b.createDebugPath!==void 0)this.createDebugPath=b.createDebugPath;if(b.createDebugDummy!==
 void 0)this.createDebugDummy=b.createDebugDummy;if(b.lookSpeed!==void 0)this.lookSpeed=b.lookSpeed;if(b.lookVertical!==void 0)this.lookVertical=b.lookVertical;if(b.lookHorizontal!==void 0)this.lookHorizontal=b.lookHorizontal;if(b.verticalAngleMap!==void 0)this.verticalAngleMap=b.verticalAngleMap;if(b.horizontalAngleMap!==void 0)this.horizontalAngleMap=b.horizontalAngleMap;if(b.domElement!==void 0)this.domElement=b.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=
 window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var g=Math.PI*2,f=Math.PI/180;this.update=function(b,c,d){var e,j;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*f;this.theta=this.lon*f;e=this.phi%g;this.phi=e>=0?e:e+g;e=this.verticalAngleMap.srcRange;j=this.verticalAngleMap.dstRange;var k=j[1]-j[0];this.phi=
 TWEEN.Easing.Quadratic.EaseInOut(((this.phi-e[0])*(j[1]-j[0])/(e[1]-e[0])+j[0]-j[0])/k)*k+j[0];e=this.horizontalAngleMap.srcRange;j=this.horizontalAngleMap.dstRange;k=j[1]-j[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-e[0])*(j[1]-j[0])/(e[1]-e[0])+j[0]-j[0])/k)*k+j[0];e=this.target.position;e.x=100*Math.sin(this.phi)*Math.cos(this.theta);e.y=100*Math.cos(this.phi);e.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,b,c,d)};this.onMouseMove=function(b){this.mouseX=
-b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),j=new THREE.MeshLambertMaterial({color:65280}),k=new THREE.Cube(10,10,20),m=new THREE.Cube(2,2,10);this.animationParent=new THREE.Mesh(k,b);b=new THREE.Mesh(m,j);b.position.set(0,10,0);this.animation=c(this.animationParent,
-this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(b)}else this.animation=c(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&e(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(b,c){return function(){c.apply(b,arguments)}}(this,this.onMouseMove),!1)};
-THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;
+b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),j=new THREE.MeshLambertMaterial({color:65280}),k=new THREE.CubeGeometry(10,10,20),m=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(k,b);b=new THREE.Mesh(m,j);b.position.set(0,10,0);this.animation=
+c(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(b)}else this.animation=c(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&e(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(b,c){return function(){c.apply(b,arguments)}}(this,this.onMouseMove),
+!1)};THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;
 THREE.FlyCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.005;this.autoForward=this.dragToLook=!1;this.domElement=document;if(b){if(b.movementSpeed!==void 0)this.movementSpeed=b.movementSpeed;if(b.rollSpeed!==void 0)this.rollSpeed=b.rollSpeed;if(b.dragToLook!==void 0)this.dragToLook=b.dragToLook;if(b.autoForward!==void 0)this.autoForward=
 b.autoForward;if(b.domElement!==void 0)this.domElement=b.domElement}this.useTarget=!1;this.useQuaternion=!0;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.lastUpdate=-1;this.tdiff=0;this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.keydown=function(b){if(!b.altKey){switch(b.keyCode){case 16:this.movementSpeedMultiplier=
 0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};
@@ -499,12 +499,12 @@ J.objects[u]=object,J.empties[u]=object,D.trigger&&D.trigger.toLowerCase()!="non
 U=h=0;J={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};var $=!1;for(u in G.objects)if(D=G.objects[u],D.meshCollider){$=!0;break}if($)J.scene.collisions=new THREE.CollisionSystem;if(G.transform){$=G.transform.position;H=G.transform.rotation;var R=G.transform.scale;$&&J.scene.position.set($[0],$[1],$[2]);H&&J.scene.rotation.set(H[0],H[1],H[2]);R&&J.scene.scale.set(R[0],R[1],R[2]);($||H||R)&&J.scene.updateMatrix()}$=function(){U-=
 1;o();d.onLoadComplete()};for(z in G.cameras){H=G.cameras[z];if(H.type=="perspective")O=new THREE.Camera(H.fov,H.aspect,H.near,H.far);else if(H.type=="ortho")O=new THREE.Camera,O.projectionMatrix=THREE.Matrix4.makeOrtho(H.left,H.right,H.top,H.bottom,H.near,H.far);x=H.position;H=H.target;O.position.set(x[0],x[1],x[2]);O.target.position.set(H[0],H[1],H[2]);J.cameras[z]=O}for(v in G.lights){z=G.lights[v];O=z.color!==void 0?z.color:16777215;H=z.intensity!==void 0?z.intensity:1;if(z.type=="directional")x=
 z.direction,light=new THREE.DirectionalLight(O,H),light.position.set(x[0],x[1],x[2]),light.position.normalize();else if(z.type=="point")x=z.position,light=new THREE.PointLight(O,H),light.position.set(x[0],x[1],x[2]);J.scene.addLight(light);J.lights[v]=light}for(B in G.fogs)v=G.fogs[B],v.type=="linear"?C=new THREE.Fog(0,v.near,v.far):v.type=="exp2"&&(C=new THREE.FogExp2(0,v.density)),H=v.color,C.color.setRGB(H[0],H[1],H[2]),J.fogs[B]=C;if(J.cameras&&G.defaults.camera)J.currentCamera=J.cameras[G.defaults.camera];
-if(J.fogs&&G.defaults.fog)J.scene.fog=J.fogs[G.defaults.fog];H=G.defaults.bgcolor;J.bgColor=new THREE.Color;J.bgColor.setRGB(H[0],H[1],H[2]);J.bgColorAlpha=G.defaults.bgalpha;for(p in G.geometries)if(B=G.geometries[p],B.type=="bin_mesh"||B.type=="ascii_mesh")h+=1,d.onLoadStart();Q=h;for(p in G.geometries)B=G.geometries[p],B.type=="cube"?(A=new THREE.Cube(B.width,B.height,B.depth,B.segmentsWidth,B.segmentsHeight,B.segmentsDepth,null,B.flipped,B.sides),J.geometries[p]=A):B.type=="plane"?(A=new THREE.Plane(B.width,
-B.height,B.segmentsWidth,B.segmentsHeight),J.geometries[p]=A):B.type=="sphere"?(A=new THREE.Sphere(B.radius,B.segmentsWidth,B.segmentsHeight),J.geometries[p]=A):B.type=="cylinder"?(A=new THREE.Cylinder(B.numSegs,B.topRad,B.botRad,B.height,B.topOffset,B.botOffset),J.geometries[p]=A):B.type=="torus"?(A=new THREE.Torus(B.radius,B.tube,B.segmentsR,B.segmentsT),J.geometries[p]=A):B.type=="icosahedron"?(A=new THREE.Icosahedron(B.subdivisions),J.geometries[p]=A):B.type=="bin_mesh"?b.load({model:e(B.url,
-G.urlBaseType),callback:m(p)}):B.type=="ascii_mesh"?S.load({model:e(B.url,G.urlBaseType),callback:m(p)}):B.type=="embedded_mesh"&&(B=G.embeds[B.id])&&S.createModel(B,n(p),"");for(y in G.textures)if(p=G.textures[y],p.url instanceof Array){U+=p.url.length;for(b=0;b<p.url.length;b++)d.onLoadStart()}else U+=1,d.onLoadStart();W=U;for(y in G.textures){p=G.textures[y];if(p.mapping!=void 0&&THREE[p.mapping]!=void 0)p.mapping=new THREE[p.mapping];if(p.url instanceof Array){for(var b=[],P=0;P<p.url.length;P++)b[P]=
-e(p.url[P],G.urlBaseType);b=THREE.ImageUtils.loadTextureCube(b,p.mapping,$)}else{b=THREE.ImageUtils.loadTexture(e(p.url,G.urlBaseType),p.mapping,$);if(THREE[p.minFilter]!=void 0)b.minFilter=THREE[p.minFilter];if(THREE[p.magFilter]!=void 0)b.magFilter=THREE[p.magFilter]}J.textures[y]=b}for(t in G.materials){y=G.materials[t];for(F in y.parameters)if(F=="envMap"||F=="map"||F=="lightMap")y.parameters[F]=J.textures[y.parameters[F]];else if(F=="shading")y.parameters[F]=y.parameters[F]=="flat"?THREE.FlatShading:
-THREE.SmoothShading;else if(F=="blending")y.parameters[F]=THREE[y.parameters[F]]?THREE[y.parameters[F]]:THREE.NormalBlending;else if(F=="combine")y.parameters[F]=y.parameters[F]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(F=="vertexColors")if(y.parameters[F]=="face")y.parameters[F]=THREE.FaceColors;else if(y.parameters[F])y.parameters[F]=THREE.VertexColors;if(y.parameters.opacity!==void 0&&y.parameters.opacity<1)y.parameters.transparent=!0;y=new THREE[y.type](y.parameters);
-J.materials[t]=y}k();d.callbackSync(J)}}};
+if(J.fogs&&G.defaults.fog)J.scene.fog=J.fogs[G.defaults.fog];H=G.defaults.bgcolor;J.bgColor=new THREE.Color;J.bgColor.setRGB(H[0],H[1],H[2]);J.bgColorAlpha=G.defaults.bgalpha;for(p in G.geometries)if(B=G.geometries[p],B.type=="bin_mesh"||B.type=="ascii_mesh")h+=1,d.onLoadStart();Q=h;for(p in G.geometries)B=G.geometries[p],B.type=="cube"?(A=new THREE.CubeGeometry(B.width,B.height,B.depth,B.segmentsWidth,B.segmentsHeight,B.segmentsDepth,null,B.flipped,B.sides),J.geometries[p]=A):B.type=="plane"?(A=
+new THREE.PlaneGeometry(B.width,B.height,B.segmentsWidth,B.segmentsHeight),J.geometries[p]=A):B.type=="sphere"?(A=new THREE.SphereGeometry(B.radius,B.segmentsWidth,B.segmentsHeight),J.geometries[p]=A):B.type=="cylinder"?(A=new THREE.CylinderGeometry(B.numSegs,B.topRad,B.botRad,B.height,B.topOffset,B.botOffset),J.geometries[p]=A):B.type=="torus"?(A=new THREE.TorusGeometry(B.radius,B.tube,B.segmentsR,B.segmentsT),J.geometries[p]=A):B.type=="icosahedron"?(A=new THREE.IcosahedronGeometry(B.subdivisions),
+J.geometries[p]=A):B.type=="bin_mesh"?b.load({model:e(B.url,G.urlBaseType),callback:m(p)}):B.type=="ascii_mesh"?S.load({model:e(B.url,G.urlBaseType),callback:m(p)}):B.type=="embedded_mesh"&&(B=G.embeds[B.id])&&S.createModel(B,n(p),"");for(y in G.textures)if(p=G.textures[y],p.url instanceof Array){U+=p.url.length;for(b=0;b<p.url.length;b++)d.onLoadStart()}else U+=1,d.onLoadStart();W=U;for(y in G.textures){p=G.textures[y];if(p.mapping!=void 0&&THREE[p.mapping]!=void 0)p.mapping=new THREE[p.mapping];
+if(p.url instanceof Array){for(var b=[],P=0;P<p.url.length;P++)b[P]=e(p.url[P],G.urlBaseType);b=THREE.ImageUtils.loadTextureCube(b,p.mapping,$)}else{b=THREE.ImageUtils.loadTexture(e(p.url,G.urlBaseType),p.mapping,$);if(THREE[p.minFilter]!=void 0)b.minFilter=THREE[p.minFilter];if(THREE[p.magFilter]!=void 0)b.magFilter=THREE[p.magFilter]}J.textures[y]=b}for(t in G.materials){y=G.materials[t];for(F in y.parameters)if(F=="envMap"||F=="map"||F=="lightMap")y.parameters[F]=J.textures[y.parameters[F]];else if(F==
+"shading")y.parameters[F]=y.parameters[F]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(F=="blending")y.parameters[F]=THREE[y.parameters[F]]?THREE[y.parameters[F]]:THREE.NormalBlending;else if(F=="combine")y.parameters[F]=y.parameters[F]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(F=="vertexColors")if(y.parameters[F]=="face")y.parameters[F]=THREE.FaceColors;else if(y.parameters[F])y.parameters[F]=THREE.VertexColors;if(y.parameters.opacity!==void 0&&y.parameters.opacity<
+1)y.parameters.transparent=!0;y=new THREE[y.type](y.parameters);J.materials[t]=y}k();d.callbackSync(J)}}};
 THREE.MarchingCubes=function(b,c){THREE.Object3D.call(this);this.materials=c instanceof Array?c:[c];this.init=function(b){this.isolation=80;this.size=b;this.size2=this.size*this.size;this.size3=this.size2*this.size;this.halfsize=this.size/2;this.delta=2/this.size;this.yd=this.size;this.zd=this.size2;this.field=new Float32Array(this.size3);this.normal_cache=new Float32Array(this.size3*3);this.vlist=new Float32Array(36);this.nlist=new Float32Array(36);this.firstDraw=!0;this.maxCount=4096;this.count=
 0;this.hasNormal=this.hasPos=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(b,c,g){return b+(c-b)*g};this.VIntX=function(b,c,g,f,j,k,m,n,o,p){j=(j-o)/(p-o);o=this.normal_cache;c[f]=k+j*this.delta;c[f+1]=m;c[f+2]=n;g[f]=this.lerp(o[b],o[b+3],j);g[f+1]=this.lerp(o[b+1],o[b+4],j);g[f+2]=this.lerp(o[b+2],o[b+5],j)};this.VIntY=function(b,c,g,f,j,k,m,n,o,p){j=(j-o)/(p-o);o=this.normal_cache;c[f]=k;c[f+1]=m+j*this.delta;c[f+
 2]=n;c=b+this.yd*3;g[f]=this.lerp(o[b],o[c],j);g[f+1]=this.lerp(o[b+1],o[c+1],j);g[f+2]=this.lerp(o[b+2],o[c+2],j)};this.VIntZ=function(b,c,g,f,j,k,m,n,o,p){j=(j-o)/(p-o);o=this.normal_cache;c[f]=k;c[f+1]=m;c[f+2]=n+j*this.delta;c=b+this.zd*3;g[f]=this.lerp(o[b],o[c],j);g[f+1]=this.lerp(o[b+1],o[c+1],j);g[f+2]=this.lerp(o[b+2],o[c+2],j)};this.compNorm=function(b){var c=b*3;this.normal_cache[c]==0&&(this.normal_cache[c]=this.field[b-1]-this.field[b+1],this.normal_cache[c+1]=this.field[b-this.yd]-this.field[b+
@@ -542,7 +542,7 @@ THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0
 4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,
 -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1,0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1,3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1,0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1,9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1,1,10,
 2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);
-THREE.Trident=function(b){function c(c){return new THREE.Mesh(new THREE.Cylinder(30,0.1,b.length/20,b.length/5),new THREE.MeshBasicMaterial({color:c}))}function d(b,c){var d=new THREE.Geometry;d.vertices=[new THREE.Vertex,new THREE.Vertex(b)];return new THREE.Line(d,new THREE.LineBasicMaterial({color:c}))}THREE.Object3D.call(this);var e=Math.PI/2,g,b=b||THREE.Trident.defaultParams;if(b!==THREE.Trident.defaultParams)for(g in THREE.Trident.defaultParams)b.hasOwnProperty(g)||(b[g]=THREE.Trident.defaultParams[g]);
+THREE.Trident=function(b){function c(c){return new THREE.Mesh(new THREE.CylinderGeometry(30,0.1,b.length/20,b.length/5),new THREE.MeshBasicMaterial({color:c}))}function d(b,c){var d=new THREE.Geometry;d.vertices=[new THREE.Vertex,new THREE.Vertex(b)];return new THREE.Line(d,new THREE.LineBasicMaterial({color:c}))}THREE.Object3D.call(this);var e=Math.PI/2,g,b=b||THREE.Trident.defaultParams;if(b!==THREE.Trident.defaultParams)for(g in THREE.Trident.defaultParams)b.hasOwnProperty(g)||(b[g]=THREE.Trident.defaultParams[g]);
 this.scale=new THREE.Vector3(b.scale,b.scale,b.scale);this.addChild(d(new THREE.Vector3(b.length,0,0),b.xAxisColor));this.addChild(d(new THREE.Vector3(0,b.length,0),b.yAxisColor));this.addChild(d(new THREE.Vector3(0,0,b.length),b.zAxisColor));if(b.showArrows)g=c(b.xAxisColor),g.rotation.y=-e,g.position.x=b.length,this.addChild(g),g=c(b.yAxisColor),g.rotation.x=e,g.position.y=b.length,this.addChild(g),g=c(b.zAxisColor),g.rotation.y=Math.PI,g.position.z=b.length,this.addChild(g)};
 THREE.Trident.prototype=new THREE.Object3D;THREE.Trident.prototype.constructor=THREE.Trident;THREE.Trident.defaultParams={xAxisColor:16711680,yAxisColor:65280,zAxisColor:255,showArrows:!0,length:100,scale:1};THREE.PlaneCollider=function(b,c){this.point=b;this.normal=c};THREE.SphereCollider=function(b,c){this.center=b;this.radius=c;this.radiusSq=c*c};THREE.BoxCollider=function(b,c){this.min=b;this.max=c;this.dynamic=!0;this.normal=new THREE.Vector3};
 THREE.MeshCollider=function(b,c){this.mesh=b;this.box=c;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;THREE.CollisionSystem.prototype.merge=function(b){this.colliders=this.colliders.concat(b.colliders);this.hits=this.hits.concat(b.hits)};
@@ -562,7 +562,7 @@ THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionU
 THREE.CollisionUtils.MeshColliderWBox=function(b){return new THREE.MeshCollider(b,THREE.CollisionUtils.MeshOBB(b))};
 if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,d=this.setSize,e=this.render,g=new THREE.Camera,f=new THREE.Camera,b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},j=new THREE.WebGLRenderTarget(512,512,b),k=new THREE.WebGLRenderTarget(512,512,b),m=new THREE.Camera(53,1,1,1E4);m.position.z=2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:j},mapRight:{type:"t",value:1,
 texture:k}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});var n=
-new THREE.Scene;n.addObject(new THREE.Mesh(new THREE.Plane(2,2),_material));this.setSize=function(b,e){d.call(c,b,e);j.width=b;j.height=e;k.width=b;k.height=e};this.render=function(b,d){g.projectionMatrix=d.projectionMatrix;g.position.copy(d.position);g.target.position.copy(d.target.position);g.translateX(-10);f.projectionMatrix=d.projectionMatrix;f.position.copy(d.position);f.target.position.copy(d.target.position);f.translateX(10);e.call(c,b,g,j,!0);e.call(c,b,f,k,!0);e.call(c,n,m)}},THREE.AnaglyphWebGLRenderer.prototype=
+new THREE.Scene;n.addObject(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,e){d.call(c,b,e);j.width=b;j.height=e;k.width=b;k.height=e};this.render=function(b,d){g.projectionMatrix=d.projectionMatrix;g.position.copy(d.position);g.target.position.copy(d.target.position);g.translateX(-10);f.projectionMatrix=d.projectionMatrix;f.position.copy(d.position);f.target.position.copy(d.target.position);f.translateX(10);e.call(c,b,g,j,!0);e.call(c,b,f,k,!0);e.call(c,n,m)}},THREE.AnaglyphWebGLRenderer.prototype=
 new THREE.WebGLRenderer,THREE.AnaglyphWebGLRenderer.prototype.constructor=THREE.AnaglyphWebGLRenderer;
 if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,d=this.setSize,e=this.render,g,f,j=new THREE.Camera,k=new THREE.Camera;c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(b,e){d.call(c,b,e);g=b/2;f=e};this.render=function(b,d){this.clear();j.fov=d.fov;j.aspect=0.5*d.aspect;j.near=d.near;j.far=d.far;
 j.updateProjectionMatrix();j.position.copy(d.position);j.target.position.copy(d.target.position);j.translateX(c.separation);k.projectionMatrix=j.projectionMatrix;k.position.copy(d.position);k.target.position.copy(d.target.position);k.translateX(-c.separation);this.setViewport(0,0,g,f);e.call(c,b,j);this.setViewport(g,0,g,f);e.call(c,b,k,!1)}},THREE.CrosseyedWebGLRenderer.prototype=new THREE.WebGLRenderer,THREE.CrosseyedWebGLRenderer.prototype.constructor=THREE.CrosseyedWebGLRenderer;

+ 13 - 13
build/custom/ThreeExtras.js

@@ -4,7 +4,7 @@ clamp:function(a,b,c){return a<b?b:a>c?c:a}};THREE.ColorUtils.__hsv={h:0,s:0,v:0
 var GeometryUtils={merge:function(a,b){var c=b instanceof THREE.Mesh,d=a.vertices.length,e=c?b.geometry:b,f=a.vertices,g=e.vertices,j=a.faces,h=e.faces,k=a.faceVertexUvs[0],e=e.faceVertexUvs[0];c&&b.matrixAutoUpdate&&b.updateMatrix();for(var l=0,m=g.length;l<m;l++){var n=new THREE.Vertex(g[l].position.clone());c&&b.matrix.multiplyVector3(n.position);f.push(n)}l=0;for(m=h.length;l<m;l++){var g=h[l],o,t,v=g.vertexNormals,n=g.vertexColors;g instanceof THREE.Face3?o=new THREE.Face3(g.a+d,g.b+d,g.c+d):
 g instanceof THREE.Face4&&(o=new THREE.Face4(g.a+d,g.b+d,g.c+d,g.d+d));o.normal.copy(g.normal);c=0;for(f=v.length;c<f;c++)t=v[c],o.vertexNormals.push(t.clone());o.color.copy(g.color);c=0;for(f=n.length;c<f;c++)t=n[c],o.vertexColors.push(t.clone());o.materials=g.materials.slice();o.centroid.copy(g.centroid);j.push(o)}l=0;for(m=e.length;l<m;l++){d=e[l];j=[];c=0;for(f=d.length;c<f;c++)j.push(new THREE.UV(d[c].u,d[c].v));k.push(j)}}};
 THREE.ImageUtils={loadTexture:function(a,b,c){var d=new Image,e=new THREE.Texture(d,b);d.onload=function(){e.needsUpdate=!0;c&&c(this)};d.src=a;return e},loadTextureCube:function(a,b,c){var d,e=[],f=new THREE.Texture(e,b),b=e.loadCount=0;for(d=a.length;b<d;++b)e[b]=new Image,e[b].onload=function(){e.loadCount+=1;if(e.loadCount==6)f.needsUpdate=!0;c&&c(this)},e[b].src=a[b];return f}};
-THREE.SceneUtils={addMesh:function(a,b,c,d,e,f,g,j,h,k){b=new THREE.Mesh(b,k);b.scale.x=b.scale.y=b.scale.z=c;b.position.x=d;b.position.y=e;b.position.z=f;b.rotation.x=g;b.rotation.y=j;b.rotation.z=h;a.addObject(b);return b},addPanoramaCubeWebGL:function(a,b,c){var d=THREE.ShaderUtils.lib.cube;d.uniforms.tCube.texture=c;c=new THREE.MeshShaderMaterial({fragmentShader:d.fragmentShader,vertexShader:d.vertexShader,uniforms:d.uniforms});b=new THREE.Mesh(new THREE.Cube(b,b,b,1,1,1,null,!0),c);a.addObject(b);
+THREE.SceneUtils={addMesh:function(a,b,c,d,e,f,g,j,h,k){b=new THREE.Mesh(b,k);b.scale.x=b.scale.y=b.scale.z=c;b.position.x=d;b.position.y=e;b.position.z=f;b.rotation.x=g;b.rotation.y=j;b.rotation.z=h;a.addObject(b);return b},addPanoramaCubeWebGL:function(a,b,c){var d=THREE.ShaderUtils.lib.cube;d.uniforms.tCube.texture=c;c=new THREE.MeshShaderMaterial({fragmentShader:d.fragmentShader,vertexShader:d.vertexShader,uniforms:d.uniforms});b=new THREE.Mesh(new THREE.CubeGeometry(b,b,b,1,1,1,null,!0),c);a.addObject(b);
 return b},addPanoramaCube:function(a,b,c){var d=[];d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[0])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[1])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[2])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[3])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[4])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[5])}));b=new THREE.Mesh(new THREE.Cube(b,b,b,1,1,d,!0),
 new THREE.MeshFaceMaterial);a.addObject(b);return b},addPanoramaCubePlanes:function(a,b,c){var d=b/2,b=new THREE.Plane(b,b),e=Math.PI,f=Math.PI/2;THREE.SceneUtils.addMesh(a,b,1,0,0,-d,0,0,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(c[5])}));THREE.SceneUtils.addMesh(a,b,1,-d,0,0,0,f,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(c[0])}));THREE.SceneUtils.addMesh(a,b,1,d,0,0,0,-f,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(c[1])}));THREE.SceneUtils.addMesh(a,b,1,0,d,0,f,0,e,
 new THREE.MeshBasicMaterial({map:new THREE.Texture(c[2])}));THREE.SceneUtils.addMesh(a,b,1,0,-d,0,-f,0,e,new THREE.MeshBasicMaterial({map:new THREE.Texture(c[3])}))},showHierarchy:function(a,b){THREE.SceneUtils.traverseHierarchy(a,function(a){a.visible=b})},traverseHierarchy:function(a,b){var c,d,e=a.children.length;for(d=0;d<e;d++)c=a.children[d],b(c),THREE.SceneUtils.traverseHierarchy(c,b)}};
@@ -46,15 +46,15 @@ this.heightSpeed?this.tdiff*((this.position.y<this.heightMin?this.heightMin:this
 !1);this.domElement.addEventListener("mouseup",b(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",b(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",b(this,this.onKeyUp),!1)};THREE.QuakeCamera.prototype=new THREE.Camera;THREE.QuakeCamera.prototype.constructor=THREE.QuakeCamera;THREE.QuakeCamera.prototype.supr=THREE.Camera.prototype;
 THREE.QuakeCamera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);if(this.noFly)b.y=0;this.position.addSelf(b.multiplyScalar(a));this.target.position.addSelf(b.multiplyScalar(a))};
 THREE.PathCamera=function(a){function b(a,c,b,d){var f={name:b,fps:0.6,length:d,hierarchy:[]},e,g=c.getControlPointsArray(),j=c.getLength(),h=g.length,w=0;e=h-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:g[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[e]={time:d,pos:g[e],rot:[0,0,0,1],scl:[1,1,1]};for(e=1;e<h-1;e++)w=d*j.chunks[e]/j.total,c.keys[e]={time:w,pos:g[e]};f.hierarchy[0]=c;THREE.AnimationHandler.add(f);return new THREE.Animation(a,b,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function c(a,c){var b,
-d,f=new THREE.Geometry;for(b=0;b<a.points.length*c;b++)d=b/(a.points.length*c),d=a.getPoint(d),f.vertices[b]=new THREE.Vertex(new THREE.Vector3(d.x,d.y,d.z));return f}function d(a,b){var d=c(b,10),f=c(b,10),e=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(d,e);particleObj=new THREE.ParticleSystem(f,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);a.addChild(lineObj);particleObj.scale.set(1,1,1);a.addChild(particleObj);f=new THREE.Sphere(1,
+d,f=new THREE.Geometry;for(b=0;b<a.points.length*c;b++)d=b/(a.points.length*c),d=a.getPoint(d),f.vertices[b]=new THREE.Vertex(new THREE.Vector3(d.x,d.y,d.z));return f}function d(a,b){var d=c(b,10),f=c(b,10),e=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(d,e);particleObj=new THREE.ParticleSystem(f,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);a.addChild(lineObj);particleObj.scale.set(1,1,1);a.addChild(particleObj);f=new THREE.SphereGeometry(1,
 16,8);e=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<b.points.length;i++)d=new THREE.Mesh(f,e),d.position.copy(b.points[i]),d.updateMatrix(),a.addChild(d)}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookHorizontal=
 this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(a){if(a.duration!==void 0)this.duration=a.duration*1E3;if(a.waypoints!==void 0)this.waypoints=a.waypoints;if(a.useConstantSpeed!==void 0)this.useConstantSpeed=a.useConstantSpeed;if(a.resamplingCoef!==void 0)this.resamplingCoef=a.resamplingCoef;if(a.createDebugPath!==void 0)this.createDebugPath=a.createDebugPath;if(a.createDebugDummy!==
 void 0)this.createDebugDummy=a.createDebugDummy;if(a.lookSpeed!==void 0)this.lookSpeed=a.lookSpeed;if(a.lookVertical!==void 0)this.lookVertical=a.lookVertical;if(a.lookHorizontal!==void 0)this.lookHorizontal=a.lookHorizontal;if(a.verticalAngleMap!==void 0)this.verticalAngleMap=a.verticalAngleMap;if(a.horizontalAngleMap!==void 0)this.horizontalAngleMap=a.horizontalAngleMap;if(a.domElement!==void 0)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=
 window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var e=Math.PI*2,f=Math.PI/180;this.update=function(a,c,b){var d,g;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*f;this.theta=this.lon*f;d=this.phi%e;this.phi=d>=0?d:d+e;d=this.verticalAngleMap.srcRange;g=this.verticalAngleMap.dstRange;var j=g[1]-g[0];this.phi=
 TWEEN.Easing.Quadratic.EaseInOut(((this.phi-d[0])*(g[1]-g[0])/(d[1]-d[0])+g[0]-g[0])/j)*j+g[0];d=this.horizontalAngleMap.srcRange;g=this.horizontalAngleMap.dstRange;j=g[1]-g[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-d[0])*(g[1]-g[0])/(d[1]-d[0])+g[0]-g[0])/j)*j+g[0];d=this.target.position;d.x=100*Math.sin(this.phi)*Math.cos(this.theta);d.y=100*Math.cos(this.phi);d.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,a,c,b)};this.onMouseMove=function(a){this.mouseX=
-a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),g=new THREE.MeshLambertMaterial({color:65280}),j=new THREE.Cube(10,10,20),h=new THREE.Cube(2,2,10);this.animationParent=new THREE.Mesh(j,a);a=new THREE.Mesh(h,g);a.position.set(0,10,0);this.animation=b(this.animationParent,
-this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(a)}else this.animation=b(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&d(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(a,c){return function(){c.apply(a,arguments)}}(this,this.onMouseMove),!1)};
-THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;
+a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),g=new THREE.MeshLambertMaterial({color:65280}),j=new THREE.CubeGeometry(10,10,20),h=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(j,a);a=new THREE.Mesh(h,g);a.position.set(0,10,0);this.animation=
+b(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(a)}else this.animation=b(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&d(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(a,c){return function(){c.apply(a,arguments)}}(this,this.onMouseMove),
+!1)};THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;
 THREE.FlyCamera=function(a){function b(a,b){return function(){b.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.005;this.autoForward=this.dragToLook=!1;this.domElement=document;if(a){if(a.movementSpeed!==void 0)this.movementSpeed=a.movementSpeed;if(a.rollSpeed!==void 0)this.rollSpeed=a.rollSpeed;if(a.dragToLook!==void 0)this.dragToLook=a.dragToLook;if(a.autoForward!==void 0)this.autoForward=
 a.autoForward;if(a.domElement!==void 0)this.domElement=a.domElement}this.useTarget=!1;this.useQuaternion=!0;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.lastUpdate=-1;this.tdiff=0;this.handleEvent=function(a){if(typeof this[a.type]=="function")this[a.type](a)};this.keydown=function(a){if(!a.altKey){switch(a.keyCode){case 16:this.movementSpeedMultiplier=
 0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};
@@ -157,12 +157,12 @@ A.objects[o]=object,A.empties[o]=object,w.trigger&&w.trigger.toLowerCase()!="non
 G=L=0;A={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};var I=!1;for(o in B.objects)if(w=B.objects[o],w.meshCollider){I=!0;break}if(I)A.scene.collisions=new THREE.CollisionSystem;if(B.transform){I=B.transform.position;y=B.transform.rotation;var K=B.transform.scale;I&&A.scene.position.set(I[0],I[1],I[2]);y&&A.scene.rotation.set(y[0],y[1],y[2]);K&&A.scene.scale.set(K[0],K[1],K[2]);(I||y||K)&&A.scene.updateMatrix()}I=function(){G-=
 1;l();c.onLoadComplete()};for(v in B.cameras){y=B.cameras[v];if(y.type=="perspective")D=new THREE.Camera(y.fov,y.aspect,y.near,y.far);else if(y.type=="ortho")D=new THREE.Camera,D.projectionMatrix=THREE.Matrix4.makeOrtho(y.left,y.right,y.top,y.bottom,y.near,y.far);p=y.position;y=y.target;D.position.set(p[0],p[1],p[2]);D.target.position.set(y[0],y[1],y[2]);A.cameras[v]=D}for(t in B.lights){v=B.lights[t];D=v.color!==void 0?v.color:16777215;y=v.intensity!==void 0?v.intensity:1;if(v.type=="directional")p=
 v.direction,light=new THREE.DirectionalLight(D,y),light.position.set(p[0],p[1],p[2]),light.position.normalize();else if(v.type=="point")p=v.position,light=new THREE.PointLight(D,y),light.position.set(p[0],p[1],p[2]);A.scene.addLight(light);A.lights[t]=light}for(u in B.fogs)t=B.fogs[u],t.type=="linear"?E=new THREE.Fog(0,t.near,t.far):t.type=="exp2"&&(E=new THREE.FogExp2(0,t.density)),y=t.color,E.color.setRGB(y[0],y[1],y[2]),A.fogs[u]=E;if(A.cameras&&B.defaults.camera)A.currentCamera=A.cameras[B.defaults.camera];
-if(A.fogs&&B.defaults.fog)A.scene.fog=A.fogs[B.defaults.fog];y=B.defaults.bgcolor;A.bgColor=new THREE.Color;A.bgColor.setRGB(y[0],y[1],y[2]);A.bgColorAlpha=B.defaults.bgalpha;for(m in B.geometries)if(u=B.geometries[m],u.type=="bin_mesh"||u.type=="ascii_mesh")L+=1,c.onLoadStart();M=L;for(m in B.geometries)u=B.geometries[m],u.type=="cube"?(C=new THREE.Cube(u.width,u.height,u.depth,u.segmentsWidth,u.segmentsHeight,u.segmentsDepth,null,u.flipped,u.sides),A.geometries[m]=C):u.type=="plane"?(C=new THREE.Plane(u.width,
-u.height,u.segmentsWidth,u.segmentsHeight),A.geometries[m]=C):u.type=="sphere"?(C=new THREE.Sphere(u.radius,u.segmentsWidth,u.segmentsHeight),A.geometries[m]=C):u.type=="cylinder"?(C=new THREE.Cylinder(u.numSegs,u.topRad,u.botRad,u.height,u.topOffset,u.botOffset),A.geometries[m]=C):u.type=="torus"?(C=new THREE.Torus(u.radius,u.tube,u.segmentsR,u.segmentsT),A.geometries[m]=C):u.type=="icosahedron"?(C=new THREE.Icosahedron(u.subdivisions),A.geometries[m]=C):u.type=="bin_mesh"?a.load({model:d(u.url,
-B.urlBaseType),callback:h(m)}):u.type=="ascii_mesh"?J.load({model:d(u.url,B.urlBaseType),callback:h(m)}):u.type=="embedded_mesh"&&(u=B.embeds[u.id])&&J.createModel(u,k(m),"");for(x in B.textures)if(m=B.textures[x],m.url instanceof Array){G+=m.url.length;for(a=0;a<m.url.length;a++)c.onLoadStart()}else G+=1,c.onLoadStart();H=G;for(x in B.textures){m=B.textures[x];if(m.mapping!=void 0&&THREE[m.mapping]!=void 0)m.mapping=new THREE[m.mapping];if(m.url instanceof Array){for(var a=[],N=0;N<m.url.length;N++)a[N]=
-d(m.url[N],B.urlBaseType);a=THREE.ImageUtils.loadTextureCube(a,m.mapping,I)}else{a=THREE.ImageUtils.loadTexture(d(m.url,B.urlBaseType),m.mapping,I);if(THREE[m.minFilter]!=void 0)a.minFilter=THREE[m.minFilter];if(THREE[m.magFilter]!=void 0)a.magFilter=THREE[m.magFilter]}A.textures[x]=a}for(n in B.materials){x=B.materials[n];for(z in x.parameters)if(z=="envMap"||z=="map"||z=="lightMap")x.parameters[z]=A.textures[x.parameters[z]];else if(z=="shading")x.parameters[z]=x.parameters[z]=="flat"?THREE.FlatShading:
-THREE.SmoothShading;else if(z=="blending")x.parameters[z]=THREE[x.parameters[z]]?THREE[x.parameters[z]]:THREE.NormalBlending;else if(z=="combine")x.parameters[z]=x.parameters[z]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(z=="vertexColors")if(x.parameters[z]=="face")x.parameters[z]=THREE.FaceColors;else if(x.parameters[z])x.parameters[z]=THREE.VertexColors;if(x.parameters.opacity!==void 0&&x.parameters.opacity<1)x.parameters.transparent=!0;x=new THREE[x.type](x.parameters);
-A.materials[n]=x}j();c.callbackSync(A)}}};
+if(A.fogs&&B.defaults.fog)A.scene.fog=A.fogs[B.defaults.fog];y=B.defaults.bgcolor;A.bgColor=new THREE.Color;A.bgColor.setRGB(y[0],y[1],y[2]);A.bgColorAlpha=B.defaults.bgalpha;for(m in B.geometries)if(u=B.geometries[m],u.type=="bin_mesh"||u.type=="ascii_mesh")L+=1,c.onLoadStart();M=L;for(m in B.geometries)u=B.geometries[m],u.type=="cube"?(C=new THREE.CubeGeometry(u.width,u.height,u.depth,u.segmentsWidth,u.segmentsHeight,u.segmentsDepth,null,u.flipped,u.sides),A.geometries[m]=C):u.type=="plane"?(C=
+new THREE.PlaneGeometry(u.width,u.height,u.segmentsWidth,u.segmentsHeight),A.geometries[m]=C):u.type=="sphere"?(C=new THREE.SphereGeometry(u.radius,u.segmentsWidth,u.segmentsHeight),A.geometries[m]=C):u.type=="cylinder"?(C=new THREE.CylinderGeometry(u.numSegs,u.topRad,u.botRad,u.height,u.topOffset,u.botOffset),A.geometries[m]=C):u.type=="torus"?(C=new THREE.TorusGeometry(u.radius,u.tube,u.segmentsR,u.segmentsT),A.geometries[m]=C):u.type=="icosahedron"?(C=new THREE.IcosahedronGeometry(u.subdivisions),
+A.geometries[m]=C):u.type=="bin_mesh"?a.load({model:d(u.url,B.urlBaseType),callback:h(m)}):u.type=="ascii_mesh"?J.load({model:d(u.url,B.urlBaseType),callback:h(m)}):u.type=="embedded_mesh"&&(u=B.embeds[u.id])&&J.createModel(u,k(m),"");for(x in B.textures)if(m=B.textures[x],m.url instanceof Array){G+=m.url.length;for(a=0;a<m.url.length;a++)c.onLoadStart()}else G+=1,c.onLoadStart();H=G;for(x in B.textures){m=B.textures[x];if(m.mapping!=void 0&&THREE[m.mapping]!=void 0)m.mapping=new THREE[m.mapping];
+if(m.url instanceof Array){for(var a=[],N=0;N<m.url.length;N++)a[N]=d(m.url[N],B.urlBaseType);a=THREE.ImageUtils.loadTextureCube(a,m.mapping,I)}else{a=THREE.ImageUtils.loadTexture(d(m.url,B.urlBaseType),m.mapping,I);if(THREE[m.minFilter]!=void 0)a.minFilter=THREE[m.minFilter];if(THREE[m.magFilter]!=void 0)a.magFilter=THREE[m.magFilter]}A.textures[x]=a}for(n in B.materials){x=B.materials[n];for(z in x.parameters)if(z=="envMap"||z=="map"||z=="lightMap")x.parameters[z]=A.textures[x.parameters[z]];else if(z==
+"shading")x.parameters[z]=x.parameters[z]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(z=="blending")x.parameters[z]=THREE[x.parameters[z]]?THREE[x.parameters[z]]:THREE.NormalBlending;else if(z=="combine")x.parameters[z]=x.parameters[z]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(z=="vertexColors")if(x.parameters[z]=="face")x.parameters[z]=THREE.FaceColors;else if(x.parameters[z])x.parameters[z]=THREE.VertexColors;if(x.parameters.opacity!==void 0&&x.parameters.opacity<
+1)x.parameters.transparent=!0;x=new THREE[x.type](x.parameters);A.materials[n]=x}j();c.callbackSync(A)}}};
 THREE.MarchingCubes=function(a,b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b];this.init=function(a){this.isolation=80;this.size=a;this.size2=this.size*this.size;this.size3=this.size2*this.size;this.halfsize=this.size/2;this.delta=2/this.size;this.yd=this.size;this.zd=this.size2;this.field=new Float32Array(this.size3);this.normal_cache=new Float32Array(this.size3*3);this.vlist=new Float32Array(36);this.nlist=new Float32Array(36);this.firstDraw=!0;this.maxCount=4096;this.count=
 0;this.hasNormal=this.hasPos=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(a,b,e){return a+(b-a)*e};this.VIntX=function(a,b,e,f,g,j,h,k,l,m){g=(g-l)/(m-l);l=this.normal_cache;b[f]=j+g*this.delta;b[f+1]=h;b[f+2]=k;e[f]=this.lerp(l[a],l[a+3],g);e[f+1]=this.lerp(l[a+1],l[a+4],g);e[f+2]=this.lerp(l[a+2],l[a+5],g)};this.VIntY=function(a,b,e,f,g,j,h,k,l,m){g=(g-l)/(m-l);l=this.normal_cache;b[f]=j;b[f+1]=h+g*this.delta;b[f+
 2]=k;b=a+this.yd*3;e[f]=this.lerp(l[a],l[b],g);e[f+1]=this.lerp(l[a+1],l[b+1],g);e[f+2]=this.lerp(l[a+2],l[b+2],g)};this.VIntZ=function(a,b,e,f,g,j,h,k,l,m){g=(g-l)/(m-l);l=this.normal_cache;b[f]=j;b[f+1]=h;b[f+2]=k+g*this.delta;b=a+this.zd*3;e[f]=this.lerp(l[a],l[b],g);e[f+1]=this.lerp(l[a+1],l[b+1],g);e[f+2]=this.lerp(l[a+2],l[b+2],g)};this.compNorm=function(a){var b=a*3;this.normal_cache[b]==0&&(this.normal_cache[b]=this.field[a-1]-this.field[a+1],this.normal_cache[b+1]=this.field[a-this.yd]-this.field[a+
@@ -200,7 +200,7 @@ THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0
 4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,
 -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1,0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1,3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1,0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1,9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1,1,10,
 2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);
-THREE.Trident=function(a){function b(b){return new THREE.Mesh(new THREE.Cylinder(30,0.1,a.length/20,a.length/5),new THREE.MeshBasicMaterial({color:b}))}function c(a,b){var c=new THREE.Geometry;c.vertices=[new THREE.Vertex,new THREE.Vertex(a)];return new THREE.Line(c,new THREE.LineBasicMaterial({color:b}))}THREE.Object3D.call(this);var d=Math.PI/2,e,a=a||THREE.Trident.defaultParams;if(a!==THREE.Trident.defaultParams)for(e in THREE.Trident.defaultParams)a.hasOwnProperty(e)||(a[e]=THREE.Trident.defaultParams[e]);
+THREE.Trident=function(a){function b(b){return new THREE.Mesh(new THREE.CylinderGeometry(30,0.1,a.length/20,a.length/5),new THREE.MeshBasicMaterial({color:b}))}function c(a,b){var c=new THREE.Geometry;c.vertices=[new THREE.Vertex,new THREE.Vertex(a)];return new THREE.Line(c,new THREE.LineBasicMaterial({color:b}))}THREE.Object3D.call(this);var d=Math.PI/2,e,a=a||THREE.Trident.defaultParams;if(a!==THREE.Trident.defaultParams)for(e in THREE.Trident.defaultParams)a.hasOwnProperty(e)||(a[e]=THREE.Trident.defaultParams[e]);
 this.scale=new THREE.Vector3(a.scale,a.scale,a.scale);this.addChild(c(new THREE.Vector3(a.length,0,0),a.xAxisColor));this.addChild(c(new THREE.Vector3(0,a.length,0),a.yAxisColor));this.addChild(c(new THREE.Vector3(0,0,a.length),a.zAxisColor));if(a.showArrows)e=b(a.xAxisColor),e.rotation.y=-d,e.position.x=a.length,this.addChild(e),e=b(a.yAxisColor),e.rotation.x=d,e.position.y=a.length,this.addChild(e),e=b(a.zAxisColor),e.rotation.y=Math.PI,e.position.z=a.length,this.addChild(e)};
 THREE.Trident.prototype=new THREE.Object3D;THREE.Trident.prototype.constructor=THREE.Trident;THREE.Trident.defaultParams={xAxisColor:16711680,yAxisColor:65280,zAxisColor:255,showArrows:!0,length:100,scale:1};THREE.PlaneCollider=function(a,b){this.point=a;this.normal=b};THREE.SphereCollider=function(a,b){this.center=a;this.radius=b;this.radiusSq=b*b};THREE.BoxCollider=function(a,b){this.min=a;this.max=b;this.dynamic=!0;this.normal=new THREE.Vector3};
 THREE.MeshCollider=function(a,b){this.mesh=a;this.box=b;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;THREE.CollisionSystem.prototype.merge=function(a){this.colliders=this.colliders.concat(a.colliders);this.hits=this.hits.concat(a.hits)};
@@ -220,7 +220,7 @@ THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionU
 THREE.CollisionUtils.MeshColliderWBox=function(a){return new THREE.MeshCollider(a,THREE.CollisionUtils.MeshOBB(a))};
 if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var b=this,c=this.setSize,d=this.render,e=new THREE.Camera,f=new THREE.Camera,a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},g=new THREE.WebGLRenderTarget(512,512,a),j=new THREE.WebGLRenderTarget(512,512,a),h=new THREE.Camera(53,1,1,1E4);h.position.z=2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:g},mapRight:{type:"t",value:1,
 texture:j}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});var k=
-new THREE.Scene;k.addObject(new THREE.Mesh(new THREE.Plane(2,2),_material));this.setSize=function(a,d){c.call(b,a,d);g.width=a;g.height=d;j.width=a;j.height=d};this.render=function(a,c){e.projectionMatrix=c.projectionMatrix;e.position.copy(c.position);e.target.position.copy(c.target.position);e.translateX(-10);f.projectionMatrix=c.projectionMatrix;f.position.copy(c.position);f.target.position.copy(c.target.position);f.translateX(10);d.call(b,a,e,g,!0);d.call(b,a,f,j,!0);d.call(b,k,h)}},THREE.AnaglyphWebGLRenderer.prototype=
+new THREE.Scene;k.addObject(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,d){c.call(b,a,d);g.width=a;g.height=d;j.width=a;j.height=d};this.render=function(a,c){e.projectionMatrix=c.projectionMatrix;e.position.copy(c.position);e.target.position.copy(c.target.position);e.translateX(-10);f.projectionMatrix=c.projectionMatrix;f.position.copy(c.position);f.target.position.copy(c.target.position);f.translateX(10);d.call(b,a,e,g,!0);d.call(b,a,f,j,!0);d.call(b,k,h)}},THREE.AnaglyphWebGLRenderer.prototype=
 new THREE.WebGLRenderer,THREE.AnaglyphWebGLRenderer.prototype.constructor=THREE.AnaglyphWebGLRenderer;
 if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var b=this,c=this.setSize,d=this.render,e,f,g=new THREE.Camera,j=new THREE.Camera;b.separation=10;if(a&&a.separation!==void 0)b.separation=a.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(a,d){c.call(b,a,d);e=a/2;f=d};this.render=function(a,c){this.clear();g.fov=c.fov;g.aspect=0.5*c.aspect;g.near=c.near;g.far=c.far;
 g.updateProjectionMatrix();g.position.copy(c.position);g.target.position.copy(c.target.position);g.translateX(b.separation);j.projectionMatrix=g.projectionMatrix;j.position.copy(c.position);j.target.position.copy(c.target.position);j.translateX(-b.separation);this.setViewport(0,0,e,f);d.call(b,a,g);this.setViewport(e,0,e,f);d.call(b,a,j,!1)}},THREE.CrosseyedWebGLRenderer.prototype=new THREE.WebGLRenderer,THREE.CrosseyedWebGLRenderer.prototype.constructor=THREE.CrosseyedWebGLRenderer;

+ 1 - 1
examples/canvas_camera_orthographic.html

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

+ 2 - 2
examples/canvas_geometry_cube.html

@@ -70,14 +70,14 @@
 
 				}
 
-				cube = new THREE.Mesh( new THREE.Cube( 200, 200, 200, 1, 1, 1, materials ), new THREE.MeshFaceMaterial() );
+				cube = new THREE.Mesh( new THREE.CubeGeometry( 200, 200, 200, 1, 1, 1, materials ), new THREE.MeshFaceMaterial() );
 				cube.position.y = 150;
 				cube.overdraw = true;
 				scene.addObject( cube );
 
 				// Plane
 
-				plane = new THREE.Mesh( new THREE.Plane( 200, 200 ), new THREE.MeshBasicMaterial( { color: 0xe0e0e0 } ) );
+				plane = new THREE.Mesh( new THREE.PlaneGeometry( 200, 200 ), new THREE.MeshBasicMaterial( { color: 0xe0e0e0 } ) );
 				plane.rotation.x = - 90 * ( Math.PI / 180 );
 				plane.overdraw = true;
 				scene.addObject( plane );

+ 2 - 2
examples/canvas_geometry_earth.html

@@ -63,12 +63,12 @@
 
 				scene = new THREE.Scene();
 
-				mesh = new THREE.Mesh( new THREE.Plane( 300, 300, 3, 3 ), new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/shadow.png' ) } ) );
+				mesh = new THREE.Mesh( new THREE.PlaneGeometry( 300, 300, 3, 3 ), new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/shadow.png' ) } ) );
 				mesh.position.y = - 250;
 				mesh.rotation.x = - 90 * Math.PI / 180;
 				scene.addObject(mesh);
 
-				mesh = new THREE.Mesh( new THREE.Sphere( 200, 20, 20 ), new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/land_ocean_ice_cloud_2048.jpg' ) } ) );
+				mesh = new THREE.Mesh( new THREE.SphereGeometry( 200, 20, 20 ), new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/land_ocean_ice_cloud_2048.jpg' ) } ) );
 				mesh.overdraw = true;
 				scene.addObject(mesh);
 

+ 1 - 1
examples/canvas_geometry_hierarchy.html

@@ -48,7 +48,7 @@
 
 				scene = new THREE.Scene();
 
-				var geometry = new THREE.Cube( 100, 100, 100 );
+				var geometry = new THREE.CubeGeometry( 100, 100, 100 );
 				var material = new THREE.MeshNormalMaterial();
 
 				group = new THREE.Object3D();

+ 1 - 1
examples/canvas_geometry_panorama.html

@@ -76,7 +76,7 @@
 
 				];
 
-				mesh = new THREE.Mesh( new THREE.Cube( 300, 300, 300, 7, 7, 7, materials, true ), new THREE.MeshFaceMaterial() );
+				mesh = new THREE.Mesh( new THREE.CubeGeometry( 300, 300, 300, 7, 7, 7, materials, true ), new THREE.MeshFaceMaterial() );
 				mesh.overdraw = true;
 				scene.addObject( mesh );
 

+ 1 - 1
examples/canvas_geometry_panorama_fisheye.html

@@ -76,7 +76,7 @@
 
 				];
 
-				mesh = new THREE.Mesh( new THREE.Cube( 300, 300, 300, 7, 7, 7, materials, true ), new THREE.MeshFaceMaterial() );
+				mesh = new THREE.Mesh( new THREE.CubeGeometry( 300, 300, 300, 7, 7, 7, materials, true ), new THREE.MeshFaceMaterial() );
 				mesh.overdraw = true;
 				scene.addObject( mesh );
 

+ 1 - 1
examples/canvas_geometry_terrain.html

@@ -70,7 +70,7 @@
 				var material = new THREE.MeshBasicMaterial( { map: new THREE.Texture( generateTexture( data, 1024, 1024 ) ) } );
 
 				var quality = 16, step = 1024 / quality;
-				var plane = new THREE.Plane( 2000, 2000, quality - 1, quality - 1 );
+				var plane = new THREE.PlaneGeometry( 2000, 2000, quality - 1, quality - 1 );
 
 				for ( var i = 0, l = plane.vertices.length; i < l; i ++ ) {
 

+ 2 - 2
examples/canvas_geometry_text.html

@@ -78,7 +78,7 @@
 
 				}
                 
-                var text3d = new THREE.Text( theText, {
+		var text3d = new THREE.TextGeometry( theText, {
 
 					size: 80, 
 					height: 20,
@@ -104,7 +104,7 @@
 
 				// Plane
 
-				plane = new THREE.Mesh( new THREE.Plane( 800, 800 ), new THREE.MeshBasicMaterial( { color: 0xe0e0e0, wireframe:true }) );
+				plane = new THREE.Mesh( new THREE.PlaneGeometry( 800, 800 ), new THREE.MeshBasicMaterial( { color: 0xe0e0e0, wireframe:true }) );
 				plane.rotation.x = - 90 * ( Math.PI / 180 );
                 plane.position.x = 0;
 				plane.overdraw = true;

+ 1 - 1
examples/canvas_interactive_cubes.html

@@ -49,7 +49,7 @@
 
 				scene = new THREE.Scene();
 
-				var geometry = new THREE.Cube( 100, 100, 100 );
+				var geometry = new THREE.CubeGeometry( 100, 100, 100 );
 
 				for ( var i = 0; i < 10; i ++ ) {
 

+ 1 - 1
examples/canvas_interactive_cubes_tween.html

@@ -47,7 +47,7 @@
 
 				scene = new THREE.Scene();
 
-				var geometry = new THREE.Cube( 100, 100, 100 );
+				var geometry = new THREE.CubeGeometry( 100, 100, 100 );
 
 				for ( var i = 0; i < 20; i ++ ) {
 

+ 2 - 2
examples/canvas_interactive_voxelpainter.html

@@ -73,7 +73,7 @@
 
 				projector = new THREE.Projector();
 
-				plane = new THREE.Mesh( new THREE.Plane( 1000, 1000, 20, 20 ), new THREE.MeshFaceMaterial() );
+				plane = new THREE.Mesh( new THREE.PlaneGeometry( 1000, 1000, 20, 20 ), new THREE.MeshFaceMaterial() );
 				plane.rotation.x = - 90 * Math.PI / 180;
 				scene.addObject( plane );
 
@@ -145,7 +145,7 @@
 
 						var position = new THREE.Vector3().add( intersects[ 0 ].point, intersects[ 0 ].object.matrixRotationWorld.multiplyVector3( intersects[ 0 ].face.normal.clone() ) );
 
-						var voxel = new THREE.Mesh( new THREE.Cube( 50, 50, 50 ), [ new THREE.MeshLambertMaterial( { color: 0x00ff80, opacity: 1, shading: THREE.FlatShading } ), new THREE.MeshFaceMaterial() ] );
+						var voxel = new THREE.Mesh( new THREE.CubeGeometry( 50, 50, 50 ), [ new THREE.MeshLambertMaterial( { color: 0x00ff80, opacity: 1, shading: THREE.FlatShading } ), new THREE.MeshFaceMaterial() ] );
 						voxel.position.x = Math.floor( position.x / 50 ) * 50 + 25;
 						voxel.position.y = Math.floor( position.y / 50 ) * 50 + 25;
 						voxel.position.z = Math.floor( position.z / 50 ) * 50 + 25;

+ 1 - 1
examples/canvas_materials.html

@@ -65,7 +65,7 @@
 
 				// Spheres
 
-				var geometry = new THREE.Sphere( 100, 14, 7, false );
+				var geometry = new THREE.SphereGeometry( 100, 14, 7, false );
 
 				var materials = [
 

+ 2 - 2
examples/canvas_materials_depth.html

@@ -72,7 +72,7 @@
 
 				var material = new THREE.MeshDepthMaterial();
 
-				plane = new THREE.Mesh( new THREE.Plane( 1000, 1000, 10, 10 ), material );
+				plane = new THREE.Mesh( new THREE.PlaneGeometry( 1000, 1000, 10, 10 ), material );
 				plane.rotation.x = - 90 * ( Math.PI / 180 );
 				plane.position.y = - 100;
 				plane.doubleSided = true;
@@ -80,7 +80,7 @@
 
 				// Spheres
 
-				geometry = new THREE.Cube( 100, 100, 100 );
+				geometry = new THREE.CubeGeometry( 100, 100, 100 );
 				material = new THREE.MeshDepthMaterial( { near: 1, far: 2000 } );
 
 				for (var i = 0; i < 20; i ++ ) {

+ 1 - 1
examples/canvas_materials_video.html

@@ -104,7 +104,7 @@
 
 				//
 
-				var plane = new THREE.Plane( 480, 204, 4, 4 );
+				var plane = new THREE.PlaneGeometry( 480, 204, 4, 4 );
 
 				mesh = new THREE.Mesh( plane, material );
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 1.5;

+ 1 - 1
examples/canvas_performance.html

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

+ 28 - 13
examples/canvas_sandbox.html

@@ -33,13 +33,13 @@
 		<script type="text/javascript" src="../src/core/UV.js"></script>
 		<script type="text/javascript" src="../src/core/Geometry.js"></script>
 		<script type="text/javascript" src="../src/core/Spline.js"></script>
-		<script type="text/javascript" src="../src/animation/AnimationHandler.js"></script>
-		<script type="text/javascript" src="../src/animation/Animation.js"></script>
+		<script type="text/javascript" src="../src/core/Edge.js"></script>
 		<script type="text/javascript" src="../src/cameras/Camera.js"></script>
 		<script type="text/javascript" src="../src/lights/Light.js"></script>
 		<script type="text/javascript" src="../src/lights/AmbientLight.js"></script>
 		<script type="text/javascript" src="../src/lights/DirectionalLight.js"></script>
 		<script type="text/javascript" src="../src/lights/PointLight.js"></script>
+		<script type="text/javascript" src="../src/lights/LensFlare.js"></script>
 		<script type="text/javascript" src="../src/materials/Material.js"></script>
 		<script type="text/javascript" src="../src/materials/Mappings.js"></script>
 		<script type="text/javascript" src="../src/materials/LineBasicMaterial.js"></script>
@@ -50,12 +50,11 @@
 		<script type="text/javascript" src="../src/materials/MeshNormalMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshFaceMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/MeshShaderMaterial.js"></script>
+		<script type="text/javascript" src="../src/materials/ShadowVolumeDynamicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleBasicMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleCanvasMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/ParticleDOMMaterial.js"></script>
 		<script type="text/javascript" src="../src/materials/Texture.js"></script>
-		<script type="text/javascript" src="../src/materials/RenderTarget.js"></script>
-		<script type="text/javascript" src="../src/materials/Uniforms.js"></script>
 		<script type="text/javascript" src="../src/objects/Particle.js"></script>
 		<script type="text/javascript" src="../src/objects/ParticleSystem.js"></script>
 		<script type="text/javascript" src="../src/objects/Line.js"></script>
@@ -65,6 +64,8 @@
 		<script type="text/javascript" src="../src/objects/Ribbon.js"></script>
 		<script type="text/javascript" src="../src/objects/Sound.js"></script>
 		<script type="text/javascript" src="../src/objects/LOD.js"></script>
+		<script type="text/javascript" src="../src/objects/ShadowVolume.js"></script>
+		<script type="text/javascript" src="../src/objects/Sprite.js"></script>
 		<script type="text/javascript" src="../src/scenes/Scene.js"></script>
 		<script type="text/javascript" src="../src/scenes/Fog.js"></script>
 		<script type="text/javascript" src="../src/scenes/FogExp2.js"></script>
@@ -74,6 +75,7 @@
 		<script type="text/javascript" src="../src/renderers/SVGRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLShaders.js"></script>
 		<script type="text/javascript" src="../src/renderers/WebGLRenderer.js"></script>
+		<script type="text/javascript" src="../src/renderers/WebGLRenderTarget.js"></script>
 		<script type="text/javascript" src="../src/renderers/SoundRenderer.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableVertex.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableFace3.js"></script>
@@ -81,24 +83,37 @@
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableObject.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableParticle.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableLine.js"></script>
+		<script type="text/javascript" src="../src/extras/ColorUtils.js"></script>
 		<script type="text/javascript" src="../src/extras/GeometryUtils.js"></script>
 		<script type="text/javascript" src="../src/extras/ImageUtils.js"></script>
 		<script type="text/javascript" src="../src/extras/SceneUtils.js"></script>
 		<script type="text/javascript" src="../src/extras/ShaderUtils.js"></script>
+		<script type="text/javascript" src="../src/extras/animation/AnimationHandler.js"></script>
+		<script type="text/javascript" src="../src/extras/animation/Animation.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/QuakeCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/PathCamera.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Cube.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Cylinder.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Icosahedron.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Lathe.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Plane.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Sphere.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Torus.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/TorusKnot.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/FlyCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/RollCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/TrackballCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/CubeGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/CylinderGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/IcosahedronGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/LatheGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/PlaneGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/SphereGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/TextGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/TorusGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/TorusKnotGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/io/Loader.js"></script>
 		<script type="text/javascript" src="../src/extras/io/JSONLoader.js"></script>
 		<script type="text/javascript" src="../src/extras/io/BinaryLoader.js"></script>
+		<script type="text/javascript" src="../src/extras/io/SceneLoader.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
+		<script type="text/javascript" src="../src/extras/objects/Trident.js"></script>
+		<script type="text/javascript" src="../src/extras/physics/Collisions.js"></script>
+		<script type="text/javascript" src="../src/extras/physics/CollisionUtils.js"></script>
+		<script type="text/javascript" src="../src/extras/renderers/AnaglyphWebGLRenderer.js"></script>
+		<script type="text/javascript" src="../src/extras/renderers/CrosseyedWebGLRenderer.js"></script>
 
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
@@ -171,7 +186,7 @@
 
 				objects = [];
 
-				geometry = new THREE.Sphere( 100, 16, 8 );
+				geometry = new THREE.SphereGeometry( 100, 16, 8 );
 				material = new THREE.MeshBasicMaterial( { envMap: THREE.ImageUtils.loadTexture( 'textures/metal.jpg', new THREE.SphericalReflectionMapping() ) } );
 
 				for ( var i = 0; i < 10; i ++ ) {

+ 1 - 1
examples/misc_camera_path.html

@@ -84,7 +84,7 @@
 
 				// world
 
-				var cube = new THREE.Cube( 20, 60, 20 );
+				var cube = new THREE.CubeGeometry( 20, 60, 20 );
 				
 				cube.vertices[ 0 ].position.multiplyScalar( 0.01 );
 				cube.vertices[ 1 ].position.multiplyScalar( 0.01 );

+ 1 - 1
examples/misc_camera_roll.html

@@ -67,7 +67,7 @@
 
 				// world
 
-				var cube = new THREE.Cube( 20, 60, 20 );
+				var cube = new THREE.CubeGeometry( 20, 60, 20 );
 				
 				cube.vertices[ 0 ].position.multiplyScalar( 0.01 );
 				cube.vertices[ 1 ].position.multiplyScalar( 0.01 );

+ 1 - 1
examples/misc_camera_trackball.html

@@ -84,7 +84,7 @@
 
 				// world
 
-				var cube = new THREE.Cube( 20, 60, 20 );
+				var cube = new THREE.CubeGeometry( 20, 60, 20 );
 				
 				cube.vertices[ 0 ].position.multiplyScalar( 0.01 );
 				cube.vertices[ 1 ].position.multiplyScalar( 0.01 );

+ 1 - 1
examples/misc_lights_test.html

@@ -90,7 +90,7 @@
 
 				// Spheres
 
-				var geometry = new THREE.Sphere( 100, 16, 8 );
+				var geometry = new THREE.SphereGeometry( 100, 16, 8 );
 				var material = new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading } );
 
 				for ( var i = 0; i < 30; i ++ ) {

+ 2 - 2
examples/misc_lookat.html

@@ -64,10 +64,10 @@
 
 				scene = new THREE.Scene();
 
-				var geometry = new THREE.Cylinder( 3, 10, 0.1, 100 );
+				var geometry = new THREE.CylinderGeometry( 3, 10, 0.1, 100 );
 				var material = new THREE.MeshNormalMaterial( { shading: THREE.SmoothShading } );
 
-				target = new THREE.Mesh( new THREE.Sphere( 100, 20, 20 ), material );
+				target = new THREE.Mesh( new THREE.SphereGeometry( 100, 20, 20 ), material );
 				scene.addObject( target );
 
 				for ( var i = 0; i < 1000; i ++ ) {

+ 3 - 3
examples/misc_materials_multimaterials.html

@@ -96,7 +96,7 @@
 
 				// SPHERES
 
-				sphere = new THREE.Sphere( 100, 16, 8 );
+				sphere = new THREE.SphereGeometry( 100, 16, 8 );
 
 				for ( var i = 0; i < 10; i ++ ) {
 
@@ -242,7 +242,7 @@
 				for ( var i = 0; i < materials.length; i ++ ) {
 
 					// material
-					mesh = new THREE.Mesh( new THREE.Plane( size, size ), materials[i] );
+					mesh = new THREE.Mesh( new THREE.PlaneGeometry( size, size ), materials[i] );
 					mesh.position.x = i * ( size + 5 ) - ( ( materials.length - 1 ) * ( size + 5 ) / 2 );
 					mesh.position.y = FLOOR + size / 2 + bottom;
 					mesh.position.z = -100;
@@ -264,7 +264,7 @@
 					var xm = new THREE.MeshBasicMaterial( { map: new THREE.Texture( x ) } );
 					xm.map.needsUpdate = true;
 
-					mesh = new THREE.Mesh( new THREE.Plane( size, size ), xm );
+					mesh = new THREE.Mesh( new THREE.PlaneGeometry( size, size ), xm );
 					mesh.position.x = i * ( size + 5 ) - ( ( materials.length - 1 ) * ( size + 5 ) / 2 );
 					mesh.position.y = FLOOR + size / 2 + bottom;
 					mesh.position.z = - 99;

+ 4 - 4
examples/misc_sound.html

@@ -82,12 +82,12 @@
 				light.position.normalize();
 				scene.addLight( light );
 
-				var sphere = new THREE.Sphere( 20, 32, 16 );
+				var sphere = new THREE.SphereGeometry( 20, 32, 16 );
 
 				material_sphere1 = new THREE.MeshLambertMaterial( { color: 0xffaa00, shading: THREE.FlatShading } );
 				material_sphere2 = new THREE.MeshLambertMaterial( { color: 0xff2200, shading: THREE.FlatShading } );
 
-				var cube = new THREE.Cube( 5, 40, 5 );
+				var cube = new THREE.CubeGeometry( 5, 40, 5 );
 				var material_cube = new THREE.MeshLambertMaterial( { color: 0xffff00, shading: THREE.FlatShading } );
 				material_cube.color.setHSV( 0.1, 0.7, 1 );
 
@@ -132,7 +132,7 @@
 				material_wireframe.color.setHSV( 0.1, 0.2, 0.25 );
 
 
-				var plane = new THREE.Plane( 1000, 1000, 100, 100 );
+				var plane = new THREE.PlaneGeometry( 1000, 1000, 100, 100 );
 				mesh = new THREE.Mesh( plane, material_wireframe );
 				mesh.position.y = 0.1;
 				mesh.rotation.x = -1.57;
@@ -201,7 +201,7 @@
 
 				} );
 
-				postprocessing.quad = new THREE.Mesh( new THREE.Plane( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
+				postprocessing.quad = new THREE.Mesh( new THREE.PlaneGeometry( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
 				postprocessing.quad.position.z = - 500;
 				postprocessing.scene.addObject( postprocessing.quad );
 

+ 20 - 13
examples/misc_ubiquity_test.html

@@ -84,30 +84,37 @@
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableObject.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableParticle.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableLine.js"></script>
-		<script type="text/javascript" src="../src/extras/animation/AnimationHandler.js"></script>
-		<script type="text/javascript" src="../src/extras/animation/Animation.js"></script>
+		<script type="text/javascript" src="../src/extras/ColorUtils.js"></script>
 		<script type="text/javascript" src="../src/extras/GeometryUtils.js"></script>
 		<script type="text/javascript" src="../src/extras/ImageUtils.js"></script>
 		<script type="text/javascript" src="../src/extras/SceneUtils.js"></script>
 		<script type="text/javascript" src="../src/extras/ShaderUtils.js"></script>
+		<script type="text/javascript" src="../src/extras/animation/AnimationHandler.js"></script>
+		<script type="text/javascript" src="../src/extras/animation/Animation.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/QuakeCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/PathCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/FlyCamera.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Cube.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Cylinder.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Icosahedron.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Lathe.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Plane.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Sphere.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Torus.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/TorusKnot.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/RollCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/TrackballCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/CubeGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/CylinderGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/IcosahedronGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/LatheGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/PlaneGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/SphereGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/TextGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/TorusGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/TorusKnotGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/io/Loader.js"></script>
 		<script type="text/javascript" src="../src/extras/io/JSONLoader.js"></script>
 		<script type="text/javascript" src="../src/extras/io/BinaryLoader.js"></script>
 		<script type="text/javascript" src="../src/extras/io/SceneLoader.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
+		<script type="text/javascript" src="../src/extras/objects/Trident.js"></script>
 		<script type="text/javascript" src="../src/extras/physics/Collisions.js"></script>
 		<script type="text/javascript" src="../src/extras/physics/CollisionUtils.js"></script>
+		<script type="text/javascript" src="../src/extras/renderers/AnaglyphWebGLRenderer.js"></script>
+		<script type="text/javascript" src="../src/extras/renderers/CrosseyedWebGLRenderer.js"></script>
 		
 		<script type="text/javascript" src="obj/Qrcode.js"></script>
 
@@ -155,7 +162,7 @@
 
 				// CUBES
 
-				var cube = new THREE.Cube( 100, 100, 100 );
+				var cube = new THREE.CubeGeometry( 100, 100, 100 );
 
 				mesh = new THREE.Mesh( cube, new THREE.MeshBasicMaterial( { color: 0x0000ff, opacity: 0.5 } ) );
 				mesh.position.x = 500;
@@ -174,7 +181,7 @@
 
 				// PLANE
 
-				mesh = new THREE.Mesh( new THREE.Plane( 100, 100 ), new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff } ) );
+				mesh = new THREE.Mesh( new THREE.PlaneGeometry( 100, 100 ), new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff } ) );
 				mesh.position.y = -500;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 2;
 				mesh.doubleSided = true;
@@ -182,7 +189,7 @@
 
 				// CYLINDER
 
-				mesh = new THREE.Mesh( new THREE.Cylinder( 10, 20, 100, 200, - 50, - 20 ), new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff } ) );
+				mesh = new THREE.Mesh( new THREE.CylinderGeometry( 10, 20, 100, 200, - 50, - 20 ), new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff } ) );
 				mesh.position.x = -500;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 2;
 				scene.addObject( mesh );

+ 2 - 2
examples/webgl_collisions_box.html

@@ -87,8 +87,8 @@ function init() {
 function createCube( s, p ) {
 
 	cube = new THREE.Mesh (
-		new THREE.Cube( s,s,s, 1,1,1 ),
-		new THREE.MeshLambertMaterial( { color: 0x003300 })
+		new THREE.CubeGeometry( s, s, s ),
+		new THREE.MeshLambertMaterial( { color: 0x003300 } )
 	);
 
 	cube.position = p;

+ 14 - 20
examples/webgl_collisions_primitives.html

@@ -85,22 +85,20 @@
                 //makeWall(-360);
                 //makeWall(-480);
 
-                plane = new THREE.Mesh(new THREE.Plane(30000, 30000, 10, 10), new THREE.MeshLambertMaterial({
-                    color: 0x003300
-                }));
-                plane.position.y = -480;
-                plane.rotation.x = Math.PI / -2;
-                scene.addObject(plane);
-                geoms.push(plane);
-
-                var cplane = new THREE.PlaneCollider(plane.position, new THREE.Vector3(0, 1, 0));
+                plane = new THREE.Mesh( new THREE.PlaneGeometry( 30000, 30000, 10, 10 ), new THREE.MeshLambertMaterial( { color: 0x003300 } ) );
+                plane.position.y = - 480;
+                plane.rotation.x = Math.PI / - 2;
+                scene.addObject( plane );
+                geoms.push( plane );
+
+                var cplane = new THREE.PlaneCollider( plane.position, new THREE.Vector3( 0, 1, 0 ) );
                 cplane.mesh = plane;
-                THREE.Collisions.colliders.push(cplane);
+                THREE.Collisions.colliders.push( cplane );
 
-				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				container.appendChild( stats.domElement );
+		stats = new Stats();
+		stats.domElement.style.position = 'absolute';
+		stats.domElement.style.top = '0px';
+		container.appendChild( stats.domElement );
 
                 container.onmousemove = onDocumentMouseMove;
                 animate();
@@ -120,9 +118,7 @@
             }
 
             function createCube(s, p){
-                var cube = new THREE.Mesh(new THREE.Cube(s, s, s, 1, 1, 1), new THREE.MeshLambertMaterial({
-                    color: 0x003300
-                }));
+                var cube = new THREE.Mesh(new THREE.CubeGeometry( s, s, s ), new THREE.MeshLambertMaterial( { color: 0x003300 } ) );
                 cube.position = p;
                 scene.addObject(cube);
                 geoms.push(cube);
@@ -130,9 +126,7 @@
             }
 
             function createSphere(rad, p){
-                var sphere = new THREE.Mesh(new THREE.Sphere(rad, 10, 10), new THREE.MeshLambertMaterial({
-                    color: 0x003300
-                }));
+                var sphere = new THREE.Mesh( new THREE.SphereGeometry( rad, 10, 10 ), new THREE.MeshLambertMaterial( { color: 0x003300 } ) );
                 sphere.position = p;
                 scene.addObject(sphere);
                 geoms.push(sphere);

+ 5 - 8
examples/webgl_collisions_reaction.html

@@ -73,10 +73,8 @@
 
                 scene = new THREE.Scene();
 
-                sphere = new THREE.Mesh(new THREE.Sphere(sphereSize, 10, 10), new THREE.MeshLambertMaterial({
-                    color: 0xff0000
-                }));
-                scene.addObject(sphere);
+                sphere = new THREE.Mesh( new THREE.SphereGeometry( sphereSize, 10, 10 ), new THREE.MeshLambertMaterial( { color: 0xff0000 } ) );
+                scene.addObject( sphere );
 
                 renderer = new THREE.WebGLRenderer();
                 renderer.setSize(window.innerWidth, window.innerHeight);
@@ -108,11 +106,10 @@
             }
 
             function createCube(sx, sy, sz, p, ry){
-                var cube = new THREE.Mesh(new THREE.Cube(sx, sy, sz, 1, 1, 1), new THREE.MeshLambertMaterial({
-                    color: 0x003300//, wireframe: true
-                }));
+                
+                var cube = new THREE.Mesh( new THREE.CubeGeometry( sx, sy, sz ), new THREE.MeshLambertMaterial( { color: 0x003300 } ) );
                 cube.position = p;
-				cube.rotation.y = ry;
+		cube.rotation.y = ry;
                 scene.addObject(cube);
                 THREE.Collisions.colliders.push( THREE.CollisionUtils.MeshOBB(cube) );
 				cubes.push(cube);

+ 1 - 1
examples/webgl_collisions_terrain.html

@@ -69,7 +69,7 @@ function init() {
 	ray.origin.y = 10000;
 	ray.direction = new THREE.Vector3(0, -1, 0);
 
-	sphere = new THREE.Mesh( new THREE.Sphere( sphereSize, 10, 10 ), new THREE.MeshLambertMaterial( { color: 0xff0000 } ) );
+	sphere = new THREE.Mesh( new THREE.SphereGeometry( sphereSize, 10, 10 ), new THREE.MeshLambertMaterial( { color: 0xff0000 } ) );
 	scene.addObject(sphere);
 	camera.target = sphere;
 

+ 5 - 9
examples/webgl_collisions_trigger.html

@@ -70,16 +70,14 @@
 		camera.position.x = 300;
 		camera.position.z = 0;
 
-                mouse2d = new THREE.Vector3(0, 0, 1);
+                mouse2d = new THREE.Vector3( 0, 0, 1 );
 
-                loader = new THREE.Loader(true);
+                loader = new THREE.Loader( true );
 
                 scene = new THREE.Scene();
 
-                sphere = new THREE.Mesh(new THREE.Sphere(sphereSize, 10, 10), new THREE.MeshLambertMaterial({
-                    color: 0xff0000
-                }));
-                scene.addObject(sphere);
+                sphere = new THREE.Mesh( new THREE.SphereGeometry( sphereSize, 10, 10 ), new THREE.MeshLambertMaterial( { color: 0xff0000 } ) );
+                scene.addObject( sphere );
 
                 renderer = new THREE.WebGLRenderer();
                 renderer.setSize(window.innerWidth, window.innerHeight);
@@ -105,9 +103,7 @@
             }
 
             function createCube(sx, sy, sz, p){
-                var cube = new THREE.Mesh(new THREE.Cube(sx, sy, sz, 1, 1, 1), new THREE.MeshLambertMaterial({
-                    color: 0x003300//, wireframe: true
-                }));
+                var cube = new THREE.Mesh(new THREE.CubeGeometry( sx, sy, sz ), new THREE.MeshLambertMaterial( { color: 0x003300 } ) );
                 cube.position = p;
                 scene.addObject(cube);
                 THREE.Collisions.colliders.push( THREE.CollisionUtils.MeshOBB(cube) );

+ 2 - 2
examples/webgl_flycamera_earth.html

@@ -151,7 +151,7 @@
 
 		// planet		
 		
-        geometry = new THREE.Sphere( radius, 100, 50 );
+        geometry = new THREE.SphereGeometry( radius, 100, 50 );
 		geometry.computeTangents();		
 
         meshPlanet = new THREE.Mesh( geometry, materialNormalMap );
@@ -344,7 +344,7 @@
 		postprocessing.materialFilm.uniforms.sIntensity.value = 0.75;
 		postprocessing.materialFilm.uniforms.sCount.value = 2048;
 
-		postprocessing.quad = new THREE.Mesh( new THREE.Plane( SCREEN_WIDTH, SCREEN_HEIGHT ), postprocessing.materialConvolution );
+		postprocessing.quad = new THREE.Mesh( new THREE.PlaneGeometry( SCREEN_WIDTH, SCREEN_HEIGHT ), postprocessing.materialConvolution );
 		postprocessing.quad.position.z = - 500;
 		postprocessing.scene.addObject( postprocessing.quad );
 

+ 8 - 8
examples/webgl_geometries.html

@@ -60,27 +60,27 @@
 					new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe: true, opacity: 0.1 } )
 				];
 
-				objects[ 0 ] = object = new THREE.Mesh( new THREE.Cube( 100, 100, 100, 4, 4, 4 ), material );
+				objects[ 0 ] = object = new THREE.Mesh( new THREE.CubeGeometry( 100, 100, 100, 4, 4, 4 ), material );
 				object.position.x = - 200;
 				object.position.z = 200;
 				scene.addObject( object );
 
 
-				objects[ 1 ] = object = new THREE.Mesh( new THREE.Cylinder( 50, 25, 75, 100 ), material );
+				objects[ 1 ] = object = new THREE.Mesh( new THREE.CylinderGeometry( 50, 25, 75, 100 ), material );
 				object.position.z = 200;
 				scene.addObject( object );
 
-				objects[ 2 ] = object = new THREE.Mesh( new THREE.Icosahedron( 2 ), material );
+				objects[ 2 ] = object = new THREE.Mesh( new THREE.IcosahedronGeometry( 2 ), material );
 				object.position.x = 200;
 				object.position.z = 200;
 				object.scale.x = object.scale.y = object.scale.z = 75;
 				scene.addObject( object );
 
-				objects[ 3 ] = object = new THREE.Mesh( new THREE.Plane( 100, 100, 4, 4 ), material );
+				objects[ 3 ] = object = new THREE.Mesh( new THREE.PlaneGeometry( 100, 100, 4, 4 ), material );
 				object.position.x = - 200;
 				scene.addObject( object );
 
-				objects[ 4 ] = object = new THREE.Mesh( new THREE.Sphere( 75, 20, 10 ), material );
+				objects[ 4 ] = object = new THREE.Mesh( new THREE.SphereGeometry( 75, 20, 10 ), material );
 				scene.addObject( object );
 
 				var points = [];
@@ -91,16 +91,16 @@
 
 				}
 
-				objects[ 5 ] = object = new THREE.Mesh( new THREE.Lathe( points, 20 ), material );
+				objects[ 5 ] = object = new THREE.Mesh( new THREE.LatheGeometry( points, 20 ), material );
 				object.position.x = 200;
 				scene.addObject( object );
 
-				objects[ 6 ] = object = new THREE.Mesh( new THREE.Torus( 50, 20, 20, 20 ), material );
+				objects[ 6 ] = object = new THREE.Mesh( new THREE.TorusGeometry( 50, 20, 20, 20 ), material );
 				object.position.x = - 200;
 				object.position.z = - 200;
 				scene.addObject( object );
 
-				objects[ 7 ] = object = new THREE.Mesh( new THREE.TorusKnot( 50, 10, 50, 20 ), material );
+				objects[ 7 ] = object = new THREE.Mesh( new THREE.TorusKnotGeometry( 50, 10, 50, 20 ), material );
 				object.position.z = - 200;
 				scene.addObject( object );
 

+ 4 - 4
examples/webgl_geometry_colors.html

@@ -72,7 +72,7 @@
 				scene.addLight( light );
 
 				var shadowMaterial = new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/shadow.png' ) } );
-				var shadowGeo = new THREE.Plane( 300, 300, 1, 1 );
+				var shadowGeo = new THREE.PlaneGeometry( 300, 300, 1, 1 );
 
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 				mesh.position.y = - 250;
@@ -95,9 +95,9 @@
 
 				var color, f, f2, f3, p, n, vertexIndex,
 
-					geometry  = new THREE.Icosahedron( 1 ),
-					geometry2 = new THREE.Icosahedron( 1 ),
-					geometry3 = new THREE.Icosahedron( 1 );
+					geometry  = new THREE.IcosahedronGeometry( 1 ),
+					geometry2 = new THREE.IcosahedronGeometry( 1 ),
+					geometry3 = new THREE.IcosahedronGeometry( 1 );
 
 				for ( var i = 0; i < geometry.faces.length; i++ ) {
 

+ 1 - 1
examples/webgl_geometry_dynamic.html

@@ -89,7 +89,7 @@
 				camera.position.y = 200;
 				camera.target.position.y = camera.position.y;
 
-				geometry = new THREE.Plane( 20000, 20000, worldWidth - 1, worldDepth - 1 );
+				geometry = new THREE.PlaneGeometry( 20000, 20000, worldWidth - 1, worldDepth - 1 );
 
 				var i, j, il, jl;
 

+ 1 - 1
examples/webgl_geometry_hierarchy.html

@@ -49,7 +49,7 @@
 				scene = new THREE.Scene();
 				scene.fog = new THREE.Fog( 0xffffff, 1, 10000 );
 
-				var geometry = new THREE.Cube( 100, 100, 100 );
+				var geometry = new THREE.CubeGeometry( 100, 100, 100 );
 				var material = new THREE.MeshNormalMaterial();
 
 				group = new THREE.Object3D();

+ 1 - 1
examples/webgl_geometry_hierarchy2.html

@@ -49,7 +49,7 @@
 				scene = new THREE.Scene();
 				scene.fog = new THREE.Fog( 0xffffff, 1, 10000 );
 
-				var geometry = new THREE.Cube( 100, 100, 100 );
+				var geometry = new THREE.CubeGeometry( 100, 100, 100 );
 				var material = new THREE.MeshNormalMaterial();
 
 				var mesh = new THREE.Mesh( geometry, material );

+ 1 - 1
examples/webgl_geometry_large_mesh.html

@@ -131,7 +131,7 @@
 				scene.addLight( pointLight );
 
 				// light representation
-				sphere = new THREE.Sphere( 100, 16, 8, 1 );
+				sphere = new THREE.SphereGeometry( 100, 16, 8, 1 );
 				lightMesh = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color: 0xffaa00 } ) );
 				lightMesh.scale.x = lightMesh.scale.y = lightMesh.scale.z = 0.05;
 				lightMesh.position = pointLight.position;

+ 1 - 1
examples/webgl_geometry_minecraft.html

@@ -109,7 +109,7 @@
 					nx = ( i & 4 ) == 4;
 					pz = ( i & 2 ) == 2;
 					nz = ( i & 1 ) == 1;
-					cubes[ i ] = new THREE.Cube( 100, 100, 100, 1, 1, 1, materials, false, { px: px, nx: nx, py: true, ny: false, pz: pz, nz: nz } );
+					cubes[ i ] = new THREE.CubeGeometry( 100, 100, 100, 1, 1, 1, materials, false, { px: px, nx: nx, py: true, ny: false, pz: pz, nz: nz } );
 
 				}
 

+ 1 - 1
examples/webgl_geometry_minecraft_ao.html

@@ -371,7 +371,7 @@
 
 						sides = { px: px, nx: nx, py: true, ny: false, pz: pz, nz: nz };
 
-						cube = new THREE.Cube( 100, 100, 100, 1, 1, 1, materials, false, sides );
+						cube = new THREE.CubeGeometry( 100, 100, 100, 1, 1, 1, materials, false, sides );
 
 						// set UV tiles
 

+ 1 - 1
examples/webgl_geometry_terrain.html

@@ -83,7 +83,7 @@
 				camera.position.y = data[ worldHalfWidth + worldHalfDepth * worldWidth ] + 500;
 				camera.target.position.y = camera.position.y;
 
-				var geometry = new THREE.Plane( 7500, 7500, worldWidth - 1, worldDepth - 1 );
+				var geometry = new THREE.PlaneGeometry( 7500, 7500, worldWidth - 1, worldDepth - 1 );
 
 				for ( var i = 0, l = geometry.vertices.length; i < l; i ++ ) {
 

+ 1 - 1
examples/webgl_geometry_terrain_fog.html

@@ -83,7 +83,7 @@
 				camera.position.y = data[ worldHalfWidth + worldHalfDepth * worldWidth ] * 10 + 500;
 				camera.target.position.y = camera.position.y;
 
-				var geometry = new THREE.Plane( 7500, 7500, worldWidth - 1, worldDepth - 1 );
+				var geometry = new THREE.PlaneGeometry( 7500, 7500, worldWidth - 1, worldDepth - 1 );
 
 				for ( var i = 0, l = geometry.vertices.length; i < l; i ++ ) {
 

+ 488 - 330
examples/webgl_geometry_text.html

@@ -1,70 +1,109 @@
 <!DOCTYPE HTML>
 <html lang="en">
 	<head>
-		<title>three.js canvas/webgl - geometry - text</title>
+		<title>three.js webgl - geometry - text</title>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
 		<style type="text/css">
 			body {
 				font-family: Monospace;
-				background-color: #000000;
-                /*f0f0f0*/
+				background-color: #000;
+				color: #fff;
 				margin: 0px;
 				overflow: hidden;
 			}
-			
 			#info {
 				position: absolute;
-				top: 10px; 
+				top: 10px;
 				width: 100%;
-				padding: 5px;
 				text-align: center;
-				color: white;
+				z-index: 100;
+				display:block;
 			}
-			
+			#info a, .button { color: #f00; font-weight: bold; text-decoration: underline; cursor: pointer }
 		</style>
 	</head>
 	<body>
-			<div id="info">
-				Drag to spin the text
-				<br/>Simple Dynamic 3D Text WebGL Example by <a href="http://www.lab4games.net/zz85/blog">zz85</a>
-			</div>
-			
+
+		<div id="info">
+		<a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - procedural 3D text by <a href="http://www.lab4games.net/zz85/blog" target="_blank">zz85</a> &amp; alteredq 
+		(fonts from <a href="http://typeface.neocracy.org/">typeface.js</a> and <a href="http://en.wikipedia.org/wiki/Droid_%28font%29">Droid</a>)
+		<br/>type to enter new text, drag to spin the text
+		<br/><span class="button" id="color">change color</span>, 
+			<span class="button" id="font">change font</span>, 
+			<span class="button" id="weight">change weight</span>, 
+			<span class="button" id="postprocessing">change postprocessing</span>, 
+			<a id="permalink" href="#">permalink</a>
+		</div>
+
 
 		<script type="text/javascript" src="../build/Three.js"></script>
+
+		<script type="text/javascript" src="js/Detector.js"></script>
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
-       
-     
-		<link href="js/gui/gui.css" media="screen" rel="stylesheet" type="text/css" />
-		<script type="text/javascript" src="js/gui/gui.min.js"></script>
-		
-		<script type="text/javascript" src="../src/extras/geometries/Text.js"></script> 
-		
-	<!--  
-		<script type="text/javascript" src="http://canvas-text.googlecode.com/svn-history/r41/trunk/faces/optimer-normal-normal.js"></script>
-		
-		http://canvas-text.googlecode.com/svn-history/r41/trunk/faces/dejavu_serif-normal-normal.js
-		
-		http://canvas-text.googlecode.com/svn-history/r41/trunk/faces/helvetiker-normal-normal.js
-		http://canvas-text.googlecode.com/svn-history/r41/trunk/faces/dejavu_sans-normal-normal.js
+		      
+		<!-- load the font file from canvas-text -->
 
-		http://canvas-text.googlecode.com/svn-history/r41/trunk/faces/optimer-normal-normal.js
-		http://canvas-text.googlecode.com/svn-history/r41/trunk/faces/gentilis-normal-normal.js
+		<!--
 		
-	-->
-
-		<script type="text/javascript" src="fonts/helvetiker_regular.typeface.js"></script>
+		
+		-->
+		<script type="text/javascript" src="fonts/gentilis_bold.typeface.js"></script>
+		<script type="text/javascript" src="fonts/gentilis_regular.typeface.js"></script>
+		<script type="text/javascript" src="fonts/optimer_bold.typeface.js"></script>
 		<script type="text/javascript" src="fonts/optimer_regular.typeface.js"></script>
+		<script type="text/javascript" src="fonts/helvetiker_bold.typeface.js"></script>
+		<script type="text/javascript" src="fonts/helvetiker_regular.typeface.js"></script>
+		<script type="text/javascript" src="fonts/droid/droid_sans_regular.typeface.js"></script>
+		<script type="text/javascript" src="fonts/droid/droid_sans_bold.typeface.js"></script>
+		<script type="text/javascript" src="fonts/droid/droid_serif_regular.typeface.js"></script>
+		<script type="text/javascript" src="fonts/droid/droid_serif_bold.typeface.js"></script>
+		
 
 		<script type="text/javascript">
 
-			var container, stats;
+			if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
+
+			var container, stats, permalink, hex, color;
 
 			var camera, scene, renderer;
 
-			var text, plane;
+			var textMesh1, textMesh2, textGeo, textMaterial, parent;
+
+			var firstLetter = true;
+			
+			var text = "three.js",
+				height = 20,
+				size = 80,
+				hover = 30,
+				curveSegments = 6,
+				font = "optimer", 		// helvetiker, optimer, gentilis, droid sans, droid serif
+				weight = "bold",		// normal bold
+				style = "normal";		// normal italic
+
+			var mirror = true;
+			
+			var fontMap = {
+			"helvetiker"  : 0,
+			"optimer"  	  : 1,
+			"gentilis" 	  : 2,
+			"droid sans"  : 3,
+			"droid serif" : 4
+			
+			};
+			
+			var weightMap = {
+			"normal"	: 0,
+			"bold"		: 1
+			}
 
+			var reverseFontMap = {};
+			var reverseWeightMap = {};
+			
+			for ( var i in fontMap ) reverseFontMap[ fontMap[i] ] = i;
+			for ( var i in weightMap ) reverseWeightMap[ weightMap[i] ] = i;
+			
 			var targetRotation = 0;
 			var targetRotationOnMouseDown = 0;
 
@@ -73,297 +112,333 @@
 
 			var windowHalfX = window.innerWidth / 2;
 			var windowHalfY = window.innerHeight / 2;
-			var mouseY = 0;
-			var materials;
-			
+
+			var postprocessing = { enabled : true };
+			var glow = 0.9;
+
 			init();
 			animate();
 
+			function capitalize( txt ) {
+			
+				return txt.substring( 0, 1 ).toUpperCase() + txt.substring( 1 );
+
+			}
+			
+			function decimalToHex( d ) {
+  
+				var hex = Number( d ).toString( 16 );
+				hex = "000000".substr( 0, 6 - hex.length ) + hex; 
+				return hex.toUpperCase();
+
+			}
+			
 			function init() {
-                //ThreeFont.face = 'optimer';
+
 				container = document.createElement( 'div' );
 				document.body.appendChild( container );
 
-				camera = new THREE.Camera( 70, window.innerWidth / window.innerHeight, 1, 1000 );
+				permalink = document.getElementById( "permalink" );
 				
-				var originalCamPos = new THREE.Vector3(0,150,500);
-				camera.position = originalCamPos;
-				//camera.position.z = 500;
-				//camera.target.position.y = 150;
+				camera = new THREE.Camera( 30, window.innerWidth / window.innerHeight, 1, 1500 );
+				camera.position.y = 400;
+				camera.position.z = 700;
+				camera.target.position.y = 100;
 
 				scene = new THREE.Scene();
+				
+				scene.fog = new THREE.Fog( 0x000000, 250, 1400 );
 
-				// text
+				var dirLight = new THREE.DirectionalLight( 0xffffff, 0.125 );
+				dirLight.position.set( 0, 0, 1 );
+				dirLight.position.normalize();
+				scene.addLight( dirLight );
 
-			
+				var pointLight = new THREE.PointLight( 0xffffff, 1.5 );
+				pointLight.position.set( 0, 100, 50 );
+				scene.addLight( pointLight );				
 
+				//text = capitalize( font ) + " " + capitalize( weight );
+				//text = "abcdefghijklmnopqrstuvwxyz0123456789";
+				//text = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+
+				// Get text from hash
+
+				var hash = document.location.hash.substr( 1 );
 				
-                
-                
-				// Materials
-				
-				var materials = [];
+				if ( hash.length !== 0 ) {
+                   
+					var colorhash  = hash.substring( 0, 6 );
+					var fonthash   = hash.substring( 6, 7 );
+					var weighthash = hash.substring( 7, 8 );
+					var pphash 	   = hash.substring( 8, 9 );
+					var texthash   = hash.substring( 10 );					
+
+					hex = colorhash;
+					pointLight.color.setHex( parseInt( colorhash, 16 ) );
+					
+					font = reverseFontMap[ parseInt( fonthash ) ];
+					weight = reverseWeightMap[ parseInt( weighthash ) ];
+					
+					postprocessing.enabled = parseInt( pphash );
+					
+					text = decodeURI( texthash );
 
-				for ( var i = 0; i < 6; i ++ ) {
+					updatePermalink();
 
-					materials.push( [ new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff , wireframe:false} ) ] );
+				} else {
 
-				}
+					pointLight.color.setHSV( Math.random(), 0.95, 0.85 );					
+					pointLight.color.updateHex();
+					hex = decimalToHex( pointLight.color.hex );
 
-				var generatedTexture = new THREE.Texture( generateTexture() );
-				generatedTexture.needsUpdate = true;
- 
-				//var 
-				materials = [];
-				materials.push( new THREE.MeshLambertMaterial( { map: generatedTexture } ) );
-				materials.push( new THREE.MeshLambertMaterial( { color: 0xdddddd, shading: THREE.FlatShading } ) );
-				materials.push( new THREE.MeshPhongMaterial( { ambient: 0x030303, color: 0xdddddd, specular: 0x009900, shininess: 30, shading: THREE.FlatShading } ) );
-				materials.push( new THREE.MeshNormalMaterial( ) );
-				materials.push( new THREE.MeshBasicMaterial( { color: 0x665500, blending: THREE.AdditiveBlending } ) );
-				materials.push( new THREE.MeshBasicMaterial( { color: 0xff0000, blending: THREE.SubtractiveBlending } ) );
- 
-				materials.push( new THREE.MeshLambertMaterial( { color: 0xdddddd, shading: THREE.SmoothShading } ) );
-				materials.push( new THREE.MeshPhongMaterial( { ambient: 0x030303, color: 0xdddddd, specular: 0x009900, shininess: 30, shading: THREE.SmoothShading } ) );
-				materials.push( new THREE.MeshNormalMaterial( { shading: THREE.SmoothShading } ) );
-				materials.push( new THREE.MeshBasicMaterial( { color: 0xffaa00, wireframe: true } ) );
- 
-				materials.push( new THREE.MeshDepthMaterial() );
-				materials.push( new THREE.MeshBasicMaterial( { map: generatedTexture } ) );
-                
-                
-			function generateTexture() {
- 
-				var canvas = document.createElement( 'canvas' );
-				canvas.width = 256;
-				canvas.height = 256;
- 
-				var context = canvas.getContext( '2d' );
-				var image = context.getImageData( 0, 0, 256, 256 );
- 
-				var x = 0, y = 0;
- 
-				for ( var i = 0, j = 0, l = image.data.length; i < l; i += 4, j ++ ) {
- 
-					x = j % 256;
-					y = x == 0 ? y + 1 : y;
- 
-					image.data[ i + 2 ] = Math.floor( x ^ y );
-					image.data[ i + 3 ] = 255;
- 
 				}
- 
-				context.putImageData( image, 0, 0 );
- 
-				return canvas;
- 
-			}
- 
-                var theText = "B"; //Hello three.js :)
-                 var hash = document.location.hash.substr(1);
-                  if (hash.length === 0) {
-                    
-                  } else {
-                   theText = hash;
-                  }
-                
-				//var
-				   text3d = new THREE.Text(theText, {
-						size: 80, 
-						height:40,
-						curveSegments:2,
-						font: "optimer"
-					});//dejavu sans
+				
+                textGeo = new THREE.TextGeometry( text, {
+
+					size: size, 
+					height: height,
+					curveSegments: curveSegments,
+					font: font,
+					weight: weight,
+					style: style
+
+				});
+				
+                textMaterial = new THREE.MeshPhongMaterial( { color: 0xffffff, wireframe: false } );
+				
+				parent = new THREE.Object3D();
+				
+				textMesh1 = new THREE.Mesh( textGeo, textMaterial );
+
+                textMesh1.position.x = 0;
+                textMesh1.position.y = hover;
+                textMesh1.position.z = 0;
+
+                textMesh1.rotation.x = 0;
+                textMesh1.rotation.y = Math.PI * 2;
+
+                parent.addChild( textMesh1 );
+
+				if ( mirror ) {
+
+					textMesh2 = new THREE.Mesh( textGeo, textMaterial );
+
+					textMesh2.position.x = 0;
+					textMesh2.position.y = -hover;
+					textMesh2.position.z = height;
+
+					textMesh2.rotation.x = Math.PI;
+					textMesh2.rotation.y = Math.PI * 2;
+
+					parent.addChild( textMesh2 );
 					
-                //MEsh Normal MeshBasic
-                //MeshPhongMaterial MeshLambertMaterial MeshPhongMaterial
-                // new THREE.MeshLambertMaterial( { color: Math.random() * 0xffffff, wireframe:false} )
-				//text = new THREE.Mesh( text3d, materials[6] );  materials[3]
-                //new THREE.MeshLambertMaterial( { color: Math.random() * 0xffffff, wireframe:false } )
-                
-                // Math.random() *
-//0xf0f0f0
-	
-	/*
-	*  color: <hex>,
-	 *  ambient: <hex>,
-	 *  specular: <hex>,
-	 *  shininess: <float>,2
-	 *  opacity: <float>,
-	*/
-                var textMaterial = new THREE.MeshPhongMaterial( { color: 0xa0a0a0, wireframe:false, opacity:1,shininess:100,ambient:0xff0000 , specular:0x00ff00,reflectivity:100});
-				textMaterial = materials[2];
-
-                text = new THREE.Mesh( text3d, textMaterial);
-                
-                text.overdraw = true;
-                text.doubleSided = false;
-                text.position.y = 15;
-                
-                text.position.z = 0;
-                text.rotation.x = 0*Math.PI;
-                text.rotation.y = Math.PI*2;
-                
-				text.overdraw = false;
-				scene.addObject( text );
-                //scene.fog = new THREE.Fog( 0xffffff, 1, 10000 );
-                
-                
-				ambientLight = new THREE.AmbientLight( 0xffffff ) ;
-				scene.addLight(ambientLight );
-                
-                pointLight = new THREE.PointLight( 0xffffff, 1 );
- 
-                pointLight.position.x = 0;
-                pointLight.position.y = 150;
-                pointLight.position.z = 450;
+				}
+
+				parent.position.y = 100;
+				scene.addChild( parent );
+
+				var plane = new THREE.Mesh( new THREE.PlaneGeometry( 10000, 10000 ), new THREE.MeshBasicMaterial( { color: 0xffffff, opacity: 0.5, transparent: true } ) );
+				plane.rotation.x = -1.57;
+				plane.position.y = 100;
+				scene.addChild( plane );
+
+				renderer = new THREE.WebGLRenderer( { antialias: false } );
+                renderer.setSize( window.innerWidth, window.innerHeight );
 				
-                
-				scene.addLight( pointLight );
-                //Math.random() *
-                
-                 directionalLight = new THREE.DirectionalLight(  0xffffff );
-				/*
-                directionalLight.position.x = Math.random() - 0.5;
-				directionalLight.position.y = Math.random() - 0.5;
-				directionalLight.position.z = Math.random() - 0.5;
-				*/
-                directionalLight.position.x = 50;
-                directionalLight.position.y = 50;
-                directionalLight.position.z = 50;
-                
-                directionalLight.position.normalize();
-                directionalLight.lookAt(text);
-				directionalLight.castShadow = true;
-				//intensity, distance, castShadow
-                
-				scene.addLight( directionalLight );
-                
-                //0x202020
-
-				// Plane
-                // ,reflectivity:1,refractionRatio:0
-                //, shading:THREE.FlatShading
-                //new THREE.MeshBasicMaterial( { color: 0xe0e0e0, wireframe:false} )
-//new THREE.MeshPhongMaterial( { color: 0xf0f0f0, wireframe:false,shininess:100})
-                
-				plane = new THREE.Mesh( new THREE.Plane( 800, 800 ), textMaterial );
-				plane.rotation.x = - 90 * ( Math.PI / 180 );
-                plane.position.x = 0;
-				plane.overdraw = true;
-                
-                
-                
-                
-				scene.addObject( plane );
-
-                renderer = new THREE.WebGLRenderer({antialias:true});
-    			renderer.setSize( window.innerWidth, window.innerHeight );
+				renderer.setClearColor( scene.fog.color, 1 );
 
 				container.appendChild( renderer.domElement );
 
 				stats = new Stats();
 				stats.domElement.style.position = 'absolute';
 				stats.domElement.style.top = '0px';
-				container.appendChild( stats.domElement );
+				//container.appendChild( stats.domElement );
 
-
-				//mousedown
-				document.addEventListener( 'mousemove', onDocumentMouseDown, false );
+				document.addEventListener( 'mousedown', onDocumentMouseDown, false );
 				document.addEventListener( 'touchstart', onDocumentTouchStart, false );
 				document.addEventListener( 'touchmove', onDocumentTouchMove, false );
+				document.addEventListener( 'keypress', onDocumentKeyPress, false );
+				document.addEventListener( 'keydown', onDocumentKeyDown, false );
+
+				document.getElementById( "color" ).addEventListener( 'click', function() {
 				
+					pointLight.color.setHSV( Math.random(), 0.95, 0.85 );
+					pointLight.color.updateHex();
+					hex = decimalToHex( pointLight.color.hex );
+					
+					updatePermalink();					
+					
+				}, false );
+
+				document.getElementById( "font" ).addEventListener( 'click', function() {
 				
-				var effectController  = {
-
-					focus: 		1.0,
-					aperture:	0.025,
-					maxblur:	1.0,
-					ambientLightColor: 0.5,
-					directionLightX: 1,
-					directionLightY: 1,
-					directionLightZ: 1,
-					pointLightX: 0,
-					pointLightY: 1,
-					pointLightZ: 1,
-					pointLightDistance: 0,
-					pointLightIntensity:-1,
-					text: theText,
-					wireframe: false
-
-				};
+					if ( font == "helvetiker" ) {
+
+						font = "optimer";
+
+					} else if ( font == "optimer" ) {
+						
+						font = "gentilis";
+						
+					} else if ( font == "gentilis" ) {
+						
+						font = "droid sans";
+						
+					} else if ( font == "droid sans" ) {
+						
+						font = "droid serif";
+
+					} else {
+					
+						font = "helvetiker";
+						
+					}
+					
+					refreshText();
+					
+				}, false );
+
+				document.getElementById( "weight" ).addEventListener( 'click', function() {
 				
-				var textChanger = function() {
-					console.log(effectController.text);
-	
-					/*
-					text3d.set(effectController.text);
+					if ( weight == "bold" ) {
+
+						weight = "normal";
+
+					} else {
 					
-					text3d.__dirtyVertices = true;
-					text3d.__dirtyNormals = true;
-					text3d.__dirtyColors = true;
-					text3d.__dirtyElements = true;
-					text3d.__dirtyMorphTargets = true;
-					text3d.__dirtyNormals = true;
-					text3d.__dirtyTangents = true;
-					text3d.__dirtyUvs = true;
-					text3d.__dirtyVertices = true;
-					renderer.clear();
+						weight = "bold";
+						
+					}
 					
-					text.matrixAutoUpdate = true;
-					text.updateMatrix();
-					*/
+					refreshText();
 					
-					scene.removeChild(text);
-					 text3d = new THREE.Text(effectController.text, {
-							size: 80, 
-							height:40,
-							curveSegments:2,
-							font: "helvetiker" //"helvetiker"
-						});
-					text = new THREE.Mesh( text3d, textMaterial)
-					scene.addChild(text);
+				}, false );
+
+				document.getElementById( "postprocessing" ).addEventListener( 'click', function() {
+				
+					postprocessing.enabled = !postprocessing.enabled;
+					updatePermalink();
 					
+				}, false );
+
+				initPostprocessing();
+				renderer.autoClear = false;
+
+			}
+			
+			//
+			
+			function boolToNum( b ) {
+				
+				return b ? 1 : 0;
+
+			}
+			
+			function updatePermalink() {
+			
+				var link = hex + fontMap[ font ] + weightMap[ weight ] + boolToNum( postprocessing.enabled ) + "#" + encodeURI( text );
+				
+				permalink.href = "#" + link;
+				window.location.hash = link;
+
+			}
+
+			function onDocumentKeyDown( event ) {
+
+				if ( firstLetter ) {
+				
+					firstLetter = false;
+					text = "";
+
 				}
+				
+				var keyCode = event.keyCode;
+				
+				// backspace
+
+				if ( keyCode == 8 ) {
 
-				var matChanger = function( ) {
+					event.preventDefault();
 
-					//postprocessing.bokeh_uniforms["focus"].value = effectController.focus;
-					//postprocessing.bokeh_uniforms["aperture"].value = effectController.aperture;
-					//postprocessing.bokeh_uniforms["maxblur"].value = effectController.maxblur;\
+					text = text.substring( 0, text.length - 1 );
+					refreshText();
+
+					return false;
 					
+				}
+
+			}
+			
+			function onDocumentKeyPress( event ) {
+				
+				var keyCode = event.which;
+				
+				// backspace
+
+				if ( keyCode == 8 ) {
+					
+					event.preventDefault();					
 					
-					ambientLight.color.setHex(effectController.ambientLightColor*0xffffff);
-					directionalLight.position.x = 50 * effectController.directionLightX;
-	                directionalLight.position.y = 50 * effectController.directionLightY;
-	                directionalLight.position.z = 50 * effectController.directionLightZ;
-					pointLight.position.x = 500 * effectController.pointLightX;
-	                pointLight.position.y = 500 * effectController.pointLightY;
-	                pointLight.position.z = 500 * effectController.pointLightZ;
-					pointLight.distance = effectController.pointLightDistance ;
-					pointLight.intensity = effectController.pointLightIntensity ;
-				};
-
-				var gui = new GUI();
-				//gui.add( effectController, "focus", 0.0, 3.0, 0.025 ).onChange( matChanger );
-				//gui.add( effectController, "aperture", 0.001, 0.2, 0.001 ).onChange( matChanger );
-				//gui.add( effectController, "maxblur", 0.0, 3.0, 0.025 ).onChange( matChanger );
-				gui.add( effectController, "text").onChange( textChanger );
-				gui.add( effectController, "wireframe");
-				gui.add( effectController, "ambientLightColor", 0.0, 1.0, 0.025 ).onChange( matChanger );
-				gui.add( effectController, "directionLightX", -1, 1.0, 0.025 ).onChange( matChanger );
-				gui.add( effectController, "directionLightY", -1, 1.0, 0.025 ).onChange( matChanger );
-				gui.add( effectController, "directionLightZ", -1, 1.0, 0.025 ).onChange( matChanger );
-				gui.add( effectController, "pointLightX", -1, 1.0, 0.025 ).onChange( matChanger );
-				gui.add( effectController, "pointLightY", -1, 1.0, 0.025 ).onChange( matChanger );
-				gui.add( effectController, "pointLightZ", -1, 1.0, 0.025 ).onChange( matChanger );
-				gui.add( effectController, "pointLightDistance", -1, 1000, 0.5).onChange( matChanger );
-				gui.add( effectController, "pointLightIntensity", -1, 1.0, 0.025 ).onChange( matChanger );
-				gui.show();
-				matChanger();
+				} else {
+				
+					var ch = String.fromCharCode( keyCode );
+					text += ch;
+
+					refreshText();
+
+				}
+
 			}
+			
+			function refreshText() {
 
-			//
+				updatePermalink();
+				
+				scene.removeChild( textMesh1 );
+
+                textGeo = new THREE.TextGeometry( text, {
+
+					size: size, 
+					height: height,
+					curveSegments: curveSegments,
+					font: font,
+					weight: weight,
+					style: style
+
+				});
+
+				textMesh1 = new THREE.Mesh( textGeo, textMaterial );
+
+                textMesh1.position.x = 0;
+                textMesh1.position.y = hover;
+                textMesh1.position.z = 0;
+
+                textMesh1.rotation.x = 0;
+                textMesh1.rotation.y = Math.PI * 2;
+
+				parent.addChild( textMesh1 );
+
+				if ( mirror ) {
 
+					scene.removeChild( textMesh2 );
+
+					textMesh2 = new THREE.Mesh( textGeo, textMaterial );
+
+					textMesh2.position.x = 0;
+					textMesh2.position.y = -hover;
+					textMesh2.position.z = height;
+
+					textMesh2.rotation.x = Math.PI;
+					textMesh2.rotation.y = Math.PI * 2;
+					
+					
+					parent.addChild( textMesh2 );
+					
+				}
+
+			}
+			
 			function onDocumentMouseDown( event ) {
 
 				event.preventDefault();
@@ -374,14 +449,15 @@
 
 				mouseXOnMouseDown = event.clientX - windowHalfX;
 				targetRotationOnMouseDown = targetRotation;
+
 			}
 
 			function onDocumentMouseMove( event ) {
 
 				mouseX = event.clientX - windowHalfX;
-				mouseY = event.clientY - windowHalfY;
 
 				targetRotation = targetRotationOnMouseDown + ( mouseX - mouseXOnMouseDown ) * 0.02;
+
 			}
 
 			function onDocumentMouseUp( event ) {
@@ -389,6 +465,7 @@
 				document.removeEventListener( 'mousemove', onDocumentMouseMove, false );
 				document.removeEventListener( 'mouseup', onDocumentMouseUp, false );
 				document.removeEventListener( 'mouseout', onDocumentMouseOut, false );
+
 			}
 
 			function onDocumentMouseOut( event ) {
@@ -396,6 +473,7 @@
 				document.removeEventListener( 'mousemove', onDocumentMouseMove, false );
 				document.removeEventListener( 'mouseup', onDocumentMouseUp, false );
 				document.removeEventListener( 'mouseout', onDocumentMouseOut, false );
+
 			}
 
 			function onDocumentTouchStart( event ) {
@@ -408,6 +486,7 @@
 					targetRotationOnMouseDown = targetRotation;
 
 				}
+
 			}
 
 			function onDocumentTouchMove( event ) {
@@ -420,6 +499,78 @@
 					targetRotation = targetRotationOnMouseDown + ( mouseX - mouseXOnMouseDown ) * 0.05;
 
 				}
+
+			}
+
+			//
+			
+			function initPostprocessing() {
+
+				postprocessing.scene = new THREE.Scene();
+
+				postprocessing.camera = new THREE.Camera();
+				postprocessing.camera.projectionMatrix = THREE.Matrix4.makeOrtho( window.innerWidth / - 2, window.innerWidth / 2,  window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
+				postprocessing.camera.position.z = 100;
+
+				var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
+				postprocessing.rtTexture1 = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, pars );
+				postprocessing.rtTexture2 = new THREE.WebGLRenderTarget( 512, 512, pars );
+				postprocessing.rtTexture3 = new THREE.WebGLRenderTarget( 512, 512, pars );
+
+				var screen_shader = THREE.ShaderUtils.lib["screen"];
+				var screen_uniforms = THREE.UniformsUtils.clone( screen_shader.uniforms );
+
+				screen_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
+				screen_uniforms["opacity"].value = 1.0;
+
+				postprocessing.materialScreen = new THREE.MeshShaderMaterial( {
+
+					uniforms: screen_uniforms,
+					vertexShader: screen_shader.vertexShader,
+					fragmentShader: screen_shader.fragmentShader,
+					blending: THREE.AdditiveBlending,
+					transparent: true
+
+				} );
+
+				var convolution_shader = THREE.ShaderUtils.lib["convolution"];
+				var convolution_uniforms = THREE.UniformsUtils.clone( convolution_shader.uniforms );
+
+				postprocessing.blurx = new THREE.Vector2( 0.001953125, 0.0 ),
+				postprocessing.blury = new THREE.Vector2( 0.0, 0.001953125 );
+
+				convolution_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
+				convolution_uniforms["uImageIncrement"].value = postprocessing.blurx;
+				convolution_uniforms["cKernel"].value = THREE.ShaderUtils.buildKernel( 4.0 );
+
+				postprocessing.materialConvolution = new THREE.MeshShaderMaterial( {
+
+					uniforms: convolution_uniforms,
+					vertexShader:   "#define KERNEL_SIZE 25.0\n" + convolution_shader.vertexShader,
+					fragmentShader: "#define KERNEL_SIZE 25\n"   + convolution_shader.fragmentShader
+
+				} );
+
+				var film_shader = THREE.ShaderUtils.lib["film"];
+				var film_uniforms = THREE.UniformsUtils.clone( film_shader.uniforms );
+
+				film_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
+
+				postprocessing.materialFilm = new THREE.MeshShaderMaterial( { uniforms: film_uniforms, vertexShader: film_shader.vertexShader, fragmentShader: film_shader.fragmentShader } );
+				postprocessing.materialFilm.uniforms.grayscale.value = 0;
+				postprocessing.materialFilm.uniforms.nIntensity.value = 0.15;
+				postprocessing.materialFilm.uniforms.sIntensity.value = 0.25;
+				postprocessing.materialFilm.uniforms.sCount.value = 2048;
+
+				//postprocessing.materialFilm.uniforms.nIntensity.value = 0;
+				//postprocessing.materialFilm.uniforms.sIntensity.value = 0;
+
+				postprocessing.materialScreen.uniforms.opacity.value = glow;
+
+				postprocessing.quad = new THREE.Mesh( new THREE.PlaneGeometry( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
+				postprocessing.quad.position.z = - 500;
+				postprocessing.scene.addObject( postprocessing.quad );
+
 			}
 
 			//
@@ -433,61 +584,68 @@
 
 			}
 
+			var delta, time, oldTime;
+
 			function render() {
-				
-				//console.log("targetRotation",targetRotation,text.rotation.y );
 
-				//plane.rotation.z = 
-				//text.rotation.y += ( targetRotation - text.rotation.y ) * 0.05;
-				
-				//camera.position.x += ( mouseX - camera.position.x ) * 0.05;
-				//camera.position.y += ( - mouseY - camera.position.y ) * 0.05;
-				//camera.position.y += ( - mouseY + 200 - camera.position.y ) * .05;
-				//camera.position.z;
-				
-				//camera.useTarget = false;
-				//camera.rotation.z += ( targetRotation - camera.rotation.z ) * 0.05;
-				//camera.rotation.y += ( targetRotation - camera.rotation.y ) * 0.05;
-				//renderer.clear();
-				
-				camera.position.x = Math.cos(
-				(mouseX - windowHalfX)/windowHalfX * Math.PI + Math.PI/2
-				) * 500 + camera.target.position.x;
-				
-				camera.position.z = -Math.sin(
-				(mouseX - windowHalfX)/windowHalfX * Math.PI + Math.PI/2
-				) * 500;
-				
-				// + camera.target.position.z + Math.sin(
-				//(mouseY - windowHalfY)/windowHalfY * Math.PI + Math.PI/2
-				//) * 500
-				
-				/*
-				camera.position.y = Math.cos(
-				(mouseY - windowHalfY)/windowHalfY * Math.PI + Math.PI/2
-				) * 500 + camera.target.position.y;
-				*/
-				camera.position.y = (windowHalfY - mouseY)/windowHalfY *200 + camera.target.position.y;
-				//	
+				if ( ! oldTime ) oldTime = new Date().getTime();
+
+				time = new Date().getTime();
+				delta = 0.1 * ( time - oldTime );
+				oldTime = time;
 				
-				renderer.render( scene, camera );
+				parent.rotation.y += ( targetRotation - parent.rotation.y ) * 0.05;
 				
-				// Camera movement
-				// Camera rotation
-				// Text angle
-				// Text rotation
-				// Keydowns
-				// Settings
-				// Materials
+				if ( postprocessing.enabled ) {
+
+					renderer.clear();
+
+					// Render scene into texture
+
+					renderer.render( scene, camera, postprocessing.rtTexture1, true );
+
+					// Render quad with blured scene into texture (convolution pass 1)
+
+					postprocessing.quad.materials[ 0 ] = postprocessing.materialConvolution;
+
+					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
+					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blurx;
+
+					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture2, true );
+
+					// Render quad with blured scene into texture (convolution pass 2)
+
+					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture2;
+					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blury;
+
+					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture3, true );
+
+					// Render original scene with superimposed blur to texture
+
+					postprocessing.quad.materials[ 0 ] = postprocessing.materialScreen;
+
+					postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture3;
+
+					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture1, false );
+
+					// Render to screen
+
+					postprocessing.materialFilm.uniforms.time.value += 0.01;
+					postprocessing.quad.materials[ 0 ] = postprocessing.materialFilm;
+
+					postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
+					renderer.render( postprocessing.scene, postprocessing.camera );
+
+				} else {
+
+					renderer.clear();
+					renderer.render( scene, camera );
+
+				}				
+
 			}
 
 		</script>
-        <script>
-        var _gaq=[["_setAccount","UA-7549263-1"],["_trackPageview"]]; 
-        (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
-        g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js";
-        s.parentNode.insertBefore(g,s)}(document,"script"));
-        </script>
 
 	</body>
-</html>
+</html>

+ 1 - 1
examples/webgl_hdr.html

@@ -143,7 +143,7 @@
 
 				} );
 
-				var plane = new THREE.Plane( 512, 768 );
+				var plane = new THREE.PlaneGeometry( 512, 768 );
 
 				quad = new THREE.Mesh( plane, materialHDR );
 				quad.position.z = -100;

+ 1 - 1
examples/webgl_interactive_cubes.html

@@ -62,7 +62,7 @@
 				light.position.normalize();
 				scene.addLight( light );
 
-				var geometry = new THREE.Cube( 20, 20, 20 );
+				var geometry = new THREE.CubeGeometry( 20, 20, 20 );
 
 				for ( var i = 0; i < 500; i ++ ) {
 

+ 3 - 3
examples/webgl_interactive_voxelpainter.html

@@ -61,7 +61,7 @@
 
 				// roll-over helpers
 
-				rollOverGeo = new THREE.Cube( 50, 50, 50 );
+				rollOverGeo = new THREE.CubeGeometry( 50, 50, 50 );
 				rollOverMaterial = new THREE.MeshBasicMaterial( { color: 0xff0000, opacity: 0.5, transparent: true } );
 				rollOverMesh = new THREE.Mesh( rollOverGeo, rollOverMaterial );
 				scene.addObject( rollOverMesh );
@@ -69,7 +69,7 @@
 
 				// cubes
 
-				cubeGeo = new THREE.Cube( 50, 50, 50 );
+				cubeGeo = new THREE.CubeGeometry( 50, 50, 50 );
 				cubeMaterial = new THREE.MeshLambertMaterial( { color: 0x00ff80, shading: THREE.FlatShading, map: THREE.ImageUtils.loadTexture( "textures/square-outline-textured.png" ) } );
 				cubeMaterial.color.setHSV( 0.1, 0.7, 1.0 );
 				// picking
@@ -78,7 +78,7 @@
 
 				// grid
 
-				plane = new THREE.Mesh( new THREE.Plane( 1000, 1000, 20, 20 ), new THREE.MeshBasicMaterial( { color: 0x555555, wireframe: true } ) );
+				plane = new THREE.Mesh( new THREE.PlaneGeometry( 1000, 1000, 20, 20 ), new THREE.MeshBasicMaterial( { color: 0x555555, wireframe: true } ) );
 				plane.rotation.x = - 90 * Math.PI / 180;
 				scene.addObject( plane );
 

+ 1 - 1
examples/webgl_lights_pointlights.html

@@ -106,7 +106,7 @@
 				light3 = new THREE.PointLight( 0x80ff80, 2, 50 );
 				scene.addLight( light3 );
 
-				var sphere = new THREE.Sphere( 0.5, 16, 8 );
+				var sphere = new THREE.SphereGeometry( 0.5, 16, 8 );
 
 				var l1 = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color: 0xff0040 } ) );
 				l1.position = light1.position;

+ 1 - 1
examples/webgl_lines_colors.html

@@ -239,7 +239,7 @@
 
 				} );
 
-				postprocessing.quad = new THREE.Mesh( new THREE.Plane( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
+				postprocessing.quad = new THREE.Mesh( new THREE.PlaneGeometry( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
 				postprocessing.quad.position.z = - 500;
 				postprocessing.scene.addObject( postprocessing.quad );
 

+ 1 - 1
examples/webgl_lines_splines.html

@@ -191,7 +191,7 @@
 
 				} );
 
-				var plane = new THREE.Plane( window.innerWidth, window.innerHeight );
+				var plane = new THREE.PlaneGeometry( window.innerWidth, window.innerHeight );
 
 				quadScreen = new THREE.Mesh( plane, materialConvolution );
 				quadScreen.position.z = -100;

+ 4 - 4
examples/webgl_lod.html

@@ -85,10 +85,10 @@
 
 				var geometry = [
 
-					[ new THREE.Sphere( 100, 64, 32 ), 300 ],
-					[ new THREE.Sphere( 100, 32, 16 ), 1000 ],
-					[ new THREE.Sphere( 100, 16, 8 ), 2000 ],
-					[ new THREE.Sphere( 100, 8, 4 ), 10000 ]
+					[ new THREE.SphereGeometry( 100, 64, 32 ), 300 ],
+					[ new THREE.SphereGeometry( 100, 32, 16 ), 1000 ],
+					[ new THREE.SphereGeometry( 100, 16, 8 ), 2000 ],
+					[ new THREE.SphereGeometry( 100, 8, 4 ), 10000 ]
 
 				];
 

+ 4 - 4
examples/webgl_materials.html

@@ -88,9 +88,9 @@
 
 				// Spheres geometry
 
-				var geometry_smooth = new THREE.Sphere( 70, 32, 16 );
-				var geometry_flat = new THREE.Sphere( 70, 32, 16 );
-				var geometry_pieces = new THREE.Sphere( 70, 32, 16 ); // Extra geometry to be broken down for MeshFaceMaterial
+				var geometry_smooth = new THREE.SphereGeometry( 70, 32, 16 );
+				var geometry_flat = new THREE.SphereGeometry( 70, 32, 16 );
+				var geometry_pieces = new THREE.SphereGeometry( 70, 32, 16 ); // Extra geometry to be broken down for MeshFaceMaterial
 
 				for ( var i = 0, l = geometry_pieces.faces.length; i < l; i ++ ) {
 
@@ -127,7 +127,7 @@
 
 				}
 
-				particleLight = new THREE.Mesh( new THREE.Sphere( 4, 8, 8 ), new THREE.MeshBasicMaterial( { color: 0xffffff } ) );
+				particleLight = new THREE.Mesh( new THREE.SphereGeometry( 4, 8, 8 ), new THREE.MeshBasicMaterial( { color: 0xffffff } ) );
 				scene.addObject( particleLight );
 
 				// Lights

+ 1 - 1
examples/webgl_materials_cars_camaro.html

@@ -92,7 +92,7 @@
 				scene.addLight( pointLight );
 
 
-				sphere = new THREE.Sphere( 100, 16, 8, 1 );
+				sphere = new THREE.SphereGeometry( 100, 16, 8, 1 );
 				lightMesh = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color: 0xffaa00 } ) );
 				lightMesh.scale.x = lightMesh.scale.y = lightMesh.scale.z = 0.05;
 				lightMesh.position = pointLight.position;

+ 1 - 1
examples/webgl_materials_cars_camaro_crosseyed.html

@@ -95,7 +95,7 @@
 				scene.addLight( pointLight );
 
 
-				sphere = new THREE.Sphere( 100, 16, 8, 1 );
+				sphere = new THREE.SphereGeometry( 100, 16, 8, 1 );
 				lightMesh = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color: 0xffaa00 } ) );
 				lightMesh.scale.x = lightMesh.scale.y = lightMesh.scale.z = 0.05;
 				lightMesh.position = pointLight.position;

+ 1 - 1
examples/webgl_materials_cubemap.html

@@ -90,7 +90,7 @@
 				scene.addLight( pointLight );
 
 				// light representation
-				sphere = new THREE.Sphere( 100, 16, 8 );
+				sphere = new THREE.SphereGeometry( 100, 16, 8 );
 				lightMesh = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color:0xffaa00 } ) );
 				lightMesh.position = pointLight.position;
 				lightMesh.scale.x = lightMesh.scale.y = lightMesh.scale.z = 0.05;

+ 1 - 1
examples/webgl_materials_cubemap_balls_reflection.html

@@ -77,7 +77,7 @@
 				scene = new THREE.Scene();
 				sceneCube = new THREE.Scene();
 
-				var geometry = new THREE.Sphere( 100, 32, 16 );
+				var geometry = new THREE.SphereGeometry( 100, 32, 16 );
 
 				var path = "textures/cube/pisa/";
 				var format = '.png';

+ 1 - 1
examples/webgl_materials_cubemap_balls_reflection_anaglyph.html

@@ -73,7 +73,7 @@
 
 				scene = new THREE.Scene();
 
-				var geometry = new THREE.Sphere( 100, 32, 16 );
+				var geometry = new THREE.SphereGeometry( 100, 32, 16 );
 
 				var path = "textures/cube/pisa/";
 				var format = '.png';

+ 1 - 1
examples/webgl_materials_cubemap_balls_refraction.html

@@ -76,7 +76,7 @@
 				scene = new THREE.Scene();
 				sceneCube = new THREE.Scene();
 
-				var geometry = new THREE.Sphere( 100, 32, 16 );
+				var geometry = new THREE.SphereGeometry( 100, 32, 16 );
 
 				var path = "textures/cube/skybox/";
 				var format = '.jpg';

+ 1 - 1
examples/webgl_materials_cubemap_balls_refraction_crosseyed.html

@@ -75,7 +75,7 @@
 
 				scene = new THREE.Scene();
 
-				var geometry = new THREE.Sphere( 100, 32, 16 );
+				var geometry = new THREE.SphereGeometry( 100, 32, 16 );
 
 				var path = "textures/cube/skybox/";
 				var format = '.jpg';

+ 1 - 1
examples/webgl_materials_cubemap_escher.html

@@ -81,7 +81,7 @@
 
 				var textureCube = THREE.ImageUtils.loadTextureCube( urls );
 				var material = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } )
-				var geometry = new THREE.Sphere( 100, 96, 64 );
+				var geometry = new THREE.SphereGeometry( 100, 96, 64 );
 
 				var mesh = new THREE.Mesh( geometry, material );
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 16;

+ 1 - 1
examples/webgl_materials_cubemap_refraction.html

@@ -88,7 +88,7 @@
 				scene.addLight( pointLight );
 
 				// light representation
-				sphere = new THREE.Sphere( 100, 16, 8 );
+				sphere = new THREE.SphereGeometry( 100, 16, 8 );
 				lightMesh = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color:0xffaa00 } ) );
 				lightMesh.position = pointLight.position;
 				lightMesh.scale.x = lightMesh.scale.y = lightMesh.scale.z = 0.05;

+ 1 - 1
examples/webgl_materials_grass.html

@@ -40,7 +40,7 @@
 
 				scene = new THREE.Scene();
 
-				var geometry = new THREE.Plane( 100, 100 );
+				var geometry = new THREE.PlaneGeometry( 100, 100 );
 
 				var bitmap = generateTextureBase();
 

+ 1 - 1
examples/webgl_materials_normalmap.html

@@ -116,7 +116,7 @@
 
 				// light representation
 
-				var sphere = new THREE.Sphere( 100, 16, 8 );
+				var sphere = new THREE.SphereGeometry( 100, 16, 8 );
 				lightMesh = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color:0xffaa00 } ) );
 				lightMesh.position = pointLight.position;
 				lightMesh.scale.x = lightMesh.scale.y = lightMesh.scale.z = 0.05;

+ 2 - 2
examples/webgl_materials_shaders.html

@@ -125,7 +125,7 @@
 				scene.addLight( pointLight );
 
 				// light representation
-				sphere = new THREE.Sphere( 100, 16, 8 );
+				sphere = new THREE.SphereGeometry( 100, 16, 8 );
 				lightMesh = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color: 0xffaa00 } ) );
 				lightMesh.scale.x = lightMesh.scale.y = lightMesh.scale.z = 0.05;
 				lightMesh.position = pointLight.position;
@@ -134,7 +134,7 @@
 				scene.addObject( lightMesh );
 
 				// material samples
-				sphere = new THREE.Sphere( 100, 32, 32 );
+				sphere = new THREE.SphereGeometry( 100, 32, 32 );
 
 				var y1 = 0, y2 = - 200;
 

+ 1 - 1
examples/webgl_materials_shaders_fresnel.html

@@ -79,7 +79,7 @@
 				scene = new THREE.Scene();
 				sceneCube = new THREE.Scene();
 
-				var geometry = new THREE.Sphere( 100, 32, 16 );
+				var geometry = new THREE.SphereGeometry( 100, 32, 16 );
 
 				var path = "textures/cube/Park2/";
 				var format = '.jpg';

+ 2 - 2
examples/webgl_materials_texture_filters.html

@@ -123,7 +123,7 @@
 
 				textureCanvas2.needsUpdate = true;
 
-				var i, j, uvs, geometryRepeat = new THREE.Plane( 100, 100, 1, 1 );
+				var i, j, uvs, geometryRepeat = new THREE.PlaneGeometry( 100, 100, 1, 1 );
 
 				for ( i = 0; i < geometryRepeat.faceVertexUvs[ 0 ].length; i ++ ) {
 
@@ -160,7 +160,7 @@
 					scene.addObject( meshCanvas );
 					scene2.addObject( meshCanvas2 );
 
-					var geometry = new THREE.Plane( 100, 100, 1, 1 ),
+					var geometry = new THREE.PlaneGeometry( 100, 100, 1, 1 ),
 						mesh = new THREE.Mesh( geometry, materialPainting ),
 						mesh2 = new THREE.Mesh( geometry, materialPainting2 );
 

+ 2 - 2
examples/webgl_materials_video.html

@@ -130,7 +130,7 @@
 					ox = i;
 					oy = j;
 
-					geometry = new THREE.Cube( xsize, ysize, xsize );
+					geometry = new THREE.CubeGeometry( xsize, ysize, xsize );
 					change_uvs( geometry, ux, uy, ox, oy );
 
 					materials[ cube_count ] = new THREE.MeshLambertMaterial( parameters );
@@ -242,7 +242,7 @@
 
 				} );
 
-				postprocessing.quad = new THREE.Mesh( new THREE.Plane( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
+				postprocessing.quad = new THREE.Mesh( new THREE.PlaneGeometry( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
 				postprocessing.quad.position.z = -500;
 				postprocessing.scene.addObject( postprocessing.quad );
 

+ 1 - 1
examples/webgl_morphtargets.html

@@ -109,7 +109,7 @@
 				scene.addLight( light );
 
 
-				var geometry = new THREE.Cube( 100, 100, 100 );
+				var geometry = new THREE.CubeGeometry( 100, 100, 100 );
 				var material = new THREE.MeshLambertMaterial( { color: 0xffffff, morphTargets: true } );
 
 				// construct 8 blend shapes

+ 4 - 4
examples/webgl_multiple_canvases_complex.html

@@ -132,7 +132,7 @@
 					scene.addLight( light );
 
 					var shadowMaterial = new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/shadow.png' ) } );
-					var shadowGeo = new THREE.Plane( 300, 300, 1, 1 );
+					var shadowGeo = new THREE.PlaneGeometry( 300, 300, 1, 1 );
 
 					mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 					mesh.position.y = - 250;
@@ -155,9 +155,9 @@
 
 					var color, f, f2, f3, p, n, vertexIndex,
 
-						geometry  = new THREE.Icosahedron( 1 ),
-						geometry2 = new THREE.Icosahedron( 1 ),
-						geometry3 = new THREE.Icosahedron( 1 );
+						geometry  = new THREE.IcosahedronGeometry( 1 ),
+						geometry2 = new THREE.IcosahedronGeometry( 1 ),
+						geometry3 = new THREE.IcosahedronGeometry( 1 );
 
 					for ( var i = 0; i < geometry.faces.length; i++ ) {
 

+ 4 - 4
examples/webgl_multiple_canvases_grid.html

@@ -148,7 +148,7 @@
 					scene.addLight( light );
 
 					var shadowMaterial = new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/shadow.png' ) } );
-					var shadowGeo = new THREE.Plane( 300, 300, 1, 1 );
+					var shadowGeo = new THREE.PlaneGeometry( 300, 300, 1, 1 );
 
 					mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 					mesh.position.y = - 250;
@@ -171,9 +171,9 @@
 
 					var color, f, f2, f3, p, n, vertexIndex,
 
-						geometry  = new THREE.Icosahedron( 1 ),
-						geometry2 = new THREE.Icosahedron( 1 ),
-						geometry3 = new THREE.Icosahedron( 1 );
+						geometry  = new THREE.IcosahedronGeometry( 1 ),
+						geometry2 = new THREE.IcosahedronGeometry( 1 ),
+						geometry3 = new THREE.IcosahedronGeometry( 1 );
 
 					for ( var i = 0; i < geometry.faces.length; i++ ) {
 

+ 4 - 10
examples/webgl_objconvert_test.html

@@ -32,12 +32,6 @@
 
 			<p>Models by <a href="http://sketchup.google.com/3dwarehouse/details?mid=2c6fd128fca34052adc5f5b98d513da1">Reallusion</a>
 			<a href="http://sketchup.google.com/3dwarehouse/details?mid=f526cc4abf7cb68d76cab47c765b7255">iClone</a>.
-
-			<p>Using a modified version of <a href="http://github.com/alteredq/three.js">Three.js</a> by mrdoob.
-
-			<br/>
-			<p>Best viewed in Chrome 9 or Firefox 4 using WebGL renderer.
-			<p>Canvas renderer is very slow on anything other than Chrome.
 		</div>
 
 		<pre id="log"></pre>
@@ -112,7 +106,7 @@
 				xm.map.needsUpdate = true;
 				xm.map.repeat.set( 10, 10 );
 
-				geometry = new THREE.Plane( 100, 100, 15, 10 );
+				geometry = new THREE.PlaneGeometry( 100, 100, 15, 10 );
 	
 				mesh = new THREE.Mesh( geometry, xm );
 				mesh.position.x = 0;
@@ -127,7 +121,7 @@
 				// SPHERES
 
 				var material_spheres = new THREE.MeshLambertMaterial( { color: 0xdddddd } ),
-					sphere = new THREE.Sphere( 100, 16, 8 );
+					sphere = new THREE.SphereGeometry( 100, 16, 8 );
 
 				for ( var i=0; i<10; i++ ) {
 					mesh = new THREE.Mesh( sphere, material_spheres );
@@ -216,7 +210,7 @@
 				for ( var i = 0; i < materials.length; i ++ ) {
 
 					// material
-					mesh = new THREE.Mesh( new THREE.Plane( size, size ), materials[i] );
+					mesh = new THREE.Mesh( new THREE.PlaneGeometry( size, size ), materials[i] );
 					mesh.position.x = i * (size + 5) - ( ( materials.length - 1 )* ( size + 5 )/2);
 					mesh.position.y = FLOOR + size/2 + bottom;
 					mesh.position.z = -100;
@@ -238,7 +232,7 @@
 					var xm = new THREE.MeshBasicMaterial( { map: new THREE.Texture( x ) } );
 					xm.map.needsUpdate = true;
 
-					mesh = new THREE.Mesh( new THREE.Plane( size, size ), xm );
+					mesh = new THREE.Mesh( new THREE.PlaneGeometry( size, size ), xm );
 					mesh.position.x = i * (size + 5) - ( ( materials.length - 1 )* ( size + 5 )/2);
 					mesh.position.y = FLOOR + size/2 + bottom;
 					mesh.position.z = -99;

+ 1 - 1
examples/webgl_panorama_equirectangular.html

@@ -59,7 +59,7 @@
 
 				scene = new THREE.Scene();
 
-				mesh = new THREE.Mesh( new THREE.Sphere( 500, 60, 40 ), new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/2294472375_24a3b8ef46_o.jpg' ) } ) );
+				mesh = new THREE.Mesh( new THREE.SphereGeometry( 500, 60, 40 ), new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/2294472375_24a3b8ef46_o.jpg' ) } ) );
 				mesh.scale.x = -1;
 				scene.addObject( mesh );
 

+ 3 - 3
examples/webgl_particles_dynamic.html

@@ -146,7 +146,7 @@
 				parent = new THREE.Object3D();
 				scene.addObject( parent );
 
-				var grid = new THREE.ParticleSystem( new THREE.Plane( 15000, 15000, 64, 64 ), new THREE.ParticleBasicMaterial( { color: 0xff0000, size: 10 } ) );
+				var grid = new THREE.ParticleSystem( new THREE.PlaneGeometry( 15000, 15000, 64, 64 ), new THREE.ParticleBasicMaterial( { color: 0xff0000, size: 10 } ) );
 				grid.rotation.x = 1.57;
 				grid.position.y = -400;
 				parent.addChild( grid );
@@ -335,7 +335,7 @@
 
 				} );
 				
-				effect.quad = new THREE.Mesh( new THREE.Plane( SCREEN_WIDTH, SCREEN_HEIGHT ), effect.materialHeat );
+				effect.quad = new THREE.Mesh( new THREE.PlaneGeometry( SCREEN_WIDTH, SCREEN_HEIGHT ), effect.materialHeat );
 				effect.quad.position.z = -500;
 				effect.scene.addObject( effect.quad );
 
@@ -402,7 +402,7 @@
 				effect.materialFilm.uniforms.sIntensity.value = 0.5;
 				effect.materialFilm.uniforms.sCount.value = 1448;
 
-				effect.quad = new THREE.Mesh( new THREE.Plane( SCREEN_WIDTH, SCREEN_HEIGHT ), effect.materialConvolution );
+				effect.quad = new THREE.Mesh( new THREE.PlaneGeometry( SCREEN_WIDTH, SCREEN_HEIGHT ), effect.materialConvolution );
 				effect.quad.position.z = -500;
 				effect.scene.addObject( effect.quad );
 

+ 1 - 1
examples/webgl_postprocessing.html

@@ -173,7 +173,7 @@
 
 				} );
 
-				var plane = new THREE.Plane( window.innerWidth, window.innerHeight );
+				var plane = new THREE.PlaneGeometry( window.innerWidth, window.innerHeight );
 
 				quadBG = new THREE.Mesh( plane, materialColor );
 				quadBG.position.z = -500;

+ 4 - 4
examples/webgl_postprocessing_dof.html

@@ -102,9 +102,9 @@
 
 				if( singleMaterial ) zmaterial = [ cubeMaterial ];
 
-				//var geo = new THREE.Cube( 1, 1, 1 );
-				//var geo = new THREE.Icosahedron( 2 );
-				var geo = new THREE.Sphere( 1, 20, 10 );
+				//var geo = new THREE.CubeGeometry( 1, 1, 1 );
+				//var geo = new THREE.IcosahedronGeometry( 2 );
+				var geo = new THREE.SphereGeometry( 1, 20, 10 );
 
 				var start = new Date().getTime();
 
@@ -259,7 +259,7 @@
 
 				} );
 
-				postprocessing.quad = new THREE.Mesh( new THREE.Plane( window.innerWidth, window.innerHeight ), postprocessing.materialBokeh );
+				postprocessing.quad = new THREE.Mesh( new THREE.PlaneGeometry( window.innerWidth, window.innerHeight ), postprocessing.materialBokeh );
 				postprocessing.quad.position.z = - 500;
 				postprocessing.scene.addObject( postprocessing.quad );
 

+ 1 - 1
examples/webgl_ribbons.html

@@ -270,7 +270,7 @@
 
 				} );
 
-				postprocessing.quad = new THREE.Mesh( new THREE.Plane( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
+				postprocessing.quad = new THREE.Mesh( new THREE.PlaneGeometry( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
 				postprocessing.quad.position.z = -500;
 				postprocessing.scene.addObject( postprocessing.quad );
 

+ 2 - 2
examples/webgl_rtt.html

@@ -150,7 +150,7 @@
 
 				// var mt = new THREE.MeshBasicMaterial( { color:0xffffff, map: ImageUtils.loadTexture( "textures/land_ocean_ice_cloud_2048.jpg" ) } );
 
-				var plane = new THREE.Plane( window.innerWidth, window.innerHeight );
+				var plane = new THREE.PlaneGeometry( window.innerWidth, window.innerHeight );
 
 				quad = new THREE.Mesh( plane, material );
 				quad.position.z = -100;
@@ -164,7 +164,7 @@
 				sceneScreen.addObject( quad );
 
 				var n = 5,
-					geometry = new THREE.Sphere( 10, 64, 32 ),
+					geometry = new THREE.SphereGeometry( 10, 64, 32 ),
 					material2 = new THREE.MeshLambertMaterial( { color:0xffffff, map: rtTexture } );
 					//material2 = new THREE.MeshBasicMaterial( { color:0xffffff, map: rtTexture } );
 

+ 18 - 11
examples/webgl_sandbox.html

@@ -102,30 +102,37 @@
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableObject.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableParticle.js"></script>
 		<script type="text/javascript" src="../src/renderers/renderables/RenderableLine.js"></script>
-		<script type="text/javascript" src="../src/extras/animation/AnimationHandler.js"></script>
-		<script type="text/javascript" src="../src/extras/animation/Animation.js"></script>
+		<script type="text/javascript" src="../src/extras/ColorUtils.js"></script>
 		<script type="text/javascript" src="../src/extras/GeometryUtils.js"></script>
 		<script type="text/javascript" src="../src/extras/ImageUtils.js"></script>
 		<script type="text/javascript" src="../src/extras/SceneUtils.js"></script>
 		<script type="text/javascript" src="../src/extras/ShaderUtils.js"></script>
+		<script type="text/javascript" src="../src/extras/animation/AnimationHandler.js"></script>
+		<script type="text/javascript" src="../src/extras/animation/Animation.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/QuakeCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/PathCamera.js"></script>
 		<script type="text/javascript" src="../src/extras/cameras/FlyCamera.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Cube.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Cylinder.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Icosahedron.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Lathe.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Plane.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Sphere.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/Torus.js"></script>
-		<script type="text/javascript" src="../src/extras/geometries/TorusKnot.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/RollCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/cameras/TrackballCamera.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/CubeGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/CylinderGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/IcosahedronGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/LatheGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/PlaneGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/SphereGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/TextGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/TorusGeometry.js"></script>
+		<script type="text/javascript" src="../src/extras/geometries/TorusKnotGeometry.js"></script>
 		<script type="text/javascript" src="../src/extras/io/Loader.js"></script>
 		<script type="text/javascript" src="../src/extras/io/JSONLoader.js"></script>
 		<script type="text/javascript" src="../src/extras/io/BinaryLoader.js"></script>
 		<script type="text/javascript" src="../src/extras/io/SceneLoader.js"></script>
 		<script type="text/javascript" src="../src/extras/objects/MarchingCubes.js"></script>
+		<script type="text/javascript" src="../src/extras/objects/Trident.js"></script>
 		<script type="text/javascript" src="../src/extras/physics/Collisions.js"></script>
 		<script type="text/javascript" src="../src/extras/physics/CollisionUtils.js"></script>
+		<script type="text/javascript" src="../src/extras/renderers/AnaglyphWebGLRenderer.js"></script>
+		<script type="text/javascript" src="../src/extras/renderers/CrosseyedWebGLRenderer.js"></script>
 
 		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
@@ -159,7 +166,7 @@
 				scene = new THREE.Scene();
 				scene.fog = new THREE.Fog( 0xffffff, 1, 10000 );
 
-				var geometry = new THREE.Sphere( 50, 32, 16 );
+				var geometry = new THREE.SphereGeometry( 50, 32, 16 );
 
 				var uniforms = THREE.ShaderUtils.lib[ 'basic' ].uniforms;
 				var vertexShader = THREE.ShaderUtils.lib[ 'basic' ].vertexShader;

+ 1 - 1
examples/webgl_scene_test.html

@@ -359,7 +359,7 @@
 				var object, geometry, material, light, count = 500, range = 200;
 
 				material = new THREE.MeshLambertMaterial( { color:0xffffff } );
-				geometry = new THREE.Cube( 5, 5, 5 );
+				geometry = new THREE.CubeGeometry( 5, 5, 5 );
 
 				for( var i = 0; i < count; i++ ) {
 

+ 1 - 1
examples/webgl_scene_test_blender.html

@@ -324,7 +324,7 @@
 				var object, geometry, material, light, count = 500, range = 200;
 
 				material = new THREE.MeshLambertMaterial( { color:0xffffff } );
-				geometry = new THREE.Cube( 5, 5, 5 );
+				geometry = new THREE.CubeGeometry( 5, 5, 5 );
 
 				for( var i = 0; i < count; i++ ) {
 

+ 1 - 1
examples/webgl_shader.html

@@ -125,7 +125,7 @@
 
 					} );
 
-				mesh = new THREE.Mesh( new THREE.Plane( 2, 2 ), material );
+				mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), material );
 				scene.addObject( mesh );
 
 				renderer = new THREE.WebGLRenderer();

+ 1 - 1
examples/webgl_shader2.html

@@ -228,7 +228,7 @@
 
 					mlib[ i ] = material;
 
-					mesh = new THREE.Mesh( new THREE.Cube( size, size, size, 1, 1, 1, [ mlib[ i ], mlib[ i ], mlib[ i ], mlib[ i ], mlib[ i ], mlib[ i ] ], false ), new THREE.MeshFaceMaterial() );
+					mesh = new THREE.Mesh( new THREE.CubeGeometry( size, size, size, 1, 1, 1, [ mlib[ i ], mlib[ i ], mlib[ i ], mlib[ i ], mlib[ i ], mlib[ i ] ], false ), new THREE.MeshFaceMaterial() );
 					mesh.position.x = i - ( params.length - 1 ) / 2;
 					mesh.position.y = i % 2 - 0.5;
 					scene.addObject( mesh );

+ 2 - 2
examples/webgl_shader_lava.html

@@ -163,7 +163,7 @@
 
 				} );
 
-				mesh = new THREE.Mesh( new THREE.Torus( size, 0.3, 30, 30 ), [ material /*, new THREE.MeshBasicMaterial( { color: 0x000000, wireframe: true, wireframeLinewidth: 2 } ) */ ] );
+				mesh = new THREE.Mesh( new THREE.TorusGeometry( size, 0.3, 30, 30 ), [ material /*, new THREE.MeshBasicMaterial( { color: 0x000000, wireframe: true, wireframeLinewidth: 2 } ) */ ] );
 				mesh.position.x = 0;
 				mesh.position.y = 0;
 				mesh.rotation.x = 0.3;
@@ -257,7 +257,7 @@
 				postprocessing.materialFilm.uniforms.sIntensity.value = 0.95;
 				postprocessing.materialFilm.uniforms.sCount.value = 2048;
 
-				postprocessing.quad = new THREE.Mesh( new THREE.Plane( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
+				postprocessing.quad = new THREE.Mesh( new THREE.PlaneGeometry( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
 				postprocessing.quad.position.z = - 500;
 				postprocessing.scene.addObject( postprocessing.quad );
 

+ 6 - 6
examples/webgl_stencil.html

@@ -51,7 +51,7 @@
 
 				// world
 
-				var cube = new THREE.Cube( 300, 300, 10 );
+				var cube = new THREE.CubeGeometry( 300, 300, 10 );
 				var material0 = new THREE.MeshPhongMaterial( { color:0xff00ff } );
 				var material1 = new THREE.MeshLambertMaterial( { color:0x00ff00 } );
 				var material2 = new THREE.MeshLambertMaterial( { color:0x0000ff } );
@@ -77,10 +77,10 @@
 
 				// moving objects
 
-				var cube = new THREE.Cube( 40, 40, 40 );
-				var torus = new THREE.Torus( 40, 10 );
-				var sphere = new THREE.Sphere( 40 );
-				var cylinder = new THREE.Cylinder( 10, 10, 20, 40, 0, 0 );
+				var cube = new THREE.CubeGeometry( 40, 40, 40 );
+				var torus = new THREE.TorusGeometry( 40, 10 );
+				var sphere = new THREE.SphereGeometry( 40 );
+				var cylinder = new THREE.CylinderGeometry( 10, 10, 20, 40, 0, 0 );
 				mesh = new THREE.Mesh( torus, material1 );
 				scene.addChild( mesh );
 
@@ -98,7 +98,7 @@
 				light.position.set( 0, 1, 0 );
 				scene.addChild( light );
 
-				var cube = new THREE.Sphere( 5 );
+				var cube = new THREE.SphereGeometry( 5 );
 				lightCube = new THREE.Mesh( cube, material2 );
 				scene.addChild( lightCube );
 

+ 6 - 6
examples/webgl_stencilLensFlare.html

@@ -50,7 +50,7 @@
 
 				// world
 
-				var cube = new THREE.Cube( 300, 300, 10 );
+				var cube = new THREE.CubeGeometry( 300, 300, 10 );
 				var material0 = new THREE.MeshPhongMaterial( { color:0xff00ff } );
 				var material1 = new THREE.MeshLambertMaterial( { color:0x00ff00 } );
 				var material2 = new THREE.MeshLambertMaterial( { color:0x0000ff } );
@@ -76,10 +76,10 @@
 
 				// moving objects
 
-				var cube = new THREE.Cube( 40, 40, 40 );
-				var torus = new THREE.Torus( 40, 10 );
-				var sphere = new THREE.Sphere( 40 );
-				var cylinder = new THREE.Cylinder( 10, 10, 20, 40, 0, 0 );
+				var cube = new THREE.CubeGeometry( 40, 40, 40 );
+				var torus = new THREE.TorusGeometry( 40, 10 );
+				var sphere = new THREE.SphereGeometry( 40 );
+				var cylinder = new THREE.CylinderGeometry( 10, 10, 20, 40, 0, 0 );
 				mesh = new THREE.Mesh( torus, material1 );
 				scene.addChild( mesh );
 
@@ -102,7 +102,7 @@
 				scene.addChild( light );
 
 
-				var cube = new THREE.Sphere( 2 );
+				var cube = new THREE.SphereGeometry( 2 );
 				lightCube = new THREE.Mesh( cube, material2 );
 				lightCube.visible = false;
 				scene.addChild( lightCube );

+ 0 - 651
examples/webgl_text.html

@@ -1,651 +0,0 @@
-<!DOCTYPE HTML>
-<html lang="en">
-	<head>
-		<title>three.js webgl - geometry - text</title>
-		<meta charset="utf-8">
-		<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
-		<style type="text/css">
-			body {
-				font-family: Monospace;
-				background-color: #000;
-				color: #fff;
-				margin: 0px;
-				overflow: hidden;
-			}
-			#info {
-				position: absolute;
-				top: 10px;
-				width: 100%;
-				text-align: center;
-				z-index: 100;
-				display:block;
-			}
-			#info a, .button { color: #f00; font-weight: bold; text-decoration: underline; cursor: pointer }
-		</style>
-	</head>
-	<body>
-
-		<div id="info">
-		<a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - procedural 3D text by <a href="http://www.lab4games.net/zz85/blog" target="_blank">zz85</a> &amp; alteredq 
-		(fonts from <a href="http://typeface.neocracy.org/">typeface.js</a> and <a href="http://en.wikipedia.org/wiki/Droid_%28font%29">Droid</a>)
-		<br/>type to enter new text, drag to spin the text
-		<br/><span class="button" id="color">change color</span>, 
-			<span class="button" id="font">change font</span>, 
-			<span class="button" id="weight">change weight</span>, 
-			<span class="button" id="postprocessing">change postprocessing</span>, 
-			<a id="permalink" href="#">permalink</a>
-		</div>
-
-
-		<script type="text/javascript" src="../build/Three.js"></script>
-
-		<script type="text/javascript" src="js/Detector.js"></script>
-		<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
-		<script type="text/javascript" src="js/Stats.js"></script>
-		      
-		<!-- load the font file from canvas-text -->
-
-		<!--
-		
-		
-		-->
-		<script type="text/javascript" src="fonts/gentilis_bold.typeface.js"></script>
-		<script type="text/javascript" src="fonts/gentilis_regular.typeface.js"></script>
-		<script type="text/javascript" src="fonts/optimer_bold.typeface.js"></script>
-		<script type="text/javascript" src="fonts/optimer_regular.typeface.js"></script>
-		<script type="text/javascript" src="fonts/helvetiker_bold.typeface.js"></script>
-		<script type="text/javascript" src="fonts/helvetiker_regular.typeface.js"></script>
-		<script type="text/javascript" src="fonts/droid/droid_sans_regular.typeface.js"></script>
-		<script type="text/javascript" src="fonts/droid/droid_sans_bold.typeface.js"></script>
-		<script type="text/javascript" src="fonts/droid/droid_serif_regular.typeface.js"></script>
-		<script type="text/javascript" src="fonts/droid/droid_serif_bold.typeface.js"></script>
-		
-
-		<script type="text/javascript">
-
-			if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
-
-			var container, stats, permalink, hex, color;
-
-			var camera, scene, renderer;
-
-			var textMesh1, textMesh2, textGeo, textMaterial, parent;
-
-			var firstLetter = true;
-			
-			var text = "three.js",
-				height = 20,
-				size = 80,
-				hover = 30,
-				curveSegments = 6,
-				font = "optimer", 		// helvetiker, optimer, gentilis, droid sans, droid serif
-				weight = "bold",		// normal bold
-				style = "normal";		// normal italic
-
-			var mirror = true;
-			
-			var fontMap = {
-			"helvetiker"  : 0,
-			"optimer"  	  : 1,
-			"gentilis" 	  : 2,
-			"droid sans"  : 3,
-			"droid serif" : 4
-			
-			};
-			
-			var weightMap = {
-			"normal"	: 0,
-			"bold"		: 1
-			}
-
-			var reverseFontMap = {};
-			var reverseWeightMap = {};
-			
-			for ( var i in fontMap ) reverseFontMap[ fontMap[i] ] = i;
-			for ( var i in weightMap ) reverseWeightMap[ weightMap[i] ] = i;
-			
-			var targetRotation = 0;
-			var targetRotationOnMouseDown = 0;
-
-			var mouseX = 0;
-			var mouseXOnMouseDown = 0;
-
-			var windowHalfX = window.innerWidth / 2;
-			var windowHalfY = window.innerHeight / 2;
-
-			var postprocessing = { enabled : true };
-			var glow = 0.9;
-
-			init();
-			animate();
-
-			function capitalize( txt ) {
-			
-				return txt.substring( 0, 1 ).toUpperCase() + txt.substring( 1 );
-
-			}
-			
-			function decimalToHex( d ) {
-  
-				var hex = Number( d ).toString( 16 );
-				hex = "000000".substr( 0, 6 - hex.length ) + hex; 
-				return hex.toUpperCase();
-
-			}
-			
-			function init() {
-
-				container = document.createElement( 'div' );
-				document.body.appendChild( container );
-
-				permalink = document.getElementById( "permalink" );
-				
-				camera = new THREE.Camera( 30, window.innerWidth / window.innerHeight, 1, 1500 );
-				camera.position.y = 400;
-				camera.position.z = 700;
-				camera.target.position.y = 100;
-
-				scene = new THREE.Scene();
-				
-				scene.fog = new THREE.Fog( 0x000000, 250, 1400 );
-
-				var dirLight = new THREE.DirectionalLight( 0xffffff, 0.125 );
-				dirLight.position.set( 0, 0, 1 );
-				dirLight.position.normalize();
-				scene.addLight( dirLight );
-
-				var pointLight = new THREE.PointLight( 0xffffff, 1.5 );
-				pointLight.position.set( 0, 100, 50 );
-				scene.addLight( pointLight );				
-
-				//text = capitalize( font ) + " " + capitalize( weight );
-				//text = "abcdefghijklmnopqrstuvwxyz0123456789";
-				//text = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
-
-				// Get text from hash
-
-				var hash = document.location.hash.substr( 1 );
-				
-				if ( hash.length !== 0 ) {
-                   
-					var colorhash  = hash.substring( 0, 6 );
-					var fonthash   = hash.substring( 6, 7 );
-					var weighthash = hash.substring( 7, 8 );
-					var pphash 	   = hash.substring( 8, 9 );
-					var texthash   = hash.substring( 10 );					
-
-					hex = colorhash;
-					pointLight.color.setHex( parseInt( colorhash, 16 ) );
-					
-					font = reverseFontMap[ parseInt( fonthash ) ];
-					weight = reverseWeightMap[ parseInt( weighthash ) ];
-					
-					postprocessing.enabled = parseInt( pphash );
-					
-					text = decodeURI( texthash );
-
-					updatePermalink();
-
-				} else {
-
-					pointLight.color.setHSV( Math.random(), 0.95, 0.85 );					
-					pointLight.color.updateHex();
-					hex = decimalToHex( pointLight.color.hex );
-
-				}
-				
-                textGeo = new THREE.Text( text, {
-
-					size: size, 
-					height: height,
-					curveSegments: curveSegments,
-					font: font,
-					weight: weight,
-					style: style
-
-				});
-				
-                textMaterial = new THREE.MeshPhongMaterial( { color: 0xffffff, wireframe: false } );
-				
-				parent = new THREE.Object3D();
-				
-				textMesh1 = new THREE.Mesh( textGeo, textMaterial );
-
-                textMesh1.position.x = 0;
-                textMesh1.position.y = hover;
-                textMesh1.position.z = 0;
-
-                textMesh1.rotation.x = 0;
-                textMesh1.rotation.y = Math.PI * 2;
-
-                parent.addChild( textMesh1 );
-
-				if ( mirror ) {
-
-					textMesh2 = new THREE.Mesh( textGeo, textMaterial );
-
-					textMesh2.position.x = 0;
-					textMesh2.position.y = -hover;
-					textMesh2.position.z = height;
-
-					textMesh2.rotation.x = Math.PI;
-					textMesh2.rotation.y = Math.PI * 2;
-
-					parent.addChild( textMesh2 );
-					
-				}
-
-				parent.position.y = 100;
-				scene.addChild( parent );
-
-				var plane = new THREE.Mesh( new THREE.Plane( 10000, 10000 ), new THREE.MeshBasicMaterial( { color: 0xffffff, opacity: 0.5, transparent: true } ) );
-				plane.rotation.x = -1.57;
-				plane.position.y = 100;
-				scene.addChild( plane );
-
-				renderer = new THREE.WebGLRenderer( { antialias: false } );
-                renderer.setSize( window.innerWidth, window.innerHeight );
-				
-				renderer.setClearColor( scene.fog.color, 1 );
-
-				container.appendChild( renderer.domElement );
-
-				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				//container.appendChild( stats.domElement );
-
-				document.addEventListener( 'mousedown', onDocumentMouseDown, false );
-				document.addEventListener( 'touchstart', onDocumentTouchStart, false );
-				document.addEventListener( 'touchmove', onDocumentTouchMove, false );
-				document.addEventListener( 'keypress', onDocumentKeyPress, false );
-				document.addEventListener( 'keydown', onDocumentKeyDown, false );
-
-				document.getElementById( "color" ).addEventListener( 'click', function() {
-				
-					pointLight.color.setHSV( Math.random(), 0.95, 0.85 );
-					pointLight.color.updateHex();
-					hex = decimalToHex( pointLight.color.hex );
-					
-					updatePermalink();					
-					
-				}, false );
-
-				document.getElementById( "font" ).addEventListener( 'click', function() {
-				
-					if ( font == "helvetiker" ) {
-
-						font = "optimer";
-
-					} else if ( font == "optimer" ) {
-						
-						font = "gentilis";
-						
-					} else if ( font == "gentilis" ) {
-						
-						font = "droid sans";
-						
-					} else if ( font == "droid sans" ) {
-						
-						font = "droid serif";
-
-					} else {
-					
-						font = "helvetiker";
-						
-					}
-					
-					refreshText();
-					
-				}, false );
-
-				document.getElementById( "weight" ).addEventListener( 'click', function() {
-				
-					if ( weight == "bold" ) {
-
-						weight = "normal";
-
-					} else {
-					
-						weight = "bold";
-						
-					}
-					
-					refreshText();
-					
-				}, false );
-
-				document.getElementById( "postprocessing" ).addEventListener( 'click', function() {
-				
-					postprocessing.enabled = !postprocessing.enabled;
-					updatePermalink();
-					
-				}, false );
-
-				initPostprocessing();
-				renderer.autoClear = false;
-
-			}
-			
-			//
-			
-			function boolToNum( b ) {
-				
-				return b ? 1 : 0;
-
-			}
-			
-			function updatePermalink() {
-			
-				var link = hex + fontMap[ font ] + weightMap[ weight ] + boolToNum( postprocessing.enabled ) + "#" + encodeURI( text );
-				
-				permalink.href = "#" + link;
-				window.location.hash = link;
-
-			}
-
-			function onDocumentKeyDown( event ) {
-
-				if ( firstLetter ) {
-				
-					firstLetter = false;
-					text = "";
-
-				}
-				
-				var keyCode = event.keyCode;
-				
-				// backspace
-
-				if ( keyCode == 8 ) {
-
-					event.preventDefault();
-
-					text = text.substring( 0, text.length - 1 );
-					refreshText();
-
-					return false;
-					
-				}
-
-			}
-			
-			function onDocumentKeyPress( event ) {
-				
-				var keyCode = event.which;
-				
-				// backspace
-
-				if ( keyCode == 8 ) {
-					
-					event.preventDefault();					
-					
-				} else {
-				
-					var ch = String.fromCharCode( keyCode );
-					text += ch;
-
-					refreshText();
-
-				}
-
-			}
-			
-			function refreshText() {
-
-				updatePermalink();
-				
-				scene.removeChild( textMesh1 );
-
-                textGeo = new THREE.Text( text, {
-
-					size: size, 
-					height: height,
-					curveSegments: curveSegments,
-					font: font,
-					weight: weight,
-					style: style
-
-				});
-
-				textMesh1 = new THREE.Mesh( textGeo, textMaterial );
-
-                textMesh1.position.x = 0;
-                textMesh1.position.y = hover;
-                textMesh1.position.z = 0;
-
-                textMesh1.rotation.x = 0;
-                textMesh1.rotation.y = Math.PI * 2;
-
-				parent.addChild( textMesh1 );
-
-				if ( mirror ) {
-
-					scene.removeChild( textMesh2 );
-
-					textMesh2 = new THREE.Mesh( textGeo, textMaterial );
-
-					textMesh2.position.x = 0;
-					textMesh2.position.y = -hover;
-					textMesh2.position.z = height;
-
-					textMesh2.rotation.x = Math.PI;
-					textMesh2.rotation.y = Math.PI * 2;
-					
-					
-					parent.addChild( textMesh2 );
-					
-				}
-
-			}
-			
-			function onDocumentMouseDown( event ) {
-
-				event.preventDefault();
-
-				document.addEventListener( 'mousemove', onDocumentMouseMove, false );
-				document.addEventListener( 'mouseup', onDocumentMouseUp, false );
-				document.addEventListener( 'mouseout', onDocumentMouseOut, false );
-
-				mouseXOnMouseDown = event.clientX - windowHalfX;
-				targetRotationOnMouseDown = targetRotation;
-
-			}
-
-			function onDocumentMouseMove( event ) {
-
-				mouseX = event.clientX - windowHalfX;
-
-				targetRotation = targetRotationOnMouseDown + ( mouseX - mouseXOnMouseDown ) * 0.02;
-
-			}
-
-			function onDocumentMouseUp( event ) {
-
-				document.removeEventListener( 'mousemove', onDocumentMouseMove, false );
-				document.removeEventListener( 'mouseup', onDocumentMouseUp, false );
-				document.removeEventListener( 'mouseout', onDocumentMouseOut, false );
-
-			}
-
-			function onDocumentMouseOut( event ) {
-
-				document.removeEventListener( 'mousemove', onDocumentMouseMove, false );
-				document.removeEventListener( 'mouseup', onDocumentMouseUp, false );
-				document.removeEventListener( 'mouseout', onDocumentMouseOut, false );
-
-			}
-
-			function onDocumentTouchStart( event ) {
-
-				if ( event.touches.length == 1 ) {
-
-					event.preventDefault();
-
-					mouseXOnMouseDown = event.touches[ 0 ].pageX - windowHalfX;
-					targetRotationOnMouseDown = targetRotation;
-
-				}
-
-			}
-
-			function onDocumentTouchMove( event ) {
-
-				if ( event.touches.length == 1 ) {
-
-					event.preventDefault();
-
-					mouseX = event.touches[ 0 ].pageX - windowHalfX;
-					targetRotation = targetRotationOnMouseDown + ( mouseX - mouseXOnMouseDown ) * 0.05;
-
-				}
-
-			}
-
-			//
-			
-			function initPostprocessing() {
-
-				postprocessing.scene = new THREE.Scene();
-
-				postprocessing.camera = new THREE.Camera();
-				postprocessing.camera.projectionMatrix = THREE.Matrix4.makeOrtho( window.innerWidth / - 2, window.innerWidth / 2,  window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
-				postprocessing.camera.position.z = 100;
-
-				var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
-				postprocessing.rtTexture1 = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, pars );
-				postprocessing.rtTexture2 = new THREE.WebGLRenderTarget( 512, 512, pars );
-				postprocessing.rtTexture3 = new THREE.WebGLRenderTarget( 512, 512, pars );
-
-				var screen_shader = THREE.ShaderUtils.lib["screen"];
-				var screen_uniforms = THREE.UniformsUtils.clone( screen_shader.uniforms );
-
-				screen_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
-				screen_uniforms["opacity"].value = 1.0;
-
-				postprocessing.materialScreen = new THREE.MeshShaderMaterial( {
-
-					uniforms: screen_uniforms,
-					vertexShader: screen_shader.vertexShader,
-					fragmentShader: screen_shader.fragmentShader,
-					blending: THREE.AdditiveBlending,
-					transparent: true
-
-				} );
-
-				var convolution_shader = THREE.ShaderUtils.lib["convolution"];
-				var convolution_uniforms = THREE.UniformsUtils.clone( convolution_shader.uniforms );
-
-				postprocessing.blurx = new THREE.Vector2( 0.001953125, 0.0 ),
-				postprocessing.blury = new THREE.Vector2( 0.0, 0.001953125 );
-
-				convolution_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
-				convolution_uniforms["uImageIncrement"].value = postprocessing.blurx;
-				convolution_uniforms["cKernel"].value = THREE.ShaderUtils.buildKernel( 4.0 );
-
-				postprocessing.materialConvolution = new THREE.MeshShaderMaterial( {
-
-					uniforms: convolution_uniforms,
-					vertexShader:   "#define KERNEL_SIZE 25.0\n" + convolution_shader.vertexShader,
-					fragmentShader: "#define KERNEL_SIZE 25\n"   + convolution_shader.fragmentShader
-
-				} );
-
-				var film_shader = THREE.ShaderUtils.lib["film"];
-				var film_uniforms = THREE.UniformsUtils.clone( film_shader.uniforms );
-
-				film_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
-
-				postprocessing.materialFilm = new THREE.MeshShaderMaterial( { uniforms: film_uniforms, vertexShader: film_shader.vertexShader, fragmentShader: film_shader.fragmentShader } );
-				postprocessing.materialFilm.uniforms.grayscale.value = 0;
-				postprocessing.materialFilm.uniforms.nIntensity.value = 0.15;
-				postprocessing.materialFilm.uniforms.sIntensity.value = 0.25;
-				postprocessing.materialFilm.uniforms.sCount.value = 2048;
-
-				//postprocessing.materialFilm.uniforms.nIntensity.value = 0;
-				//postprocessing.materialFilm.uniforms.sIntensity.value = 0;
-
-				postprocessing.materialScreen.uniforms.opacity.value = glow;
-
-				postprocessing.quad = new THREE.Mesh( new THREE.Plane( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
-				postprocessing.quad.position.z = - 500;
-				postprocessing.scene.addObject( postprocessing.quad );
-
-			}
-
-			//
-
-			function animate() {
-
-				requestAnimationFrame( animate );
-
-				render();
-				stats.update();
-
-			}
-
-			var delta, time, oldTime;
-
-			function render() {
-
-				if ( ! oldTime ) oldTime = new Date().getTime();
-
-				time = new Date().getTime();
-				delta = 0.1 * ( time - oldTime );
-				oldTime = time;
-				
-				parent.rotation.y += ( targetRotation - parent.rotation.y ) * 0.05;
-				
-				if ( postprocessing.enabled ) {
-
-					renderer.clear();
-
-					// Render scene into texture
-
-					renderer.render( scene, camera, postprocessing.rtTexture1, true );
-
-					// Render quad with blured scene into texture (convolution pass 1)
-
-					postprocessing.quad.materials[ 0 ] = postprocessing.materialConvolution;
-
-					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
-					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blurx;
-
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture2, true );
-
-					// Render quad with blured scene into texture (convolution pass 2)
-
-					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture2;
-					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blury;
-
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture3, true );
-
-					// Render original scene with superimposed blur to texture
-
-					postprocessing.quad.materials[ 0 ] = postprocessing.materialScreen;
-
-					postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture3;
-
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture1, false );
-
-					// Render to screen
-
-					postprocessing.materialFilm.uniforms.time.value += 0.01;
-					postprocessing.quad.materials[ 0 ] = postprocessing.materialFilm;
-
-					postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
-					renderer.render( postprocessing.scene, postprocessing.camera );
-
-				} else {
-
-					renderer.clear();
-					renderer.render( scene, camera );
-
-				}				
-
-			}
-
-		</script>
-
-	</body>
-</html>

+ 1 - 1
examples/webgl_trackballcamera_earth.html

@@ -170,7 +170,7 @@
 
 		// planet
 
-		geometry = new THREE.Sphere( radius, 100, 50 );
+		geometry = new THREE.SphereGeometry( radius, 100, 50 );
 		geometry.computeTangents();
 
 		meshPlanet = new THREE.Mesh( geometry, materialNormalMap );

+ 1 - 1
src/extras/SceneUtils.js

@@ -33,7 +33,7 @@ THREE.SceneUtils = {
 
 		} ),
 
-		mesh = new THREE.Mesh( new THREE.Cube( size, size, size, 1, 1, 1, null, true ), material );
+		mesh = new THREE.Mesh( new THREE.CubeGeometry( size, size, size, 1, 1, 1, null, true ), material );
 		scene.addObject( mesh );
 
 		return mesh;

+ 3 - 3
src/extras/cameras/PathCamera.js

@@ -281,7 +281,7 @@ THREE.PathCamera = function ( parameters ) {
 		parent.addChild( particleObj );
 
 		var waypoint,
-			geo = new THREE.Sphere( 1, 16, 8 ),
+			geo = new THREE.SphereGeometry( 1, 16, 8 ),
 			mat = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
 
 		for ( i = 0; i < spline.points.length; i++ ) {
@@ -310,8 +310,8 @@ THREE.PathCamera = function ( parameters ) {
 
 		var dummyParentMaterial = new THREE.MeshLambertMaterial( { color: 0x0077ff } ),
 		dummyChildMaterial  = new THREE.MeshLambertMaterial( { color: 0x00ff00 } ),
-		dummyParentGeo = new THREE.Cube( 10, 10, 20 ),
-		dummyChildGeo  = new THREE.Cube( 2, 2, 10 );
+		dummyParentGeo = new THREE.CubeGeometry( 10, 10, 20 ),
+		dummyChildGeo  = new THREE.CubeGeometry( 2, 2, 10 );
 
 		this.animationParent = new THREE.Mesh( dummyParentGeo, dummyParentMaterial );
 

+ 6 - 6
src/extras/io/SceneLoader.js

@@ -473,32 +473,32 @@ THREE.SceneLoader.prototype = {
 
 				if ( g.type == "cube" ) {
 
-					geometry = new THREE.Cube( g.width, g.height, g.depth, g.segmentsWidth, g.segmentsHeight, g.segmentsDepth, null, g.flipped, g.sides );
+					geometry = new THREE.CubeGeometry( g.width, g.height, g.depth, g.segmentsWidth, g.segmentsHeight, g.segmentsDepth, null, g.flipped, g.sides );
 					result.geometries[ dg ] = geometry;
 
 				} else if ( g.type == "plane" ) {
 
-					geometry = new THREE.Plane( g.width, g.height, g.segmentsWidth, g.segmentsHeight );
+					geometry = new THREE.PlaneGeometry( g.width, g.height, g.segmentsWidth, g.segmentsHeight );
 					result.geometries[ dg ] = geometry;
 
 				} else if ( g.type == "sphere" ) {
 
-					geometry = new THREE.Sphere( g.radius, g.segmentsWidth, g.segmentsHeight );
+					geometry = new THREE.SphereGeometry( g.radius, g.segmentsWidth, g.segmentsHeight );
 					result.geometries[ dg ] = geometry;
 
 				} else if ( g.type == "cylinder" ) {
 
-					geometry = new THREE.Cylinder( g.numSegs, g.topRad, g.botRad, g.height, g.topOffset, g.botOffset );
+					geometry = new THREE.CylinderGeometry( g.numSegs, g.topRad, g.botRad, g.height, g.topOffset, g.botOffset );
 					result.geometries[ dg ] = geometry;
 
 				} else if ( g.type == "torus" ) {
 
-					geometry = new THREE.Torus( g.radius, g.tube, g.segmentsR, g.segmentsT );
+					geometry = new THREE.TorusGeometry( g.radius, g.tube, g.segmentsR, g.segmentsT );
 					result.geometries[ dg ] = geometry;
 
 				} else if ( g.type == "icosahedron" ) {
 
-					geometry = new THREE.Icosahedron( g.subdivisions );
+					geometry = new THREE.IcosahedronGeometry( g.subdivisions );
 					result.geometries[ dg ] = geometry;
 
 				} else if ( g.type == "bin_mesh" ) {

+ 1 - 1
src/extras/objects/Trident.js

@@ -54,7 +54,7 @@ THREE.Trident = function ( params /** Object */) {
 
 	function getCone ( color ) {
 		//0.1 required to get a cone with a mapped bottom face
-		return new THREE.Mesh( new THREE.Cylinder( 30, 0.1, params.length / 20, params.length / 5 ), new THREE.MeshBasicMaterial( { color : color } ) );
+		return new THREE.Mesh( new THREE.CylinderGeometry( 30, 0.1, params.length / 20, params.length / 5 ), new THREE.MeshBasicMaterial( { color : color } ) );
 	}
 
 	function getSegment ( point, color ){

+ 1 - 1
src/extras/renderers/AnaglyphWebGLRenderer.js

@@ -62,7 +62,7 @@ if ( THREE.WebGLRenderer ) {
 		} );
 
 		var _scene = new THREE.Scene();
-		_scene.addObject( new THREE.Mesh( new THREE.Plane( 2, 2 ), _material ) );
+		_scene.addObject( new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), _material ) );
 
 		this.setSize = function ( width, height ) {