Browse Source

Reverted PlaneGeometry XY to XZ change.

Mr.doob 13 years ago
parent
commit
686c8eff10
51 changed files with 76 additions and 69 deletions
  1. 2 2
      build/Three.js
  2. 1 1
      build/custom/ThreeCanvas.js
  3. 1 1
      build/custom/ThreeExtras.js
  4. 1 0
      examples/canvas_ascii_effect.html
  5. 1 0
      examples/canvas_geometry_cube.html
  6. 1 0
      examples/canvas_geometry_earth.html
  7. 2 0
      examples/canvas_geometry_terrain.html
  8. 1 0
      examples/canvas_interactive_voxelpainter.html
  9. 2 2
      examples/canvas_materials_depth.html
  10. 1 2
      examples/canvas_materials_video.html
  11. 0 1
      examples/js/effects/AnaglyphEffect.js
  12. 0 1
      examples/js/effects/ParallaxBarrierEffect.js
  13. 0 1
      examples/js/postprocessing/EffectComposer.js
  14. 1 0
      examples/misc_software.html
  15. 2 3
      examples/misc_sound.html
  16. 0 1
      examples/misc_ubiquity_test.html
  17. 2 2
      examples/scenes/test_scene.js
  18. 2 0
      examples/webgl_animation_skinning.html
  19. 3 0
      examples/webgl_geometry_colors.html
  20. 1 0
      examples/webgl_geometry_dynamic.html
  21. 1 0
      examples/webgl_geometry_terrain.html
  22. 1 0
      examples/webgl_geometry_terrain_fog.html
  23. 1 0
      examples/webgl_geometry_text.html
  24. 0 1
      examples/webgl_hdr.html
  25. 0 1
      examples/webgl_interactive_draggablecubes.html
  26. 1 0
      examples/webgl_interactive_voxelpainter.html
  27. 1 0
      examples/webgl_lights_pointlights2.html
  28. 1 4
      examples/webgl_loader_json_objconverter.html
  29. 0 3
      examples/webgl_materials_blending.html
  30. 0 4
      examples/webgl_materials_blending_custom.html
  31. 3 2
      examples/webgl_materials_cubemap_dynamic.html
  32. 1 0
      examples/webgl_materials_grass.html
  33. 2 0
      examples/webgl_materials_texture_anisotropy.html
  34. 7 11
      examples/webgl_materials_texture_filters.html
  35. 1 0
      examples/webgl_morphtargets_md2.html
  36. 1 0
      examples/webgl_morphtargets_md2_control.html
  37. 2 1
      examples/webgl_multiple_canvases_circle.html
  38. 5 2
      examples/webgl_multiple_canvases_complex.html
  39. 5 2
      examples/webgl_multiple_canvases_grid.html
  40. 5 2
      examples/webgl_multiple_views.html
  41. 1 0
      examples/webgl_particles_dynamic.html
  42. 2 4
      examples/webgl_postprocessing.html
  43. 0 1
      examples/webgl_postprocessing_dof.html
  44. 0 1
      examples/webgl_postprocessing_godrays.html
  45. 0 2
      examples/webgl_rtt.html
  46. 0 1
      examples/webgl_shader.html
  47. 1 0
      examples/webgl_shading_physical.html
  48. 1 0
      examples/webgl_shadowmap.html
  49. 1 0
      examples/webgl_shadowmap_performance.html
  50. 1 3
      examples/webgl_terrain_dynamic.html
  51. 7 7
      src/extras/geometries/PlaneGeometry.js

+ 2 - 2
build/Three.js

@@ -245,7 +245,7 @@ Aa=new THREE.Vector3,k,Za,Gb,Wa,pb,cb,a=16;k=document.createElement("canvas");k.
 2);l.width=m;l.height=n;Sa.set(-p,-r,p,r);Ea.set(-p,-r,p,r);x=1;t=0;A=E=C=z=w=null};this.setClearColor=function(a,b){q.copy(a);s=b!==void 0?b:1;Ea.set(-p,-r,p,r)};this.setClearColorHex=function(a,b){q.setHex(a);s=b!==void 0?b:1;Ea.set(-p,-r,p,r)};this.clear=function(){o.setTransform(1,0,0,-1,p,r);if(Ea.isEmpty()===false){Ea.minSelf(Sa);Ea.inflate(2);s<1&&o.clearRect(Math.floor(Ea.getX()),Math.floor(Ea.getY()),Math.floor(Ea.getWidth()),Math.floor(Ea.getHeight()));if(s>0){c(THREE.NormalBlending);b(1);
 2);l.width=m;l.height=n;Sa.set(-p,-r,p,r);Ea.set(-p,-r,p,r);x=1;t=0;A=E=C=z=w=null};this.setClearColor=function(a,b){q.copy(a);s=b!==void 0?b:1;Ea.set(-p,-r,p,r)};this.setClearColorHex=function(a,b){q.setHex(a);s=b!==void 0?b:1;Ea.set(-p,-r,p,r)};this.clear=function(){o.setTransform(1,0,0,-1,p,r);if(Ea.isEmpty()===false){Ea.minSelf(Sa);Ea.inflate(2);s<1&&o.clearRect(Math.floor(Ea.getX()),Math.floor(Ea.getY()),Math.floor(Ea.getWidth()),Math.floor(Ea.getHeight()));if(s>0){c(THREE.NormalBlending);b(1);
 e("rgba("+Math.floor(q.r*255)+","+Math.floor(q.g*255)+","+Math.floor(q.b*255)+","+s+")");o.fillRect(Math.floor(Ea.getX()),Math.floor(Ea.getY()),Math.floor(Ea.getWidth()),Math.floor(Ea.getHeight()))}Ea.empty()}};this.render=function(a,l){function m(a){var b,c,d,e;ra.setRGB(0,0,0);Ga.setRGB(0,0,0);Ta.setRGB(0,0,0);b=0;for(c=a.length;b<c;b++){d=a[b];e=d.color;if(d instanceof THREE.AmbientLight){ra.r=ra.r+e.r;ra.g=ra.g+e.g;ra.b=ra.b+e.b}else if(d instanceof THREE.DirectionalLight){Ga.r=Ga.r+e.r;Ga.g=
 e("rgba("+Math.floor(q.r*255)+","+Math.floor(q.g*255)+","+Math.floor(q.b*255)+","+s+")");o.fillRect(Math.floor(Ea.getX()),Math.floor(Ea.getY()),Math.floor(Ea.getWidth()),Math.floor(Ea.getHeight()))}Ea.empty()}};this.render=function(a,l){function m(a){var b,c,d,e;ra.setRGB(0,0,0);Ga.setRGB(0,0,0);Ta.setRGB(0,0,0);b=0;for(c=a.length;b<c;b++){d=a[b];e=d.color;if(d instanceof THREE.AmbientLight){ra.r=ra.r+e.r;ra.g=ra.g+e.g;ra.b=ra.b+e.b}else if(d instanceof THREE.DirectionalLight){Ga.r=Ga.r+e.r;Ga.g=
 Ga.g+e.g;Ga.b=Ga.b+e.b}else if(d instanceof THREE.PointLight){Ta.r=Ta.r+e.r;Ta.g=Ta.g+e.g;Ta.b=Ta.b+e.b}}}function n(a,b,c,d){var e,f,g,h,k,i;e=0;for(f=a.length;e<f;e++){g=a[e];h=g.color;if(g instanceof THREE.DirectionalLight){k=g.matrixWorld.getPosition();i=c.dot(k);if(!(i<=0)){i=i*g.intensity;d.r=d.r+h.r*i;d.g=d.g+h.g*i;d.b=d.b+h.b*i}}else if(g instanceof THREE.PointLight){k=g.matrixWorld.getPosition();i=c.dot(Aa.sub(k,b).normalize());if(!(i<=0)){i=i*(g.distance==0?1:1-Math.min(b.distanceTo(k)/
 Ga.g+e.g;Ga.b=Ga.b+e.b}else if(d instanceof THREE.PointLight){Ta.r=Ta.r+e.r;Ta.g=Ta.g+e.g;Ta.b=Ta.b+e.b}}}function n(a,b,c,d){var e,f,g,h,k,i;e=0;for(f=a.length;e<f;e++){g=a[e];h=g.color;if(g instanceof THREE.DirectionalLight){k=g.matrixWorld.getPosition();i=c.dot(k);if(!(i<=0)){i=i*g.intensity;d.r=d.r+h.r*i;d.g=d.g+h.g*i;d.b=d.b+h.b*i}}else if(g instanceof THREE.PointLight){k=g.matrixWorld.getPosition();i=c.dot(Aa.sub(k,b).normalize());if(!(i<=0)){i=i*(g.distance==0?1:1-Math.min(b.distanceTo(k)/
-g.distance,1));if(i!=0){i=i*g.intensity;d.r=d.r+h.r*i;d.g=d.g+h.g*i;d.b=d.b+h.b*i}}}}}function q(a,f,g){b(g.opacity);c(g.blending);var h,k,i,j,l,m;if(g instanceof THREE.ParticleBasicMaterial){if(g.map===null){i=f.object.scale.x;j=f.object.scale.y;i=i*f.scale.x*p;j=j*f.scale.y*r;ta.set(a.x-i,a.y-j,a.x+i,a.y+j);if(Sa.intersects(ta)===false)return;e(g.color.getContextStyle());o.save();o.translate(a.x,a.y);o.rotate(-f.rotation);o.scale(i,j);o.fillRect(-1,-1,1,1)}else{g=g.map.image;l=g.width>>1;m=g.height>>
+g.distance,1));if(i!=0){i=i*g.intensity;d.r=d.r+h.r*i;d.g=d.g+h.g*i;d.b=d.b+h.b*i}}}}}function q(a,f,g){b(g.opacity);c(g.blending);var h,k,i,j,l,m;if(g instanceof THREE.ParticleBasicMaterial){if(g.map===null){i=f.object.scale.x;j=f.object.scale.y;i=i*f.scale.x*p;j=j*f.scale.y*r;ta.set(a.x-i,a.y-j,a.x+i,a.y+j);if(Sa.intersects(ta)===false)return;e(g.color.getContextStyle());o.save();o.translate(a.x,a.y);o.rotate(-f.rotation);o.scale(i,j);o.fillRect(-1,-1,2,2)}else{g=g.map.image;l=g.width>>1;m=g.height>>
 1;i=f.scale.x*p;j=f.scale.y*r;h=i*l;k=j*m;ta.set(a.x-h,a.y-k,a.x+h,a.y+k);if(Sa.intersects(ta)===false)return;o.save();o.translate(a.x,a.y);o.rotate(-f.rotation);o.scale(i,-j);o.translate(-l,-m);o.drawImage(g,0,0)}o.restore()}else if(g instanceof THREE.ParticleCanvasMaterial){h=f.scale.x*p;k=f.scale.y*r;ta.set(a.x-h,a.y-k,a.x+h,a.y+k);if(Sa.intersects(ta)!==false){d(g.color.getContextStyle());e(g.color.getContextStyle());o.save();o.translate(a.x,a.y);o.rotate(-f.rotation);o.scale(h,k);g.program(o);
 1;i=f.scale.x*p;j=f.scale.y*r;h=i*l;k=j*m;ta.set(a.x-h,a.y-k,a.x+h,a.y+k);if(Sa.intersects(ta)===false)return;o.save();o.translate(a.x,a.y);o.rotate(-f.rotation);o.scale(i,-j);o.translate(-l,-m);o.drawImage(g,0,0)}o.restore()}else if(g instanceof THREE.ParticleCanvasMaterial){h=f.scale.x*p;k=f.scale.y*r;ta.set(a.x-h,a.y-k,a.x+h,a.y+k);if(Sa.intersects(ta)!==false){d(g.color.getContextStyle());e(g.color.getContextStyle());o.save();o.translate(a.x,a.y);o.rotate(-f.rotation);o.scale(h,k);g.program(o);
 o.restore()}}}function s(a,e,f,g){b(g.opacity);c(g.blending);o.beginPath();o.moveTo(a.positionScreen.x,a.positionScreen.y);o.lineTo(e.positionScreen.x,e.positionScreen.y);o.closePath();if(g instanceof THREE.LineBasicMaterial){a=g.linewidth;if(C!==a)C=o.lineWidth=a;a=g.linecap;if(E!==a)E=o.lineCap=a;a=g.linejoin;if(A!==a)A=o.lineJoin=a;d(g.color.getContextStyle());o.stroke();ta.inflate(g.linewidth*2)}}function t(a,d,e,g,h,k,j,m){f.info.render.vertices=f.info.render.vertices+3;f.info.render.faces++;
 o.restore()}}}function s(a,e,f,g){b(g.opacity);c(g.blending);o.beginPath();o.moveTo(a.positionScreen.x,a.positionScreen.y);o.lineTo(e.positionScreen.x,e.positionScreen.y);o.closePath();if(g instanceof THREE.LineBasicMaterial){a=g.linewidth;if(C!==a)C=o.lineWidth=a;a=g.linecap;if(E!==a)E=o.lineCap=a;a=g.linejoin;if(A!==a)A=o.lineJoin=a;d(g.color.getContextStyle());o.stroke();ta.inflate(g.linewidth*2)}}function t(a,d,e,g,h,k,j,m){f.info.render.vertices=f.info.render.vertices+3;f.info.render.faces++;
 b(m.opacity);c(m.blending);B=a.positionScreen.x;G=a.positionScreen.y;Q=d.positionScreen.x;F=d.positionScreen.y;ba=e.positionScreen.x;X=e.positionScreen.y;x(B,G,Q,F,ba,X);if(m instanceof THREE.MeshBasicMaterial)if(m.map!==null){if(m.map.mapping instanceof THREE.UVMapping){bb=j.uvs[0];kd(B,G,Q,F,ba,X,bb[g].u,bb[g].v,bb[h].u,bb[h].v,bb[k].u,bb[k].v,m.map)}}else if(m.envMap!==null){if(m.envMap.mapping instanceof THREE.SphericalReflectionMapping){a=l.matrixWorldInverse;Aa.copy(j.vertexNormalsWorld[g]);
 b(m.opacity);c(m.blending);B=a.positionScreen.x;G=a.positionScreen.y;Q=d.positionScreen.x;F=d.positionScreen.y;ba=e.positionScreen.x;X=e.positionScreen.y;x(B,G,Q,F,ba,X);if(m instanceof THREE.MeshBasicMaterial)if(m.map!==null){if(m.map.mapping instanceof THREE.UVMapping){bb=j.uvs[0];kd(B,G,Q,F,ba,X,bb[g].u,bb[g].v,bb[h].u,bb[h].v,bb[k].u,bb[k].v,m.map)}}else if(m.envMap!==null){if(m.envMap.mapping instanceof THREE.SphericalReflectionMapping){a=l.matrixWorldInverse;Aa.copy(j.vertexNormalsWorld[g]);
@@ -664,7 +664,7 @@ a.vertices[g].y,g=a.vertices[g].z,m=a.vertices[h].x,n=a.vertices[h].y,a=a.vertic
 THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
 THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);for(var b=b||12,c=c||2*Math.PI,d=[],e=(new THREE.Matrix4).makeRotationZ(c/b),f=0;f<a.length;f++){d[f]=a[f].clone();this.vertices.push(d[f])}for(var g=b+1,c=0;c<g;c++)for(f=0;f<d.length;f++){d[f]=e.multiplyVector3(d[f].clone());this.vertices.push(d[f])}for(c=0;c<b;c++){d=0;for(e=a.length;d<e-1;d++){this.faces.push(new THREE.Face4(c*e+d,(c+1)%g*e+d,(c+1)%g*e+(d+1)%e,c*e+(d+1)%e));this.faceVertexUvs[0].push([new THREE.UV(1-c/b,d/e),new THREE.UV(1-
 THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);for(var b=b||12,c=c||2*Math.PI,d=[],e=(new THREE.Matrix4).makeRotationZ(c/b),f=0;f<a.length;f++){d[f]=a[f].clone();this.vertices.push(d[f])}for(var g=b+1,c=0;c<g;c++)for(f=0;f<d.length;f++){d[f]=e.multiplyVector3(d[f].clone());this.vertices.push(d[f])}for(c=0;c<b;c++){d=0;for(e=a.length;d<e-1;d++){this.faces.push(new THREE.Face4(c*e+d,(c+1)%g*e+d,(c+1)%g*e+(d+1)%e,c*e+(d+1)%e));this.faceVertexUvs[0].push([new THREE.UV(1-c/b,d/e),new THREE.UV(1-
 (c+1)/b,d/e),new THREE.UV(1-(c+1)/b,(d+1)/e),new THREE.UV(1-c/b,(d+1)/e)])}}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);
 (c+1)/b,d/e),new THREE.UV(1-(c+1)/b,(d+1)/e),new THREE.UV(1-c/b,(d+1)/e)])}}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);
-THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var e=a/2,f=b/2,c=c||1,d=d||1,g=c+1,h=d+1,i=a/c,j=b/d,l=new THREE.Vector3(0,1,0),a=0;a<h;a++)for(b=0;b<g;b++)this.vertices.push(new THREE.Vector3(b*i-e,0,a*j-f));for(a=0;a<d;a++)for(b=0;b<c;b++){e=new THREE.Face4(b+g*a,b+g*(a+1),b+1+g*(a+1),b+1+g*a);e.normal.copy(l);e.vertexNormals.push(l.clone(),l.clone(),l.clone(),l.clone());this.faces.push(e);this.faceVertexUvs[0].push([new THREE.UV(b/c,1-a/d),new THREE.UV(b/c,1-(a+1)/d),new THREE.UV((b+
+THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var e=a/2,f=b/2,c=c||1,d=d||1,g=c+1,h=d+1,i=a/c,j=b/d,l=new THREE.Vector3(0,0,1),a=0;a<h;a++)for(b=0;b<g;b++)this.vertices.push(new THREE.Vector3(b*i-e,-(a*j-f),0));for(a=0;a<d;a++)for(b=0;b<c;b++){e=new THREE.Face4(b+g*a,b+g*(a+1),b+1+g*(a+1),b+1+g*a);e.normal.copy(l);e.vertexNormals.push(l.clone(),l.clone(),l.clone(),l.clone());this.faces.push(e);this.faceVertexUvs[0].push([new THREE.UV(b/c,1-a/d),new THREE.UV(b/c,1-(a+1)/d),new THREE.UV((b+
 1)/c,1-(a+1)/d),new THREE.UV((b+1)/c,1-a/d)])}this.computeCentroids()};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);
 1)/c,1-(a+1)/d),new THREE.UV((b+1)/c,1-a/d)])}this.computeCentroids()};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);var a=a||50,d=d!==void 0?d:0,e=e!==void 0?e:Math.PI*2,f=f!==void 0?f:0,g=g!==void 0?g:Math.PI,b=Math.max(3,Math.floor(b)||8),c=Math.max(2,Math.floor(c)||6),h,i,j=[],l=[];for(i=0;i<=c;i++){var m=[],n=[];for(h=0;h<=b;h++){var p=h/b,r=i/c,o=new THREE.Vector3;o.x=-a*Math.cos(d+p*e)*Math.sin(f+r*g);o.y=a*Math.cos(f+r*g);o.z=a*Math.sin(d+p*e)*Math.sin(f+r*g);this.vertices.push(o);m.push(this.vertices.length-1);n.push(new THREE.UV(p,
 THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);var a=a||50,d=d!==void 0?d:0,e=e!==void 0?e:Math.PI*2,f=f!==void 0?f:0,g=g!==void 0?g:Math.PI,b=Math.max(3,Math.floor(b)||8),c=Math.max(2,Math.floor(c)||6),h,i,j=[],l=[];for(i=0;i<=c;i++){var m=[],n=[];for(h=0;h<=b;h++){var p=h/b,r=i/c,o=new THREE.Vector3;o.x=-a*Math.cos(d+p*e)*Math.sin(f+r*g);o.y=a*Math.cos(f+r*g);o.z=a*Math.sin(d+p*e)*Math.sin(f+r*g);this.vertices.push(o);m.push(this.vertices.length-1);n.push(new THREE.UV(p,
 1-r))}j.push(m);l.push(n)}for(i=0;i<c;i++)for(h=0;h<b;h++){var d=j[i][h+1],e=j[i][h],f=j[i+1][h],g=j[i+1][h+1],m=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),p=this.vertices[f].clone().normalize(),r=this.vertices[g].clone().normalize(),o=l[i][h+1].clone(),q=l[i][h].clone(),s=l[i+1][h].clone(),x=l[i+1][h+1].clone();if(Math.abs(this.vertices[d].y)==a){this.faces.push(new THREE.Face3(d,f,g,[m,p,r]));this.faceVertexUvs[0].push([o,s,x])}else if(Math.abs(this.vertices[f].y)==
 1-r))}j.push(m);l.push(n)}for(i=0;i<c;i++)for(h=0;h<b;h++){var d=j[i][h+1],e=j[i][h],f=j[i+1][h],g=j[i+1][h+1],m=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),p=this.vertices[f].clone().normalize(),r=this.vertices[g].clone().normalize(),o=l[i][h+1].clone(),q=l[i][h].clone(),s=l[i+1][h].clone(),x=l[i+1][h+1].clone();if(Math.abs(this.vertices[d].y)==a){this.faces.push(new THREE.Face3(d,f,g,[m,p,r]));this.faceVertexUvs[0].push([o,s,x])}else if(Math.abs(this.vertices[f].y)==

+ 1 - 1
build/custom/ThreeCanvas.js

@@ -218,7 +218,7 @@ new THREE.Vector3,ra,sa,ya,ba,ta,va,a=16;ra=document.createElement("canvas");ra.
 2);h.width=n;h.height=i;ga.set(-o,-q,o,q);aa.set(-o,-q,o,q);u=1;v=0;F=y=A=x=B=null};this.setClearColor=function(a,b){p.copy(a);r=b!==void 0?b:1;aa.set(-o,-q,o,q)};this.setClearColorHex=function(a,b){p.setHex(a);r=b!==void 0?b:1;aa.set(-o,-q,o,q)};this.clear=function(){l.setTransform(1,0,0,-1,o,q);if(aa.isEmpty()===false){aa.minSelf(ga);aa.inflate(2);r<1&&l.clearRect(Math.floor(aa.getX()),Math.floor(aa.getY()),Math.floor(aa.getWidth()),Math.floor(aa.getHeight()));if(r>0){c(THREE.NormalBlending);b(1);
 2);h.width=n;h.height=i;ga.set(-o,-q,o,q);aa.set(-o,-q,o,q);u=1;v=0;F=y=A=x=B=null};this.setClearColor=function(a,b){p.copy(a);r=b!==void 0?b:1;aa.set(-o,-q,o,q)};this.setClearColorHex=function(a,b){p.setHex(a);r=b!==void 0?b:1;aa.set(-o,-q,o,q)};this.clear=function(){l.setTransform(1,0,0,-1,o,q);if(aa.isEmpty()===false){aa.minSelf(ga);aa.inflate(2);r<1&&l.clearRect(Math.floor(aa.getX()),Math.floor(aa.getY()),Math.floor(aa.getWidth()),Math.floor(aa.getHeight()));if(r>0){c(THREE.NormalBlending);b(1);
 f("rgba("+Math.floor(p.r*255)+","+Math.floor(p.g*255)+","+Math.floor(p.b*255)+","+r+")");l.fillRect(Math.floor(aa.getX()),Math.floor(aa.getY()),Math.floor(aa.getWidth()),Math.floor(aa.getHeight()))}aa.empty()}};this.render=function(a,h){function i(a){var b,c,d,e;Z.setRGB(0,0,0);ma.setRGB(0,0,0);na.setRGB(0,0,0);b=0;for(c=a.length;b<c;b++){d=a[b];e=d.color;if(d instanceof THREE.AmbientLight){Z.r=Z.r+e.r;Z.g=Z.g+e.g;Z.b=Z.b+e.b}else if(d instanceof THREE.DirectionalLight){ma.r=ma.r+e.r;ma.g=ma.g+e.g;
 f("rgba("+Math.floor(p.r*255)+","+Math.floor(p.g*255)+","+Math.floor(p.b*255)+","+r+")");l.fillRect(Math.floor(aa.getX()),Math.floor(aa.getY()),Math.floor(aa.getWidth()),Math.floor(aa.getHeight()))}aa.empty()}};this.render=function(a,h){function i(a){var b,c,d,e;Z.setRGB(0,0,0);ma.setRGB(0,0,0);na.setRGB(0,0,0);b=0;for(c=a.length;b<c;b++){d=a[b];e=d.color;if(d instanceof THREE.AmbientLight){Z.r=Z.r+e.r;Z.g=Z.g+e.g;Z.b=Z.b+e.b}else if(d instanceof THREE.DirectionalLight){ma.r=ma.r+e.r;ma.g=ma.g+e.g;
 ma.b=ma.b+e.b}else if(d instanceof THREE.PointLight){na.r=na.r+e.r;na.g=na.g+e.g;na.b=na.b+e.b}}}function n(a,b,c,d){var e,f,g,h,j,k;e=0;for(f=a.length;e<f;e++){g=a[e];h=g.color;if(g instanceof THREE.DirectionalLight){j=g.matrixWorld.getPosition();k=c.dot(j);if(!(k<=0)){k=k*g.intensity;d.r=d.r+h.r*k;d.g=d.g+h.g*k;d.b=d.b+h.b*k}}else if(g instanceof THREE.PointLight){j=g.matrixWorld.getPosition();k=c.dot(V.sub(j,b).normalize());if(!(k<=0)){k=k*(g.distance==0?1:1-Math.min(b.distanceTo(j)/g.distance,
 ma.b=ma.b+e.b}else if(d instanceof THREE.PointLight){na.r=na.r+e.r;na.g=na.g+e.g;na.b=na.b+e.b}}}function n(a,b,c,d){var e,f,g,h,j,k;e=0;for(f=a.length;e<f;e++){g=a[e];h=g.color;if(g instanceof THREE.DirectionalLight){j=g.matrixWorld.getPosition();k=c.dot(j);if(!(k<=0)){k=k*g.intensity;d.r=d.r+h.r*k;d.g=d.g+h.g*k;d.b=d.b+h.b*k}}else if(g instanceof THREE.PointLight){j=g.matrixWorld.getPosition();k=c.dot(V.sub(j,b).normalize());if(!(k<=0)){k=k*(g.distance==0?1:1-Math.min(b.distanceTo(j)/g.distance,
-1));if(k!=0){k=k*g.intensity;d.r=d.r+h.r*k;d.g=d.g+h.g*k;d.b=d.b+h.b*k}}}}}function p(a,e,g){b(g.opacity);c(g.blending);var h,k,j,m,n,i;if(g instanceof THREE.ParticleBasicMaterial){if(g.map===null){j=e.object.scale.x;m=e.object.scale.y;j=j*e.scale.x*o;m=m*e.scale.y*q;X.set(a.x-j,a.y-m,a.x+j,a.y+m);if(ga.intersects(X)===false)return;f(g.color.getContextStyle());l.save();l.translate(a.x,a.y);l.rotate(-e.rotation);l.scale(j,m);l.fillRect(-1,-1,1,1)}else{g=g.map.image;n=g.width>>1;i=g.height>>1;j=e.scale.x*
+1));if(k!=0){k=k*g.intensity;d.r=d.r+h.r*k;d.g=d.g+h.g*k;d.b=d.b+h.b*k}}}}}function p(a,e,g){b(g.opacity);c(g.blending);var h,k,j,m,n,i;if(g instanceof THREE.ParticleBasicMaterial){if(g.map===null){j=e.object.scale.x;m=e.object.scale.y;j=j*e.scale.x*o;m=m*e.scale.y*q;X.set(a.x-j,a.y-m,a.x+j,a.y+m);if(ga.intersects(X)===false)return;f(g.color.getContextStyle());l.save();l.translate(a.x,a.y);l.rotate(-e.rotation);l.scale(j,m);l.fillRect(-1,-1,2,2)}else{g=g.map.image;n=g.width>>1;i=g.height>>1;j=e.scale.x*
 o;m=e.scale.y*q;h=j*n;k=m*i;X.set(a.x-h,a.y-k,a.x+h,a.y+k);if(ga.intersects(X)===false)return;l.save();l.translate(a.x,a.y);l.rotate(-e.rotation);l.scale(j,-m);l.translate(-n,-i);l.drawImage(g,0,0)}l.restore()}else if(g instanceof THREE.ParticleCanvasMaterial){h=e.scale.x*o;k=e.scale.y*q;X.set(a.x-h,a.y-k,a.x+h,a.y+k);if(ga.intersects(X)!==false){d(g.color.getContextStyle());f(g.color.getContextStyle());l.save();l.translate(a.x,a.y);l.rotate(-e.rotation);l.scale(h,k);g.program(l);l.restore()}}}function r(a,
 o;m=e.scale.y*q;h=j*n;k=m*i;X.set(a.x-h,a.y-k,a.x+h,a.y+k);if(ga.intersects(X)===false)return;l.save();l.translate(a.x,a.y);l.rotate(-e.rotation);l.scale(j,-m);l.translate(-n,-i);l.drawImage(g,0,0)}l.restore()}else if(g instanceof THREE.ParticleCanvasMaterial){h=e.scale.x*o;k=e.scale.y*q;X.set(a.x-h,a.y-k,a.x+h,a.y+k);if(ga.intersects(X)!==false){d(g.color.getContextStyle());f(g.color.getContextStyle());l.save();l.translate(a.x,a.y);l.rotate(-e.rotation);l.scale(h,k);g.program(l);l.restore()}}}function r(a,
 e,f,g){b(g.opacity);c(g.blending);l.beginPath();l.moveTo(a.positionScreen.x,a.positionScreen.y);l.lineTo(e.positionScreen.x,e.positionScreen.y);l.closePath();if(g instanceof THREE.LineBasicMaterial){a=g.linewidth;if(A!==a)A=l.lineWidth=a;a=g.linecap;if(y!==a)y=l.lineCap=a;a=g.linejoin;if(F!==a)F=l.lineJoin=a;d(g.color.getContextStyle());l.stroke();X.inflate(g.linewidth*2)}}function u(a,d,f,g,k,j,l,i){e.info.render.vertices=e.info.render.vertices+3;e.info.render.faces++;b(i.opacity);c(i.blending);
 e,f,g){b(g.opacity);c(g.blending);l.beginPath();l.moveTo(a.positionScreen.x,a.positionScreen.y);l.lineTo(e.positionScreen.x,e.positionScreen.y);l.closePath();if(g instanceof THREE.LineBasicMaterial){a=g.linewidth;if(A!==a)A=l.lineWidth=a;a=g.linecap;if(y!==a)y=l.lineCap=a;a=g.linejoin;if(F!==a)F=l.lineJoin=a;d(g.color.getContextStyle());l.stroke();X.inflate(g.linewidth*2)}}function u(a,d,f,g,k,j,l,i){e.info.render.vertices=e.info.render.vertices+3;e.info.render.faces++;b(i.opacity);c(i.blending);
 t=a.positionScreen.x;G=a.positionScreen.y;I=d.positionScreen.x;N=d.positionScreen.y;Q=f.positionScreen.x;S=f.positionScreen.y;x(t,G,I,N,Q,S);if(i instanceof THREE.MeshBasicMaterial)if(i.map!==null){if(i.map.mapping instanceof THREE.UVMapping){la=l.uvs[0];Fa(t,G,I,N,Q,S,la[g].u,la[g].v,la[k].u,la[k].v,la[j].u,la[j].v,i.map)}}else if(i.envMap!==null){if(i.envMap.mapping instanceof THREE.SphericalReflectionMapping){a=h.matrixWorldInverse;V.copy(l.vertexNormalsWorld[g]);za=(V.x*a.elements[0]+V.y*a.elements[4]+
 t=a.positionScreen.x;G=a.positionScreen.y;I=d.positionScreen.x;N=d.positionScreen.y;Q=f.positionScreen.x;S=f.positionScreen.y;x(t,G,I,N,Q,S);if(i instanceof THREE.MeshBasicMaterial)if(i.map!==null){if(i.map.mapping instanceof THREE.UVMapping){la=l.uvs[0];Fa(t,G,I,N,Q,S,la[g].u,la[g].v,la[k].u,la[k].v,la[j].u,la[j].v,i.map)}}else if(i.envMap!==null){if(i.envMap.mapping instanceof THREE.SphericalReflectionMapping){a=h.matrixWorldInverse;V.copy(l.vertexNormalsWorld[g]);za=(V.x*a.elements[0]+V.y*a.elements[4]+

+ 1 - 1
build/custom/ThreeExtras.js

@@ -207,7 +207,7 @@ b.vertices[g].y,g=b.vertices[g].z,m=b.vertices[h].x,n=b.vertices[h].y,b=b.vertic
 THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
 THREE.LatheGeometry=function(b,a,c){THREE.Geometry.call(this);for(var a=a||12,c=c||2*Math.PI,d=[],e=(new THREE.Matrix4).makeRotationZ(c/a),f=0;f<b.length;f++){d[f]=b[f].clone();this.vertices.push(d[f])}for(var g=a+1,c=0;c<g;c++)for(f=0;f<d.length;f++){d[f]=e.multiplyVector3(d[f].clone());this.vertices.push(d[f])}for(c=0;c<a;c++){d=0;for(e=b.length;d<e-1;d++){this.faces.push(new THREE.Face4(c*e+d,(c+1)%g*e+d,(c+1)%g*e+(d+1)%e,c*e+(d+1)%e));this.faceVertexUvs[0].push([new THREE.UV(1-c/a,d/e),new THREE.UV(1-
 THREE.LatheGeometry=function(b,a,c){THREE.Geometry.call(this);for(var a=a||12,c=c||2*Math.PI,d=[],e=(new THREE.Matrix4).makeRotationZ(c/a),f=0;f<b.length;f++){d[f]=b[f].clone();this.vertices.push(d[f])}for(var g=a+1,c=0;c<g;c++)for(f=0;f<d.length;f++){d[f]=e.multiplyVector3(d[f].clone());this.vertices.push(d[f])}for(c=0;c<a;c++){d=0;for(e=b.length;d<e-1;d++){this.faces.push(new THREE.Face4(c*e+d,(c+1)%g*e+d,(c+1)%g*e+(d+1)%e,c*e+(d+1)%e));this.faceVertexUvs[0].push([new THREE.UV(1-c/a,d/e),new THREE.UV(1-
 (c+1)/a,d/e),new THREE.UV(1-(c+1)/a,(d+1)/e),new THREE.UV(1-c/a,(d+1)/e)])}}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);
 (c+1)/a,d/e),new THREE.UV(1-(c+1)/a,(d+1)/e),new THREE.UV(1-c/a,(d+1)/e)])}}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);
-THREE.PlaneGeometry=function(b,a,c,d){THREE.Geometry.call(this);for(var e=b/2,f=a/2,c=c||1,d=d||1,g=c+1,h=d+1,i=b/c,j=a/d,l=new THREE.Vector3(0,1,0),b=0;b<h;b++)for(a=0;a<g;a++)this.vertices.push(new THREE.Vector3(a*i-e,0,b*j-f));for(b=0;b<d;b++)for(a=0;a<c;a++){e=new THREE.Face4(a+g*b,a+g*(b+1),a+1+g*(b+1),a+1+g*b);e.normal.copy(l);e.vertexNormals.push(l.clone(),l.clone(),l.clone(),l.clone());this.faces.push(e);this.faceVertexUvs[0].push([new THREE.UV(a/c,1-b/d),new THREE.UV(a/c,1-(b+1)/d),new THREE.UV((a+
+THREE.PlaneGeometry=function(b,a,c,d){THREE.Geometry.call(this);for(var e=b/2,f=a/2,c=c||1,d=d||1,g=c+1,h=d+1,i=b/c,j=a/d,l=new THREE.Vector3(0,0,1),b=0;b<h;b++)for(a=0;a<g;a++)this.vertices.push(new THREE.Vector3(a*i-e,-(b*j-f),0));for(b=0;b<d;b++)for(a=0;a<c;a++){e=new THREE.Face4(a+g*b,a+g*(b+1),a+1+g*(b+1),a+1+g*b);e.normal.copy(l);e.vertexNormals.push(l.clone(),l.clone(),l.clone(),l.clone());this.faces.push(e);this.faceVertexUvs[0].push([new THREE.UV(a/c,1-b/d),new THREE.UV(a/c,1-(b+1)/d),new THREE.UV((a+
 1)/c,1-(b+1)/d),new THREE.UV((a+1)/c,1-b/d)])}this.computeCentroids()};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);
 1)/c,1-(b+1)/d),new THREE.UV((a+1)/c,1-b/d)])}this.computeCentroids()};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.SphereGeometry=function(b,a,c,d,e,f,g){THREE.Geometry.call(this);var b=b||50,d=d!==void 0?d:0,e=e!==void 0?e:Math.PI*2,f=f!==void 0?f:0,g=g!==void 0?g:Math.PI,a=Math.max(3,Math.floor(a)||8),c=Math.max(2,Math.floor(c)||6),h,i,j=[],l=[];for(i=0;i<=c;i++){var m=[],n=[];for(h=0;h<=a;h++){var k=h/a,o=i/c,q=new THREE.Vector3;q.x=-b*Math.cos(d+k*e)*Math.sin(f+o*g);q.y=b*Math.cos(f+o*g);q.z=b*Math.sin(d+k*e)*Math.sin(f+o*g);this.vertices.push(q);m.push(this.vertices.length-1);n.push(new THREE.UV(k,
 THREE.SphereGeometry=function(b,a,c,d,e,f,g){THREE.Geometry.call(this);var b=b||50,d=d!==void 0?d:0,e=e!==void 0?e:Math.PI*2,f=f!==void 0?f:0,g=g!==void 0?g:Math.PI,a=Math.max(3,Math.floor(a)||8),c=Math.max(2,Math.floor(c)||6),h,i,j=[],l=[];for(i=0;i<=c;i++){var m=[],n=[];for(h=0;h<=a;h++){var k=h/a,o=i/c,q=new THREE.Vector3;q.x=-b*Math.cos(d+k*e)*Math.sin(f+o*g);q.y=b*Math.cos(f+o*g);q.z=b*Math.sin(d+k*e)*Math.sin(f+o*g);this.vertices.push(q);m.push(this.vertices.length-1);n.push(new THREE.UV(k,
 1-o))}j.push(m);l.push(n)}for(i=0;i<c;i++)for(h=0;h<a;h++){var d=j[i][h+1],e=j[i][h],f=j[i+1][h],g=j[i+1][h+1],m=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),k=this.vertices[f].clone().normalize(),o=this.vertices[g].clone().normalize(),q=l[i][h+1].clone(),p=l[i][h].clone(),s=l[i+1][h].clone(),u=l[i+1][h+1].clone();if(Math.abs(this.vertices[d].y)==b){this.faces.push(new THREE.Face3(d,f,g,[m,k,o]));this.faceVertexUvs[0].push([q,s,u])}else if(Math.abs(this.vertices[f].y)==
 1-o))}j.push(m);l.push(n)}for(i=0;i<c;i++)for(h=0;h<a;h++){var d=j[i][h+1],e=j[i][h],f=j[i+1][h],g=j[i+1][h+1],m=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),k=this.vertices[f].clone().normalize(),o=this.vertices[g].clone().normalize(),q=l[i][h+1].clone(),p=l[i][h].clone(),s=l[i+1][h].clone(),u=l[i+1][h+1].clone();if(Math.abs(this.vertices[d].y)==b){this.faces.push(new THREE.Face3(d,f,g,[m,k,o]));this.faceVertexUvs[0].push([q,s,u])}else if(Math.abs(this.vertices[f].y)==

+ 1 - 0
examples/canvas_ascii_effect.html

@@ -73,6 +73,7 @@
 
 
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 400, 400 ), new THREE.MeshBasicMaterial( { color: 0xe0e0e0 } ) );
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 400, 400 ), new THREE.MeshBasicMaterial( { color: 0xe0e0e0 } ) );
 				plane.position.y = - 200;
 				plane.position.y = - 200;
+				plane.rotation.x = - Math.PI / 2;
 				scene.add( plane );
 				scene.add( plane );
 
 
 				renderer = new THREE.CanvasRenderer();
 				renderer = new THREE.CanvasRenderer();

+ 1 - 0
examples/canvas_geometry_cube.html

@@ -76,6 +76,7 @@
 				// Plane
 				// Plane
 
 
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 200, 200 ), new THREE.MeshBasicMaterial( { color: 0xe0e0e0 } ) );
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 200, 200 ), new THREE.MeshBasicMaterial( { color: 0xe0e0e0 } ) );
+				plane.geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
 				scene.add( plane );
 				scene.add( plane );
 
 
 				renderer = new THREE.CanvasRenderer();
 				renderer = new THREE.CanvasRenderer();

+ 1 - 0
examples/canvas_geometry_earth.html

@@ -102,6 +102,7 @@
 
 
 				var mesh = new THREE.Mesh( geometry, material );
 				var mesh = new THREE.Mesh( geometry, material );
 				mesh.position.y = - 250;
 				mesh.position.y = - 250;
+				mesh.rotation.x = - Math.PI / 2;
 				group.add( mesh );
 				group.add( mesh );
 
 
 				renderer = new THREE.CanvasRenderer();
 				renderer = new THREE.CanvasRenderer();

+ 2 - 0
examples/canvas_geometry_terrain.html

@@ -70,7 +70,9 @@
 				var material = new THREE.MeshBasicMaterial( { map: new THREE.Texture( generateTexture( data, 1024, 1024 ) ), overdraw: true } );
 				var material = new THREE.MeshBasicMaterial( { map: new THREE.Texture( generateTexture( data, 1024, 1024 ) ), overdraw: true } );
 
 
 				var quality = 16, step = 1024 / quality;
 				var quality = 16, step = 1024 / quality;
+
 				var plane = new THREE.PlaneGeometry( 2000, 2000, quality - 1, quality - 1 );
 				var plane = new THREE.PlaneGeometry( 2000, 2000, quality - 1, quality - 1 );
+				plane.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
 
 
 				for ( var i = 0, l = plane.vertices.length; i < l; i ++ ) {
 				for ( var i = 0, l = plane.vertices.length; i < l; i ++ ) {
 
 

+ 1 - 0
examples/canvas_interactive_voxelpainter.html

@@ -76,6 +76,7 @@
 				projector = new THREE.Projector();
 				projector = new THREE.Projector();
 
 
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 1000, 1000 ), new THREE.MeshFaceMaterial() );
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 1000, 1000 ), new THREE.MeshFaceMaterial() );
+				plane.rotation.x = - Math.PI / 2;
 				scene.add( plane );
 				scene.add( plane );
 
 
 				mouse2D = new THREE.Vector3( 0, 10000, 0.5 );
 				mouse2D = new THREE.Vector3( 0, 10000, 0.5 );

+ 2 - 2
examples/canvas_materials_depth.html

@@ -66,9 +66,9 @@
 				var material = new THREE.MeshDepthMaterial( { overdraw: true } );
 				var material = new THREE.MeshDepthMaterial( { overdraw: true } );
 
 
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 1000, 1000, 10, 10 ), material );
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 1000, 1000, 10, 10 ), material );
-				plane.doubleSided = true;
 				plane.position.y = - 100;
 				plane.position.y = - 100;
-
+				plane.rotation.x = - Math.PI / 2;
+				plane.doubleSided = true;
 				scene.add( plane );
 				scene.add( plane );
 
 
 				// Cubes
 				// Cubes

+ 1 - 2
examples/canvas_materials_video.html

@@ -108,13 +108,12 @@
 				var plane = new THREE.PlaneGeometry( 480, 204, 4, 4 );
 				var plane = new THREE.PlaneGeometry( 480, 204, 4, 4 );
 
 
 				mesh = new THREE.Mesh( plane, material );
 				mesh = new THREE.Mesh( plane, material );
-				mesh.rotation.x = Math.PI / 2;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 1.5;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 1.5;
 				scene.add(mesh);
 				scene.add(mesh);
 
 
 				mesh = new THREE.Mesh( plane, materialReflection );
 				mesh = new THREE.Mesh( plane, materialReflection );
 				mesh.position.y = -306;
 				mesh.position.y = -306;
-				mesh.rotation.x = - Math.PI / 2;
+				mesh.rotation.x = - Math.PI;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 1.5;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 1.5;
 				mesh.doubleSided = true;
 				mesh.doubleSided = true;
 				scene.add( mesh );
 				scene.add( mesh );

+ 0 - 1
examples/js/effects/AnaglyphEffect.js

@@ -75,7 +75,6 @@ THREE.AnaglyphEffect = function ( renderer ) {
 	} );
 	} );
 
 
 	var mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), _material );
 	var mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), _material );
-	mesh.rotation.x = Math.PI / 2;
 	_scene.add( mesh );
 	_scene.add( mesh );
 
 
 	this.setSize = function ( width, height ) {
 	this.setSize = function ( width, height ) {

+ 0 - 1
examples/js/effects/ParallaxBarrierEffect.js

@@ -77,7 +77,6 @@ THREE.ParallaxBarrierEffect = function ( renderer ) {
 	} );
 	} );
 
 
 	var mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), _material );
 	var mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), _material );
-	mesh.rotation.x = Math.PI / 2;
 	_scene.add( mesh );
 	_scene.add( mesh );
 
 
 	this.setSize = function ( width, height ) {
 	this.setSize = function ( width, height ) {

+ 0 - 1
examples/js/postprocessing/EffectComposer.js

@@ -132,7 +132,6 @@ THREE.EffectComposer.camera = new THREE.OrthographicCamera( THREE.EffectComposer
 // shared fullscreen quad scene
 // shared fullscreen quad scene
 
 
 THREE.EffectComposer.geometry = new THREE.PlaneGeometry( 1, 1 );
 THREE.EffectComposer.geometry = new THREE.PlaneGeometry( 1, 1 );
-THREE.EffectComposer.geometry.applyMatrix( new THREE.Matrix4().makeRotationX( Math.PI / 2 ) );
 
 
 THREE.EffectComposer.quad = new THREE.Mesh( THREE.EffectComposer.geometry, null );
 THREE.EffectComposer.quad = new THREE.Mesh( THREE.EffectComposer.geometry, null );
 THREE.EffectComposer.quad.position.z = -100;
 THREE.EffectComposer.quad.position.z = -100;

+ 1 - 0
examples/misc_software.html

@@ -64,6 +64,7 @@
 
 
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 200, 200 ), new THREE.MeshBasicMaterial( { color: 0xe0e0e0 } ) );
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 200, 200 ), new THREE.MeshBasicMaterial( { color: 0xe0e0e0 } ) );
 				plane.position.y = - 150;
 				plane.position.y = - 150;
+				plane.rotation.x = - Math.PI / 2;
 				scene.add( plane );
 				scene.add( plane );
 
 
 				renderer = new THREE.SoftwareRenderer2();
 				renderer = new THREE.SoftwareRenderer2();

+ 2 - 3
examples/misc_sound.html

@@ -165,10 +165,9 @@
 				var material_wireframe = new THREE.MeshLambertMaterial( { color: 0xffaa00, wireframe: true, wireframeLinewidth: 1 } );
 				var material_wireframe = new THREE.MeshLambertMaterial( { color: 0xffaa00, wireframe: true, wireframeLinewidth: 1 } );
 				material_wireframe.color.setHSV( 0.1, 0.2, 0.5 );
 				material_wireframe.color.setHSV( 0.1, 0.2, 0.5 );
 
 
-
-				var plane = new THREE.PlaneGeometry( 1000, 1000, 100, 100 );
-				mesh = new THREE.Mesh( plane, material_wireframe );
+				mesh = new THREE.Mesh( new THREE.PlaneGeometry( 1000, 1000, 100, 100 ), material_wireframe );
 				mesh.position.y = 0.1;
 				mesh.position.y = 0.1;
+				mesh.rotation.x = - Math.PI / 2;
 				scene.add( mesh );
 				scene.add( mesh );
 
 
 				//
 				//

+ 0 - 1
examples/misc_ubiquity_test.html

@@ -83,7 +83,6 @@
 
 
 				mesh = new THREE.Mesh( new THREE.PlaneGeometry( 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.position.y = -500;
-				mesh.rotation.x = Math.PI / 2;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 2;
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = 2;
 				mesh.doubleSided = true;
 				mesh.doubleSided = true;
 				scene.add( mesh );
 				scene.add( mesh );

+ 2 - 2
examples/scenes/test_scene.js

@@ -123,7 +123,7 @@
 		"geometry" : "quad",
 		"geometry" : "quad",
 		"materials": [ "textured_bg" ],
 		"materials": [ "textured_bg" ],
 		"position" : [ 0, 15, -90 ],
 		"position" : [ 0, 15, -90 ],
-		"rotation" : [ 1.57, 0, 0 ],
+		"rotation" : [ 0, 0, 0 ],
 		"scale"	   : [ 20, 20, 20 ],
 		"scale"	   : [ 20, 20, 20 ],
 		"visible"  : true
 		"visible"  : true
 	},
 	},
@@ -132,7 +132,7 @@
 		"geometry" : "plane",
 		"geometry" : "plane",
 		"materials": [ "basic_gray" ],
 		"materials": [ "basic_gray" ],
 		"position" : [ 0, -10, 0 ],
 		"position" : [ 0, -10, 0 ],
-		"rotation" : [ 0, 0, 0 ],
+		"rotation" : [ -1.57, 0, 0 ],
 		"scale"	   : [ 100, 100, 100 ],
 		"scale"	   : [ 100, 100, 100 ],
 		"visible"  : true
 		"visible"  : true
 	}
 	}

+ 2 - 0
examples/webgl_animation_skinning.html

@@ -94,10 +94,12 @@
 
 
 				floor = new THREE.Mesh( planeSimple, matSolid );
 				floor = new THREE.Mesh( planeSimple, matSolid );
 				floor.position.y = -10;
 				floor.position.y = -10;
+				floor.rotation.x = - Math.PI / 2;
 				floor.scale.set( 25, 25, 25 );
 				floor.scale.set( 25, 25, 25 );
 				scene.add( floor );
 				scene.add( floor );
 
 
 				floor = new THREE.Mesh( planeTesselated, matWire );
 				floor = new THREE.Mesh( planeTesselated, matWire );
+				floor.rotation.x = - Math.PI / 2;
 				floor.scale.set( 25, 25, 25 );
 				floor.scale.set( 25, 25, 25 );
 				scene.add( floor );
 				scene.add( floor );
 
 

+ 3 - 0
examples/webgl_geometry_colors.html

@@ -76,16 +76,19 @@
 
 
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 				mesh.position.y = - 250;
 				mesh.position.y = - 250;
+				mesh.rotation.x = - Math.PI / 2;
 				scene.add( mesh );
 				scene.add( mesh );
 
 
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 				mesh.position.y = - 250;
 				mesh.position.y = - 250;
 				mesh.position.x = - 400;
 				mesh.position.x = - 400;
+				mesh.rotation.x = - Math.PI / 2;
 				scene.add( mesh );
 				scene.add( mesh );
 
 
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 				mesh.position.y = - 250;
 				mesh.position.y = - 250;
 				mesh.position.x = 400;
 				mesh.position.x = 400;
+				mesh.rotation.x = - Math.PI / 2;
 				scene.add( mesh );
 				scene.add( mesh );
 
 
 				var faceIndices = [ 'a', 'b', 'c', 'd' ];
 				var faceIndices = [ 'a', 'b', 'c', 'd' ];

+ 1 - 0
examples/webgl_geometry_dynamic.html

@@ -85,6 +85,7 @@
 				controls.lookSpeed = 0.1
 				controls.lookSpeed = 0.1
 
 
 				geometry = new THREE.PlaneGeometry( 20000, 20000, worldWidth - 1, worldDepth - 1 );
 				geometry = new THREE.PlaneGeometry( 20000, 20000, worldWidth - 1, worldDepth - 1 );
+				geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
 				geometry.dynamic = true;
 				geometry.dynamic = true;
 
 
 				var i, j, il, jl;
 				var i, j, il, jl;

+ 1 - 0
examples/webgl_geometry_terrain.html

@@ -81,6 +81,7 @@
 				camera.position.y = data[ worldHalfWidth + worldHalfDepth * worldWidth ] + 500;
 				camera.position.y = data[ worldHalfWidth + worldHalfDepth * worldWidth ] + 500;
 
 
 				var geometry = new THREE.PlaneGeometry( 7500, 7500, worldWidth - 1, worldDepth - 1 );
 				var geometry = new THREE.PlaneGeometry( 7500, 7500, worldWidth - 1, worldDepth - 1 );
+				geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
 
 
 				for ( var i = 0, l = geometry.vertices.length; i < l; i ++ ) {
 				for ( var i = 0, l = geometry.vertices.length; i < l; i ++ ) {
 
 

+ 1 - 0
examples/webgl_geometry_terrain_fog.html

@@ -84,6 +84,7 @@
 				camera.position.y = data[ worldHalfWidth + worldHalfDepth * worldWidth ] * 10 + 500;
 				camera.position.y = data[ worldHalfWidth + worldHalfDepth * worldWidth ] * 10 + 500;
 
 
 				var geometry = new THREE.PlaneGeometry( 7500, 7500, worldWidth - 1, worldDepth - 1 );
 				var geometry = new THREE.PlaneGeometry( 7500, 7500, worldWidth - 1, worldDepth - 1 );
+				geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
 
 
 				for ( var i = 0, l = geometry.vertices.length; i < l; i ++ ) {
 				for ( var i = 0, l = geometry.vertices.length; i < l; i ++ ) {
 
 

+ 1 - 0
examples/webgl_geometry_text.html

@@ -235,6 +235,7 @@
 
 
 				var plane = new THREE.Mesh( new THREE.PlaneGeometry( 10000, 10000 ), new THREE.MeshBasicMaterial( { color: 0xffffff, opacity: 0.5, transparent: true } ) );
 				var plane = new THREE.Mesh( new THREE.PlaneGeometry( 10000, 10000 ), new THREE.MeshBasicMaterial( { color: 0xffffff, opacity: 0.5, transparent: true } ) );
 				plane.position.y = 100;
 				plane.position.y = 100;
+				plane.rotation.x = - Math.PI / 2;
 				scene.add( plane );
 				scene.add( plane );
 
 
 				// RENDERER
 				// RENDERER

+ 0 - 1
examples/webgl_hdr.html

@@ -148,7 +148,6 @@
 
 
 				quad = new THREE.Mesh( plane, materialHDR );
 				quad = new THREE.Mesh( plane, materialHDR );
 				quad.position.z = -100;
 				quad.position.z = -100;
-				quad.rotation.x = Math.PI / 2;
 				scene.add( quad );
 				scene.add( quad );
 
 
 				renderer = new THREE.WebGLRenderer();
 				renderer = new THREE.WebGLRenderer();

+ 0 - 1
examples/webgl_interactive_draggablecubes.html

@@ -100,7 +100,6 @@
 				}
 				}
 
 
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 2000, 2000, 8, 8 ), new THREE.MeshBasicMaterial( { color: 0x000000, opacity: 0.25, transparent: true, wireframe: true } ) );
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 2000, 2000, 8, 8 ), new THREE.MeshBasicMaterial( { color: 0x000000, opacity: 0.25, transparent: true, wireframe: true } ) );
-				plane.geometry.applyMatrix( new THREE.Matrix4().makeRotationX( Math.PI / 2 ) );
 				plane.visible = false;
 				plane.visible = false;
 				scene.add( plane );
 				scene.add( plane );
 
 

+ 1 - 0
examples/webgl_interactive_voxelpainter.html

@@ -89,6 +89,7 @@
 				// grid
 				// grid
 
 
 				plane = new THREE.Mesh( new THREE.PlaneGeometry( 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 = - Math.PI / 2;
 				scene.add( plane );
 				scene.add( plane );
 
 
 				mouse2D = new THREE.Vector3( 0, 10000, 0.5 );
 				mouse2D = new THREE.Vector3( 0, 10000, 0.5 );

+ 1 - 0
examples/webgl_lights_pointlights2.html

@@ -132,6 +132,7 @@
 
 
 				var mesh = new THREE.Mesh( new THREE.PlaneGeometry( 800, 400, 2, 2 ), groundMaterial );
 				var mesh = new THREE.Mesh( new THREE.PlaneGeometry( 800, 400, 2, 2 ), groundMaterial );
 				mesh.position.y = -5;
 				mesh.position.y = -5;
+				mesh.rotation.x = - Math.PI / 2;
 				scene.add( mesh );
 				scene.add( mesh );
 
 
 				// OBJECTS
 				// OBJECTS

+ 1 - 4
examples/webgl_loader_json_objconverter.html

@@ -107,6 +107,7 @@
 
 
 				mesh = new THREE.Mesh( geometry, xm );
 				mesh = new THREE.Mesh( geometry, xm );
 				mesh.position.set( 0, FLOOR, 0 );
 				mesh.position.set( 0, FLOOR, 0 );
+				mesh.rotation.x = - Math.PI / 2;
 				mesh.scale.set( 10, 10, 10 );
 				mesh.scale.set( 10, 10, 10 );
 				scene.add( mesh );
 				scene.add( mesh );
 
 
@@ -231,8 +232,6 @@
 					mesh.position.x = i * (size + 5) - ( ( materials.length - 1 )* ( size + 5 )/2);
 					mesh.position.x = i * (size + 5) - ( ( materials.length - 1 )* ( size + 5 )/2);
 					mesh.position.y = FLOOR + size/2 + bottom;
 					mesh.position.y = FLOOR + size/2 + bottom;
 					mesh.position.z = -100;
 					mesh.position.z = -100;
-					mesh.rotation.x = Math.PI / 2;
-					mesh.doubleSided = true;
 					scene.add( mesh );
 					scene.add( mesh );
 
 
 					// number
 					// number
@@ -253,8 +252,6 @@
 					mesh.position.x = i * ( size + 5 ) - ( ( materials.length - 1 )* ( size + 5 )/2);
 					mesh.position.x = i * ( size + 5 ) - ( ( materials.length - 1 )* ( size + 5 )/2);
 					mesh.position.y = FLOOR + size/2 + bottom;
 					mesh.position.y = FLOOR + size/2 + bottom;
 					mesh.position.z = -99;
 					mesh.position.z = -99;
-					mesh.rotation.x = Math.PI / 2;
-					mesh.doubleSided = true;
 					scene.add( mesh );
 					scene.add( mesh );
 
 
 				}
 				}

+ 0 - 3
examples/webgl_materials_blending.html

@@ -69,7 +69,6 @@
 
 
 				var meshBg = new THREE.Mesh( new THREE.PlaneGeometry( 4000, 2000 ), materialBg );
 				var meshBg = new THREE.Mesh( new THREE.PlaneGeometry( 4000, 2000 ), materialBg );
 				meshBg.position.set( 0, 0, -1 );
 				meshBg.position.set( 0, 0, -1 );
-				meshBg.rotation.x = Math.PI / 2;
 				scene.add( meshBg );
 				scene.add( meshBg );
 
 
 				// OBJECTS
 				// OBJECTS
@@ -106,13 +105,11 @@
 
 
 						var mesh = new THREE.Mesh( geo1, material );
 						var mesh = new THREE.Mesh( geo1, material );
 						mesh.position.set( x, y, z );
 						mesh.position.set( x, y, z );
-						mesh.rotation.x = Math.PI / 2;
 						scene.add( mesh );
 						scene.add( mesh );
 
 
 
 
 						var mesh = new THREE.Mesh( geo2, generateLabelMaterial( blending.replace( "Blending", "" ) ) );
 						var mesh = new THREE.Mesh( geo2, generateLabelMaterial( blending.replace( "Blending", "" ) ) );
 						mesh.position.set( x, y - 75, z );
 						mesh.position.set( x, y - 75, z );
-						mesh.rotation.x = Math.PI / 2;
 						scene.add( mesh );
 						scene.add( mesh );
 
 
 					}
 					}

+ 0 - 4
examples/webgl_materials_blending_custom.html

@@ -178,7 +178,6 @@
 
 
 				var meshBg = new THREE.Mesh( new THREE.PlaneGeometry( 4000, 2000 ), materialBg );
 				var meshBg = new THREE.Mesh( new THREE.PlaneGeometry( 4000, 2000 ), materialBg );
 				meshBg.position.set( 0, 0, -1 );
 				meshBg.position.set( 0, 0, -1 );
-				meshBg.rotation.x = Math.PI / 2;
 				scene.add( meshBg );
 				scene.add( meshBg );
 
 
 				// FOREGROUND IMAGES
 				// FOREGROUND IMAGES
@@ -239,7 +238,6 @@
 
 
 						var mesh = new THREE.Mesh( geo1, material );
 						var mesh = new THREE.Mesh( geo1, material );
 						mesh.position.set( x, y, z );
 						mesh.position.set( x, y, z );
-						mesh.rotation.x = Math.PI / 2;
 						mesh.matrixAutoUpdate = false;
 						mesh.matrixAutoUpdate = false;
 						mesh.updateMatrix();
 						mesh.updateMatrix();
 						scene.add( mesh );
 						scene.add( mesh );
@@ -260,7 +258,6 @@
 
 
 					var mesh = new THREE.Mesh( geo2, generateLabelMaterial( blendSrc.replace( "Factor", "" ), "rgba( 0, 150, 0, 1 )" ) );
 					var mesh = new THREE.Mesh( geo2, generateLabelMaterial( blendSrc.replace( "Factor", "" ), "rgba( 0, 150, 0, 1 )" ) );
 					mesh.position.set( x, - (y - 70), z );
 					mesh.position.set( x, - (y - 70), z );
-					mesh.rotation.x = Math.PI / 2;
 					mesh.matrixAutoUpdate = false;
 					mesh.matrixAutoUpdate = false;
 					mesh.updateMatrix();
 					mesh.updateMatrix();
 					scene.add( mesh );
 					scene.add( mesh );
@@ -277,7 +274,6 @@
 
 
 					var mesh = new THREE.Mesh( geo2, generateLabelMaterial( blendDst.replace( "Factor", "" ), "rgba( 150, 0, 0, 1 )" ) );
 					var mesh = new THREE.Mesh( geo2, generateLabelMaterial( blendDst.replace( "Factor", "" ), "rgba( 150, 0, 0, 1 )" ) );
 					mesh.position.set( x, - (y - 70), z );
 					mesh.position.set( x, - (y - 70), z );
-					mesh.rotation.x = Math.PI / 2;
 					mesh.matrixAutoUpdate = false;
 					mesh.matrixAutoUpdate = false;
 					mesh.updateMatrix();
 					mesh.updateMatrix();
 					scene.add( mesh );
 					scene.add( mesh );

+ 3 - 2
examples/webgl_materials_cubemap_dynamic.html

@@ -519,6 +519,7 @@
 
 
 				ground = new THREE.Mesh( new THREE.PlaneGeometry( 50000, 50000 ), groundBasic );
 				ground = new THREE.Mesh( new THREE.PlaneGeometry( 50000, 50000 ), groundBasic );
 				ground.position.y = - 215;
 				ground.position.y = - 215;
+				ground.rotation.x = - Math.PI / 2;
 				scene.add( ground );
 				scene.add( ground );
 
 
 				ground.castShadow = false;
 				ground.castShadow = false;
@@ -567,7 +568,7 @@
 
 
 				var shadow = new THREE.Mesh( shadowPlane, shadowMaterial );
 				var shadow = new THREE.Mesh( shadowPlane, shadowMaterial );
 				shadow.position.y = sy;
 				shadow.position.y = sy;
-				shadow.rotation.y = Math.PI / 2;
+				shadow.rotation.x = - Math.PI / 2;
 
 
 				object.add( shadow );
 				object.add( shadow );
 
 
@@ -684,8 +685,8 @@
 				} );
 				} );
 
 
 				var shadow = new THREE.Mesh( shadowPlane, shadowMaterial );
 				var shadow = new THREE.Mesh( shadowPlane, shadowMaterial );
-				shadow.rotation.y = Math.PI / 2;
 				shadow.position.y = s + 10;
 				shadow.position.y = s + 10;
+				shadow.rotation.x = - Math.PI / 2;
 
 
 				object.root.add( shadow );
 				object.root.add( shadow );
 
 

+ 1 - 0
examples/webgl_materials_grass.html

@@ -50,6 +50,7 @@
 					mesh.material.map.needsUpdate = true;
 					mesh.material.map.needsUpdate = true;
 
 
 					mesh.position.y = i * 0.25;
 					mesh.position.y = i * 0.25;
+					mesh.rotation.x = - Math.PI / 2;
 
 
 					scene.add( mesh );
 					scene.add( mesh );
 
 

+ 2 - 0
examples/webgl_materials_texture_anisotropy.html

@@ -145,9 +145,11 @@
 				var geometry = new THREE.PlaneGeometry( 100, 100 );
 				var geometry = new THREE.PlaneGeometry( 100, 100 );
 
 
 				var mesh1 = new THREE.Mesh( geometry, material1 );
 				var mesh1 = new THREE.Mesh( geometry, material1 );
+				mesh1.rotation.x = - Math.PI / 2;
 				mesh1.scale.set( 1000, 1000, 1000 );
 				mesh1.scale.set( 1000, 1000, 1000 );
 
 
 				var mesh2 = new THREE.Mesh( geometry, material2 );
 				var mesh2 = new THREE.Mesh( geometry, material2 );
+				mesh2.rotation.x = - Math.PI / 2;
 				mesh2.scale.set( 1000, 1000, 1000 );
 				mesh2.scale.set( 1000, 1000, 1000 );
 
 
 				scene1.add( mesh1 );
 				scene1.add( mesh1 );

+ 7 - 11
examples/webgl_materials_texture_filters.html

@@ -130,11 +130,12 @@
 
 
 				var geometry = new THREE.PlaneGeometry( 100, 100 );
 				var geometry = new THREE.PlaneGeometry( 100, 100 );
 
 
-
 				var meshCanvas = new THREE.Mesh( geometry, materialCanvas );
 				var meshCanvas = new THREE.Mesh( geometry, materialCanvas );
+				meshCanvas.rotation.x = - Math.PI / 2;
 				meshCanvas.scale.set( 1000, 1000, 1000 );
 				meshCanvas.scale.set( 1000, 1000, 1000 );
 
 
 				var meshCanvas2 = new THREE.Mesh( geometry, materialCanvas2 );
 				var meshCanvas2 = new THREE.Mesh( geometry, materialCanvas2 );
+				meshCanvas2.rotation.x = - Math.PI / 2;
 				meshCanvas2.scale.set( 1000, 1000, 1000 );
 				meshCanvas2.scale.set( 1000, 1000, 1000 );
 
 
 
 
@@ -154,35 +155,30 @@
 					var mesh = new THREE.Mesh( geometry, materialPainting );
 					var mesh = new THREE.Mesh( geometry, materialPainting );
 					var mesh2 = new THREE.Mesh( geometry, materialPainting2 );
 					var mesh2 = new THREE.Mesh( geometry, materialPainting2 );
 
 
-					mesh.rotation.x = Math.PI / 2;
-					mesh2.rotation.x = Math.PI / 2;
-
 					addPainting( scene, mesh );
 					addPainting( scene, mesh );
 					addPainting( scene2, mesh2 );
 					addPainting( scene2, mesh2 );
 
 
 					function addPainting( zscene, zmesh ) {
 					function addPainting( zscene, zmesh ) {
 
 
 						zmesh.scale.x = image.width / 100;
 						zmesh.scale.x = image.width / 100;
-						zmesh.scale.z = image.height / 100;
+						zmesh.scale.y = image.height / 100;
 
 
 						zscene.add( zmesh );
 						zscene.add( zmesh );
 
 
 						var meshFrame = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { color: 0x000000, polygonOffset: true, polygonOffsetFactor: 1, polygonOffsetUnits: 5 } )  );
 						var meshFrame = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { color: 0x000000, polygonOffset: true, polygonOffsetFactor: 1, polygonOffsetUnits: 5 } )  );
-						meshFrame.rotation.x = Math.PI / 2;
 						meshFrame.scale.x = 1.1 * image.width / 100;
 						meshFrame.scale.x = 1.1 * image.width / 100;
-						meshFrame.scale.z = 1.1 * image.height / 100;
+						meshFrame.scale.y = 1.1 * image.height / 100;
 
 
 						zscene.add( meshFrame );
 						zscene.add( meshFrame );
 
 
 						var meshShadow = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { color: 0x000000, opacity: 0.75, transparent: true } )  );
 						var meshShadow = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { color: 0x000000, opacity: 0.75, transparent: true } )  );
-
+						meshShadow.position.y = - 1.1 * image.height/2;
 						meshShadow.position.z = - 1.1 * image.height/2;
 						meshShadow.position.z = - 1.1 * image.height/2;
+						meshShadow.rotation.x = - Math.PI / 2;
 						meshShadow.scale.x = 1.1 * image.width / 100;
 						meshShadow.scale.x = 1.1 * image.width / 100;
-						meshShadow.scale.z = 1.1 * image.height / 100;
+						meshShadow.scale.y = 1.1 * image.height / 100;
 						zscene.add( meshShadow );
 						zscene.add( meshShadow );
 
 
-						meshShadow.position.y = - 1.1 * image.height/2;
-
 						var floorHeight = - 1.117 * image.height/2;
 						var floorHeight = - 1.117 * image.height/2;
 						meshCanvas.position.y = meshCanvas2.position.y = floorHeight;
 						meshCanvas.position.y = meshCanvas2.position.y = floorHeight;
 
 

+ 1 - 0
examples/webgl_morphtargets_md2.html

@@ -119,6 +119,7 @@
 				var gm = new THREE.MeshPhongMaterial( { color: 0xffffff, map: gt, perPixel: true } );
 				var gm = new THREE.MeshPhongMaterial( { color: 0xffffff, map: gt, perPixel: true } );
 
 
 				var ground = new THREE.Mesh( gg, gm );
 				var ground = new THREE.Mesh( gg, gm );
+				ground.rotation.x = - Math.PI / 2;
 				ground.material.map.repeat.set( 8, 8 );
 				ground.material.map.repeat.set( 8, 8 );
 				ground.material.map.wrapS = ground.material.map.wrapT = THREE.RepeatWrapping;
 				ground.material.map.wrapS = ground.material.map.wrapT = THREE.RepeatWrapping;
 				ground.receiveShadow = true;
 				ground.receiveShadow = true;

+ 1 - 0
examples/webgl_morphtargets_md2_control.html

@@ -120,6 +120,7 @@
 				var gm = new THREE.MeshPhongMaterial( { color: 0xffffff, map: gt, perPixel: true } );
 				var gm = new THREE.MeshPhongMaterial( { color: 0xffffff, map: gt, perPixel: true } );
 
 
 				var ground = new THREE.Mesh( gg, gm );
 				var ground = new THREE.Mesh( gg, gm );
+				ground.rotation.x = - Math.PI / 2;
 				ground.material.map.repeat.set( 64, 64 );
 				ground.material.map.repeat.set( 64, 64 );
 				ground.material.map.wrapS = ground.material.map.wrapT = THREE.RepeatWrapping;
 				ground.material.map.wrapS = ground.material.map.wrapT = THREE.RepeatWrapping;
 				ground.receiveShadow = true;
 				ground.receiveShadow = true;

+ 2 - 1
examples/webgl_multiple_canvases_circle.html

@@ -228,8 +228,9 @@
 					for ( var i = 0; i < noof_balls; i ++ ) { // create shadows
 					for ( var i = 0; i < noof_balls; i ++ ) { // create shadows
 
 
 						var mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 						var mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
-						mesh.position.y = - 250;
 						mesh.position.x = - ( noof_balls - 1 ) / 2 *400 + i * 400;
 						mesh.position.x = - ( noof_balls - 1 ) / 2 *400 + i * 400;
+						mesh.position.y = - 250;
+						mesh.rotation.x = - Math.PI / 2;
 						scene.add( mesh );
 						scene.add( mesh );
 
 
 					}
 					}

+ 5 - 2
examples/webgl_multiple_canvases_complex.html

@@ -136,16 +136,19 @@
 
 
 					mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 					mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 					mesh.position.y = - 250;
 					mesh.position.y = - 250;
+					mesh.rotation.x = - Math.PI / 2;
 					scene.add( mesh );
 					scene.add( mesh );
 
 
 					mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 					mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
-					mesh.position.y = - 250;
 					mesh.position.x = - 400;
 					mesh.position.x = - 400;
+					mesh.position.y = - 250;
+					mesh.rotation.x = - Math.PI / 2;
 					scene.add( mesh );
 					scene.add( mesh );
 
 
 					mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 					mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
-					mesh.position.y = - 250;
 					mesh.position.x = 400;
 					mesh.position.x = 400;
+					mesh.position.y = - 250;
+					mesh.rotation.x = - Math.PI / 2;
 					scene.add( mesh );
 					scene.add( mesh );
 
 
 					var faceIndices = [ 'a', 'b', 'c', 'd' ];
 					var faceIndices = [ 'a', 'b', 'c', 'd' ];

+ 5 - 2
examples/webgl_multiple_canvases_grid.html

@@ -152,16 +152,19 @@
 
 
 					mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 					mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 					mesh.position.y = - 250;
 					mesh.position.y = - 250;
+					mesh.rotation.x = - Math.PI / 2;
 					scene.add( mesh );
 					scene.add( mesh );
 
 
 					mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 					mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
-					mesh.position.y = - 250;
 					mesh.position.x = - 400;
 					mesh.position.x = - 400;
+					mesh.position.y = - 250;
+					mesh.rotation.x = - Math.PI / 2;
 					scene.add( mesh );
 					scene.add( mesh );
 
 
 					mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 					mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
-					mesh.position.y = - 250;
 					mesh.position.x = 400;
 					mesh.position.x = 400;
+					mesh.position.y = - 250;
+					mesh.rotation.x = - Math.PI / 2;
 					scene.add( mesh );
 					scene.add( mesh );
 
 
 					var faceIndices = [ 'a', 'b', 'c', 'd' ];
 					var faceIndices = [ 'a', 'b', 'c', 'd' ];

+ 5 - 2
examples/webgl_multiple_views.html

@@ -133,16 +133,19 @@
 
 
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 				mesh.position.y = - 250;
 				mesh.position.y = - 250;
+				mesh.rotation.x = - Math. PI / 2;
 				scene.add( mesh );
 				scene.add( mesh );
 
 
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
-				mesh.position.y = - 250;
 				mesh.position.x = - 400;
 				mesh.position.x = - 400;
+				mesh.position.y = - 250;
+				mesh.rotation.x = - Math. PI / 2;
 				scene.add( mesh );
 				scene.add( mesh );
 
 
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
 				mesh = new THREE.Mesh( shadowGeo, shadowMaterial );
-				mesh.position.y = - 250;
 				mesh.position.x = 400;
 				mesh.position.x = 400;
+				mesh.position.y = - 250;
+				mesh.rotation.x = - Math. PI / 2;
 				scene.add( mesh );
 				scene.add( mesh );
 
 
 				var faceIndices = [ 'a', 'b', 'c', 'd' ];
 				var faceIndices = [ 'a', 'b', 'c', 'd' ];

+ 1 - 0
examples/webgl_particles_dynamic.html

@@ -149,6 +149,7 @@
 
 
 				var grid = new THREE.ParticleSystem( new THREE.PlaneGeometry( 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.position.y = -400;
 				grid.position.y = -400;
+				grid.rotation.x = - Math.PI / 2;
 				parent.add( grid );
 				parent.add( grid );
 
 
 				totaln += 1;
 				totaln += 1;

+ 2 - 4
examples/webgl_postprocessing.html

@@ -118,8 +118,7 @@
 
 
 				quadBG = new THREE.Mesh( new THREE.PlaneGeometry( 1, 1 ), materialColor );
 				quadBG = new THREE.Mesh( new THREE.PlaneGeometry( 1, 1 ), materialColor );
 				quadBG.position.z = -500;
 				quadBG.position.z = -500;
-				quadBG.rotation.x = Math.PI / 2;
-				quadBG.scale.set( width, 1, height );
+				quadBG.scale.set( width, height, 1 );
 				sceneBG.add( quadBG );
 				sceneBG.add( quadBG );
 
 
 				//
 				//
@@ -128,8 +127,7 @@
 
 
 				quadMask = new THREE.Mesh( new THREE.PlaneGeometry( 1, 1 ), new THREE.MeshBasicMaterial( { color: 0xffaa00 } )  );
 				quadMask = new THREE.Mesh( new THREE.PlaneGeometry( 1, 1 ), new THREE.MeshBasicMaterial( { color: 0xffaa00 } )  );
 				quadMask.position.z = -300;
 				quadMask.position.z = -300;
-				quadMask.rotation.x = Math.PI / 2;
-				quadMask.scale.set( width / 2, 1, height / 2 );
+				quadMask.scale.set( width / 2, height / 2, 1 );
 				sceneMask.add( quadMask );
 				sceneMask.add( quadMask );
 
 
 				//
 				//

+ 0 - 1
examples/webgl_postprocessing_dof.html

@@ -263,7 +263,6 @@
 
 
 				postprocessing.quad = new THREE.Mesh( new THREE.PlaneGeometry( 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.quad.position.z = - 500;
-				postprocessing.quad.rotation.x = Math.PI / 2;
 				postprocessing.scene.add( postprocessing.quad );
 				postprocessing.scene.add( postprocessing.quad );
 
 
 			}
 			}

+ 0 - 1
examples/webgl_postprocessing_godrays.html

@@ -268,7 +268,6 @@
 
 
 				postprocessing.quad = new THREE.Mesh( new THREE.PlaneGeometry( window.innerWidth, height ), postprocessing.materialGodraysGenerate );
 				postprocessing.quad = new THREE.Mesh( new THREE.PlaneGeometry( window.innerWidth, height ), postprocessing.materialGodraysGenerate );
 				postprocessing.quad.position.z = -9900;
 				postprocessing.quad.position.z = -9900;
-				postprocessing.quad.rotation.x = Math.PI / 2;
 				postprocessing.scene.add( postprocessing.quad );
 				postprocessing.scene.add( postprocessing.quad );
 
 
 			}
 			}

+ 0 - 2
examples/webgl_rtt.html

@@ -156,7 +156,6 @@
 
 
 				quad = new THREE.Mesh( plane, material );
 				quad = new THREE.Mesh( plane, material );
 				quad.position.z = -100;
 				quad.position.z = -100;
-				quad.rotation.x = Math.PI / 2;
 				sceneRTT.add( quad );
 				sceneRTT.add( quad );
 
 
 				var geometry = new THREE.TorusGeometry( 100, 25, 15, 30 );
 				var geometry = new THREE.TorusGeometry( 100, 25, 15, 30 );
@@ -176,7 +175,6 @@
 
 
 				quad = new THREE.Mesh( plane, materialScreen );
 				quad = new THREE.Mesh( plane, materialScreen );
 				quad.position.z = -100;
 				quad.position.z = -100;
-				quad.rotation.x = Math.PI / 2;
 				sceneScreen.add( quad );
 				sceneScreen.add( quad );
 
 
 				var n = 5,
 				var n = 5,

+ 0 - 1
examples/webgl_shader.html

@@ -129,7 +129,6 @@
 				} );
 				} );
 
 
 				mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), material );
 				mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), material );
-				mesh.geometry.applyMatrix( new THREE.Matrix4().makeRotationX( Math.PI / 2 ) );
 				scene.add( mesh );
 				scene.add( mesh );
 
 
 				renderer = new THREE.WebGLRenderer();
 				renderer = new THREE.WebGLRenderer();

+ 1 - 0
examples/webgl_shading_physical.html

@@ -201,6 +201,7 @@
 
 
 				var ground = new THREE.Mesh( planeGeometry, groundMaterial );
 				var ground = new THREE.Mesh( planeGeometry, groundMaterial );
 				ground.position.set( 0, 0, 0 );
 				ground.position.set( 0, 0, 0 );
+				ground.rotation.x = - Math.PI / 2;
 				ground.scale.set( 1000, 1000, 1000 );
 				ground.scale.set( 1000, 1000, 1000 );
 
 
 				ground.receiveShadow = true;
 				ground.receiveShadow = true;

+ 1 - 0
examples/webgl_shadowmap.html

@@ -205,6 +205,7 @@
 				var ground = new THREE.Mesh( geometry, planeMaterial );
 				var ground = new THREE.Mesh( geometry, planeMaterial );
 
 
 				ground.position.set( 0, FLOOR, 0 );
 				ground.position.set( 0, FLOOR, 0 );
+				ground.rotation.x = - Math.PI / 2;
 				ground.scale.set( 100, 100, 100 );
 				ground.scale.set( 100, 100, 100 );
 
 
 				ground.castShadow = false;
 				ground.castShadow = false;

+ 1 - 0
examples/webgl_shadowmap_performance.html

@@ -205,6 +205,7 @@
 				var ground = new THREE.Mesh( geometry, planeMaterial );
 				var ground = new THREE.Mesh( geometry, planeMaterial );
 
 
 				ground.position.set( 0, FLOOR, 0 );
 				ground.position.set( 0, FLOOR, 0 );
+				ground.rotation.x = - Math.PI / 2;
 				ground.scale.set( 100, 100, 100 );
 				ground.scale.set( 100, 100, 100 );
 
 
 				ground.castShadow = false;
 				ground.castShadow = false;

+ 1 - 3
examples/webgl_terrain_dynamic.html

@@ -419,13 +419,11 @@
 
 
 				quadTarget = new THREE.Mesh( plane, new THREE.MeshBasicMaterial( { color: 0x000000 } ) );
 				quadTarget = new THREE.Mesh( plane, new THREE.MeshBasicMaterial( { color: 0x000000 } ) );
 				quadTarget.position.z = -500;
 				quadTarget.position.z = -500;
-				quadTarget.rotation.x = Math.PI / 2;
 				sceneRenderTarget.add( quadTarget );
 				sceneRenderTarget.add( quadTarget );
 
 
 				// TERRAIN MESH
 				// TERRAIN MESH
 
 
 				var geometryTerrain = new THREE.PlaneGeometry( 6000, 6000, 256, 256 );
 				var geometryTerrain = new THREE.PlaneGeometry( 6000, 6000, 256, 256 );
-				geometryTerrain.applyMatrix( new THREE.Matrix4().makeRotationX( Math.PI / 2 ) );
 
 
 				geometryTerrain.computeFaceNormals();
 				geometryTerrain.computeFaceNormals();
 				geometryTerrain.computeVertexNormals();
 				geometryTerrain.computeVertexNormals();
@@ -634,7 +632,7 @@
 
 
 				var meshTmp = new THREE.Mesh( new THREE.PlaneGeometry( SCREEN_WIDTH, SCREEN_HEIGHT ), shaderMaterial );
 				var meshTmp = new THREE.Mesh( new THREE.PlaneGeometry( SCREEN_WIDTH, SCREEN_HEIGHT ), shaderMaterial );
 				meshTmp.position.z = -500;
 				meshTmp.position.z = -500;
-				 meshTmp.rotation.x = Math.PI / 2;
+
 				sceneTmp.add( meshTmp );
 				sceneTmp.add( meshTmp );
 
 
 				renderer.render( sceneTmp, cameraOrtho, target, true );
 				renderer.render( sceneTmp, cameraOrtho, target, true );

+ 7 - 7
src/extras/geometries/PlaneGeometry.js

@@ -3,29 +3,29 @@
  * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as
  * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as
  */
  */
 
 
-THREE.PlaneGeometry = function ( width, depth, segmentsWidth, segmentsDepth ) {
+THREE.PlaneGeometry = function ( width, height, segmentsWidth, segmentsheight ) {
 
 
 	THREE.Geometry.call( this );
 	THREE.Geometry.call( this );
 
 
 	var ix, iz,
 	var ix, iz,
 	width_half = width / 2,
 	width_half = width / 2,
-	depth_half = depth / 2,
+	height_half = height / 2,
 	gridX = segmentsWidth || 1,
 	gridX = segmentsWidth || 1,
-	gridZ = segmentsDepth || 1,
+	gridZ = segmentsheight || 1,
 	gridX1 = gridX + 1,
 	gridX1 = gridX + 1,
 	gridZ1 = gridZ + 1,
 	gridZ1 = gridZ + 1,
 	segment_width = width / gridX,
 	segment_width = width / gridX,
-	segment_depth = depth / gridZ,
-	normal = new THREE.Vector3( 0, 1, 0 );
+	segment_height = height / gridZ,
+	normal = new THREE.Vector3( 0, 0, 1 );
 
 
 	for ( iz = 0; iz < gridZ1; iz ++ ) {
 	for ( iz = 0; iz < gridZ1; iz ++ ) {
 
 
 		for ( ix = 0; ix < gridX1; ix ++ ) {
 		for ( ix = 0; ix < gridX1; ix ++ ) {
 
 
 			var x = ix * segment_width - width_half;
 			var x = ix * segment_width - width_half;
-			var z = iz * segment_depth - depth_half;
+			var y = iz * segment_height - height_half;
 
 
-			this.vertices.push( new THREE.Vector3( x, 0, z ) );
+			this.vertices.push( new THREE.Vector3( x, - y, 0 ) );
 
 
 		}
 		}