Explorar o código

bezel => bevel in TextGeometry and its example

alteredq %!s(int64=14) %!d(string=hai) anos
pai
achega
f962eb2ea6

+ 3 - 3
build/Three.js

@@ -473,8 +473,8 @@ THREE.SphereGeometry=function(b,c,e){THREE.Geometry.call(this);for(var b=b||50,f
 h-1:f];p=c[e-1][p?0:f+1];u=e/(g-1);v=(e-1)/(g-1);w=(f+1)/h;var t=f/h,o=new THREE.UV(1-w,u),u=new THREE.UV(1-t,u),t=new THREE.UV(1-t,v),x=new THREE.UV(1-w,v);e<c.length-1&&(v=this.vertices[j].position.clone(),w=this.vertices[m].position.clone(),z=this.vertices[n].position.clone(),v.normalize(),w.normalize(),z.normalize(),this.faces.push(new THREE.Face3(j,m,n,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(w.x,w.y,w.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([o,u,t]));e>1&&(v=
 this.vertices[j].position.clone(),w=this.vertices[n].position.clone(),z=this.vertices[p].position.clone(),v.normalize(),w.normalize(),z.normalize(),this.faces.push(new THREE.Face3(j,n,p,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(w.x,w.y,w.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([o,t,x]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry;
 THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.TextGeometry=function(b,c){THREE.Geometry.call(this);this.parameters=c||{};this.set(b)};THREE.TextGeometry.prototype=new THREE.Geometry;THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
-THREE.TextGeometry.prototype.set=function(b,c){function e(b,e,c){w.vertices.push(new THREE.Vertex(new THREE.Vector3(b,e,c)))}function f(b,e,c,f){w.faces.push(new THREE.Face4(b,e,c,f))}this.text=b;var c=c||this.parameters,g=c.height!==void 0?c.height:50,h=c.curveSegments!==void 0?c.curveSegments:4,j=c.font!==void 0?c.font:"helvetiker",m=c.weight!==void 0?c.weight:"normal",n=c.style!==void 0?c.style:"normal",p=c.bezelThickness!==void 0?c.bezelThickness:10,o=c.bezelSize!==void 0?c.bezelSize:8,t=c.bezelEnabled!==
-void 0?c.bezelEnabled:!1;THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=h;THREE.FontUtils.face=j;THREE.FontUtils.weight=m;THREE.FontUtils.style=n;THREE.FontUtils.bezelSize=o;var m=THREE.FontUtils.drawText(b),h=m.points,u=m.faces,j=m.contour,v=m.bezel,w=this;w.vertices=[];w.faces=[];for(var z,n=h.length,x=u.length,o=v.length,m=0;m<n;m++)z=h[m],e(z.x,z.y,0);for(m=0;m<n;m++)z=h[m],e(z.x,z.y,g);if(t){for(m=0;m<o;m++)z=v[m],e(z.x,z.y,p);for(m=0;m<o;m++)z=v[m],e(z.x,z.y,g-p)}for(m=
+THREE.TextGeometry.prototype.set=function(b,c){function e(b,e,c){w.vertices.push(new THREE.Vertex(new THREE.Vector3(b,e,c)))}function f(b,e,c,f){w.faces.push(new THREE.Face4(b,e,c,f))}this.text=b;var c=c||this.parameters,g=c.height!==void 0?c.height:50,h=c.curveSegments!==void 0?c.curveSegments:4,j=c.font!==void 0?c.font:"helvetiker",m=c.weight!==void 0?c.weight:"normal",n=c.style!==void 0?c.style:"normal",p=c.bevelThickness!==void 0?c.bevelThickness:10,o=c.bevelSize!==void 0?c.bevelSize:8,t=c.bevelEnabled!==
+void 0?c.bevelEnabled:!1;THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=h;THREE.FontUtils.face=j;THREE.FontUtils.weight=m;THREE.FontUtils.style=n;THREE.FontUtils.bevelSize=o;var m=THREE.FontUtils.drawText(b),h=m.points,u=m.faces,j=m.contour,v=m.bevel,w=this;w.vertices=[];w.faces=[];for(var z,n=h.length,x=u.length,o=v.length,m=0;m<n;m++)z=h[m],e(z.x,z.y,0);for(m=0;m<n;m++)z=h[m],e(z.x,z.y,g);if(t){for(m=0;m<o;m++)z=v[m],e(z.x,z.y,p);for(m=0;m<o;m++)z=v[m],e(z.x,z.y,g-p)}for(m=
 0;m<x;m++)g=u[m],w.faces.push(new THREE.Face3(g[2],g[1],g[0]));for(m=0;m<x;m++)g=u[m],w.faces.push(new THREE.Face3(g[0]+n,g[1]+n,g[2]+n));var y;if(t)for(m=v.length;--m>0;){if(y){if(y.equals(j[m])){y=null;continue}}else y=j[m];p=n*2+m;u=p-1;f(p,u,u+o,p+o);for(t=0;t<n;t++)if(h[t].equals(j[m]))break;for(g=0;g<n;g++)if(h[g].equals(j[m-1]))break;f(t,g,u,p);f(p+o,u+o,g+n,t+n)}else for(m=j.length;--m>0;){if(y){if(y.equals(j[m])){y=null;continue}}else y=j[m];for(t=0;t<n;t++)if(h[t].equals(j[m]))break;for(g=
 0;g<n;g++)if(h[g].equals(j[m-1]))break;f(t,g,g+n,t+n)}this.computeCentroids();this.computeFaceNormals()};
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(b){var c=b.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][b.cssFontWeight]=this.faces[c][b.cssFontWeight]||{};this.faces[c][b.cssFontWeight][b.cssFontStyle]=b;return this.faces[c][b.cssFontWeight][b.cssFontStyle]=b},extractPoints:function(b,c){if(b.length<3)return console.log("not valid polygon"),
@@ -483,7 +483,7 @@ z,x,y;h=[];for(j=0;j<m.length;j++){n=m[j];g=n.shape;f=n.holes;for(p=0;p<f.length
 1>=0?v-1:g.length-1;t=u-1>=0?u-1:o.length-1;F=[];F.push(o[u]);F.push(g[v]);F.push(g[e]);F=this.Triangulate.area(F);C=[];C.push(o[u]);C.push(o[t]);C.push(g[v]);C=this.Triangulate.area(C);w+x>F+C&&(v=z,u=y,v<0&&(v+=g.length),v%=g.length,u<0&&(u+=o.length),u%=g.length,e=v-1>=0?v-1:g.length-1,t=u-1>=0?u-1:o.length-1);w=g.slice(0,v);x=g.slice(v);z=o.slice(u);y=o.slice(0,u);h.push(o[u]);h.push(g[v]);h.push(g[e]);h.push(o[u]);h.push(o[t]);h.push(g[v]);g=w.concat(z).concat(y).concat(x)}n.shape=g}u=[];v=[];
 for(j=p=0;j<m.length;j++){n=m[j];g=n.shape;u=u.concat(g);o=THREE.FontUtils.Triangulate(g,!0);for(f=0;f<o.length;f++)n=o[f],n[0]+=p,n[1]+=p,n[2]+=p;v=v.concat(o);p+=g.length}var E;for(f=0;f<h.length/3;f++){n=[];for(m=0;m<3;m++){j=!1;for(g=0;g<u.length&&!j;g++)E=f*3+m,u[g].equals(h[E])&&(n.push(g),j=!0);j||(u.push(h[E]),n.push(u.length-1),console.log("not found"))}v.push(n)}return{points:u,faces:v}},drawText:function(b){var c=[],e=[],f,g=this.getFace(),h=this.size/g.resolution,j=0;f=String(b).split("");
 for(var m=f.length,n=new THREE.Path,b=0;b<m;b++){var p=this.extractGlyphPoints(f[b],g,h,j,n);j+=p.offset;c.push(p.points);e=e.concat(p.points)}console.log(n);b=j/2;for(f=0;f<e.length;f++)e[f].x-=b;c=this.extractPoints(e,c);c.contour=e;g=[];h=[];f=[];for(var j=[],m=new THREE.Vector2,o,b=e.length;--b>=0;){if(o){if(o.equals(e[b])){o=null;n=this.Triangulate.area(f)>0;j.push(n);h.push(m.divideScalar(f.length));f=[];m=new THREE.Vector2;continue}}else o=e[b];m.addSelf(e[b]);f.push(e[b])}b=e.length;for(f=
-0;--b>=0;)n=e[b],m=h[f],n=n.clone().subSelf(m),p=this.bezelSize/n.length(),j[f]?p+=1:p=1-p,p=n.multiplyScalar(p).addSelf(m),g.unshift(p),o?o.equals(e[b])&&(o=null,f++):o=e[b];c.bezel=g;return c},b2p0:function(b,c){var e=1-b;return e*e*c},b2p1:function(b,c){return 2*(1-b)*b*c},b2p2:function(b,c){return b*b*c},b2:function(b,c,e,f){return this.b2p0(b,c)+this.b2p1(b,e)+this.b2p2(b,f)},b3p0:function(b,c){var e=1-b;return e*e*e*c},b3p1:function(b,c){var e=1-b;return 3*e*e*b*c},b3p2:function(b,c){return 3*
+0;--b>=0;)n=e[b],m=h[f],n=n.clone().subSelf(m),p=this.bevelSize/n.length(),j[f]?p+=1:p=1-p,p=n.multiplyScalar(p).addSelf(m),g.unshift(p),o?o.equals(e[b])&&(o=null,f++):o=e[b];c.bevel=g;return c},b2p0:function(b,c){var e=1-b;return e*e*c},b2p1:function(b,c){return 2*(1-b)*b*c},b2p2:function(b,c){return b*b*c},b2:function(b,c,e,f){return this.b2p0(b,c)+this.b2p1(b,e)+this.b2p2(b,f)},b3p0:function(b,c){var e=1-b;return e*e*e*c},b3p1:function(b,c){var e=1-b;return 3*e*e*b*c},b3p2:function(b,c){return 3*
 (1-b)*b*b*c},b3p3:function(b,c){return b*b*b*c},b3:function(b,c,e,f,g){return this.b3p0(b,c)+this.b3p1(b,e)+this.b3p2(b,f)+this.b3p3(b,g)},extractGlyphPoints:function(b,c,e,f,g){var h=[],j,m,n,p,o,t,u,v,w,z,x=c.glyphs[b]||c.glyphs[ctxt.options.fallbackCharacter];if(x){if(x.o){c=x._cachedOutline||(x._cachedOutline=x.o.split(" "));n=c.length;for(b=0;b<n;)switch(m=c[b++],m){case "m":m=c[b++]*e+f;p=c[b++]*e;h.push(new THREE.Vector2(m,p));g.moveTo(m,p);break;case "l":m=c[b++]*e+f;p=c[b++]*e;h.push(new THREE.Vector2(m,
 p));g.lineTo(m,p);break;case "q":m=c[b++]*e+f;p=c[b++]*e;u=c[b++]*e+f;v=c[b++]*e;g.quadraticCurveTo(u,v,m,p);if(j=h[h.length-1]){o=j.x;t=j.y;j=1;for(divisions=this.divisions;j<=divisions;j++){var y=j/divisions,F=THREE.FontUtils.b2(y,o,u,m),y=THREE.FontUtils.b2(y,t,v,p);h.push(new THREE.Vector2(F,y))}}break;case "b":if(m=c[b++]*e+f,p=c[b++]*e,u=c[b++]*e+f,v=c[b++]*-e,w=c[b++]*e+f,z=c[b++]*-e,g.bezierCurveTo(m,p,u,v,w,z),j=h[h.length-1]){o=j.x;t=j.y;j=1;for(divisions=this.divisions;j<=divisions;j++)y=
 j/divisions,F=THREE.FontUtils.b3(y,o,u,w,m),y=THREE.FontUtils.b3(y,t,v,z,p),h.push(new THREE.Vector2(F,y))}}}return{offset:x.ha*e,points:h,path:g}}}};

+ 67 - 67
build/custom/ThreeExtras.js

@@ -1,8 +1,8 @@
 // ThreeExtras.js r42 - http://github.com/mrdoob/three.js
 THREE.ColorUtils={adjustHSV:function(a,c,b,f){var e=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,e);e.h=THREE.ColorUtils.clamp(e.h+c,0,1);e.s=THREE.ColorUtils.clamp(e.s+b,0,1);e.v=THREE.ColorUtils.clamp(e.v+f,0,1);a.setHSV(e.h,e.s,e.v)},rgbToHsv:function(a,c){var b=a.r,f=a.g,e=a.b,g=Math.max(Math.max(b,f),e),h=Math.min(Math.min(b,f),e);if(h==g)h=b=0;else{var j=g-h,h=j/g,b=b==g?(f-e)/j:f==g?2+(e-b)/j:4+(b-f)/j;b/=6;b<0&&(b+=1);b>1&&(b-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=b;c.s=h;c.v=g;return c},
 clamp:function(a,c,b){return a<c?c:a>b?b:a}};THREE.ColorUtils.__hsv={h:0,s:0,v:0};
-THREE.GeometryUtils={merge:function(a,c){var b=c instanceof THREE.Mesh,f=a.vertices.length,e=b?c.geometry:c,g=a.vertices,h=e.vertices,j=a.faces,k=e.faces,l=a.faceVertexUvs[0],e=e.faceVertexUvs[0];b&&c.matrixAutoUpdate&&c.updateMatrix();for(var m=0,n=h.length;m<n;m++){var o=new THREE.Vertex(h[m].position.clone());b&&c.matrix.multiplyVector3(o.position);g.push(o)}m=0;for(n=k.length;m<n;m++){var h=k[m],p,v,w=h.vertexNormals,o=h.vertexColors;h instanceof THREE.Face3?p=new THREE.Face3(h.a+f,h.b+f,h.c+
-f):h instanceof THREE.Face4&&(p=new THREE.Face4(h.a+f,h.b+f,h.c+f,h.d+f));p.normal.copy(h.normal);b=0;for(g=w.length;b<g;b++)v=w[b],p.vertexNormals.push(v.clone());p.color.copy(h.color);b=0;for(g=o.length;b<g;b++)v=o[b],p.vertexColors.push(v.clone());p.materials=h.materials.slice();p.centroid.copy(h.centroid);j.push(p)}m=0;for(n=e.length;m<n;m++){f=e[m];j=[];b=0;for(g=f.length;b<g;b++)j.push(new THREE.UV(f[b].u,f[b].v));l.push(j)}}};
+THREE.GeometryUtils={merge:function(a,c){var b=c instanceof THREE.Mesh,f=a.vertices.length,e=b?c.geometry:c,g=a.vertices,h=e.vertices,j=a.faces,k=e.faces,l=a.faceVertexUvs[0],e=e.faceVertexUvs[0];b&&c.matrixAutoUpdate&&c.updateMatrix();for(var m=0,n=h.length;m<n;m++){var o=new THREE.Vertex(h[m].position.clone());b&&c.matrix.multiplyVector3(o.position);g.push(o)}m=0;for(n=k.length;m<n;m++){var h=k[m],p,v,u=h.vertexNormals,o=h.vertexColors;h instanceof THREE.Face3?p=new THREE.Face3(h.a+f,h.b+f,h.c+
+f):h instanceof THREE.Face4&&(p=new THREE.Face4(h.a+f,h.b+f,h.c+f,h.d+f));p.normal.copy(h.normal);b=0;for(g=u.length;b<g;b++)v=u[b],p.vertexNormals.push(v.clone());p.color.copy(h.color);b=0;for(g=o.length;b<g;b++)v=o[b],p.vertexColors.push(v.clone());p.materials=h.materials.slice();p.centroid.copy(h.centroid);j.push(p)}m=0;for(n=e.length;m<n;m++){f=e[m];j=[];b=0;for(g=f.length;b<g;b++)j.push(new THREE.UV(f[b].u,f[b].v));l.push(j)}}};
 THREE.ImageUtils={loadTexture:function(a,c,b){var f=new Image,e=new THREE.Texture(f,c);f.onload=function(){e.needsUpdate=!0;b&&b(this)};f.crossOrigin="";f.src=a;return e},loadTextureCube:function(a,c,b){var f,e=[],g=new THREE.Texture(e,c),c=e.loadCount=0;for(f=a.length;c<f;++c)e[c]=new Image,e[c].onload=function(){e.loadCount+=1;if(e.loadCount==6)g.needsUpdate=!0;b&&b(this)},e[c].crossOrigin="",e[c].src=a[c];return g}};
 THREE.SceneUtils={showHierarchy:function(a,c){THREE.SceneUtils.traverseHierarchy(a,function(a){a.visible=c})},traverseHierarchy:function(a,c){var b,f,e=a.children.length;for(f=0;f<e;f++)b=a.children[f],c(b),THREE.SceneUtils.traverseHierarchy(b,c)}};
 if(THREE.WebGLRenderer)THREE.ShaderUtils={lib:{fresnel:{uniforms:{mRefractionRatio:{type:"f",value:1.02},mFresnelBias:{type:"f",value:0.1},mFresnelPower:{type:"f",value:2},mFresnelScale:{type:"f",value:1},tCube:{type:"t",value:1,texture:null}},fragmentShader:"uniform samplerCube tCube;\nvarying vec3 vReflect;\nvarying vec3 vRefract[3];\nvarying float vReflectionFactor;\nvoid main() {\nvec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\nvec4 refractedColor = vec4( 1.0, 1.0, 1.0, 1.0 );\nrefractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;\nrefractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;\nrefractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;\nrefractedColor.a = 1.0;\ngl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );\n}",vertexShader:"uniform float mRefractionRatio;\nuniform float mFresnelBias;\nuniform float mFresnelScale;\nuniform float mFresnelPower;\nvarying vec3 vReflect;\nvarying vec3 vRefract[3];\nvarying float vReflectionFactor;\nvoid main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = normalize ( mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal );\nvec3 I = mPosition.xyz - cameraPosition;\nvReflect = reflect( I, nWorld );\nvRefract[0] = refract( normalize( I ), nWorld, mRefractionRatio );\nvRefract[1] = refract( normalize( I ), nWorld, mRefractionRatio * 0.99 );\nvRefract[2] = refract( normalize( I ), nWorld, mRefractionRatio * 0.98 );\nvReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), nWorld ), mFresnelPower );\ngl_Position = projectionMatrix * mvPosition;\n}"},
@@ -25,7 +25,7 @@ THREE.Bone?e.skinMatrix:e.matrix;var g=e.animationCache.prevKey;e=e.animationCac
 THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++)if(this.hierarchy[a].animationCache!==void 0)this.hierarchy[a]instanceof THREE.Bone?this.hierarchy[a].skinMatrix=this.hierarchy[a].animationCache.originalMatrix:this.hierarchy[a].matrix=this.hierarchy[a].animationCache.originalMatrix,delete this.hierarchy[a].animationCache};
 THREE.Animation.prototype.update=function(a){if(this.isPlaying){var c=["pos","rot","scl"],b,f,e,g,h,j,k,l,m=this.data.JIT.hierarchy,n,o;this.currentTime+=a*this.timeScale;o=this.currentTime;n=this.currentTime%=this.data.length;l=parseInt(Math.min(n*this.data.fps,this.data.length*this.data.fps),10);for(var p=0,v=this.hierarchy.length;p<v;p++)if(a=this.hierarchy[p],k=a.animationCache,this.JITCompile&&m[p][l]!==void 0)a instanceof THREE.Bone?(a.skinMatrix=m[p][l],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=
-!1):(a.matrix=m[p][l],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)a instanceof THREE.Bone?a.skinMatrix=a.animationCache.originalMatrix:a.matrix=a.animationCache.originalMatrix;for(var w=0;w<3;w++){b=c[w];h=k.prevKey[b];j=k.nextKey[b];if(j.time<=o){if(n<o)if(this.loop){h=this.data.hierarchy[p].keys[0];for(j=this.getNextKeyWith(b,p,1);j.time<n;)h=j,j=this.getNextKeyWith(b,p,j.index+1)}else{this.stop();return}else{do h=j,j=this.getNextKeyWith(b,p,j.index+1);while(j.time<
+!1):(a.matrix=m[p][l],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)a instanceof THREE.Bone?a.skinMatrix=a.animationCache.originalMatrix:a.matrix=a.animationCache.originalMatrix;for(var u=0;u<3;u++){b=c[u];h=k.prevKey[b];j=k.nextKey[b];if(j.time<=o){if(n<o)if(this.loop){h=this.data.hierarchy[p].keys[0];for(j=this.getNextKeyWith(b,p,1);j.time<n;)h=j,j=this.getNextKeyWith(b,p,j.index+1)}else{this.stop();return}else{do h=j,j=this.getNextKeyWith(b,p,j.index+1);while(j.time<
 n)}k.prevKey[b]=h;k.nextKey[b]=j}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;f=(n-h.time)/(j.time-h.time);e=h[b];g=j[b];if(f<0||f>1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+p),f=f<0?0:1;if(b==="pos")if(b=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)b.x=e[0]+(g[0]-e[0])*f,b.y=e[1]+(g[1]-e[1])*f,b.z=e[2]+(g[2]-e[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
 this.getPrevKeyWith("pos",p,h.index-1).pos,this.points[1]=e,this.points[2]=g,this.points[3]=this.getNextKeyWith("pos",p,j.index+1).pos,f=f*0.33+0.33,e=this.interpolateCatmullRom(this.points,f),b.x=e[0],b.y=e[1],b.z=e[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)f=this.interpolateCatmullRom(this.points,f*1.01),this.target.set(f[0],f[1],f[2]),this.target.subSelf(b),this.target.y=0,this.target.normalize(),f=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,f,0)}else if(b===
 "rot")THREE.Quaternion.slerp(e,g,a.quaternion,f);else if(b==="scl")b=a.scale,b.x=e[0]+(g[0]-e[0])*f,b.y=e[1]+(g[1]-e[1])*f,b.z=e[2]+(g[2]-e[2])*f}}if(this.JITCompile&&m[0][l]===void 0){this.hierarchy[0].update(void 0,!0);for(p=0;p<this.hierarchy.length;p++)m[p][l]=this.hierarchy[p]instanceof THREE.Bone?this.hierarchy[p].skinMatrix.clone():this.hierarchy[p].matrix.clone()}}};
@@ -42,7 +42,7 @@ this.heightSpeed?this.tdiff*((this.position.y<this.heightMin?this.heightMin:this
 (this.phi-0)*(this.verticalMax-this.verticalMin)/3.14+this.verticalMin;a=this.target.position;e=this.position;a.x=e.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=e.y+100*Math.cos(this.phi);a.z=e.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),
 !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.FirstPersonCamera.prototype=new THREE.Camera;THREE.FirstPersonCamera.prototype.constructor=THREE.FirstPersonCamera;THREE.FirstPersonCamera.prototype.supr=THREE.Camera.prototype;
 THREE.FirstPersonCamera.prototype.translate=function(a,c){this.matrix.rotateAxis(c);if(this.noFly)c.y=0;this.position.addSelf(c.multiplyScalar(a));this.target.position.addSelf(c.multiplyScalar(a))};
-THREE.PathCamera=function(a){function c(a,b,c,f){var g={name:c,fps:0.6,length:f,hierarchy:[]},e,h=b.getControlPointsArray(),j=b.getLength(),k=h.length,A=0;e=k-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:h[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[e]={time:f,pos:h[e],rot:[0,0,0,1],scl:[1,1,1]};for(e=1;e<k-1;e++)A=f*j.chunks[e]/j.total,b.keys[e]={time:A,pos:h[e]};g.hierarchy[0]=b;THREE.AnimationHandler.add(g);return new THREE.Animation(a,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function b(a,b){var c,
+THREE.PathCamera=function(a){function c(a,b,c,f){var g={name:c,fps:0.6,length:f,hierarchy:[]},e,h=b.getControlPointsArray(),j=b.getLength(),k=h.length,y=0;e=k-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:h[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[e]={time:f,pos:h[e],rot:[0,0,0,1],scl:[1,1,1]};for(e=1;e<k-1;e++)y=f*j.chunks[e]/j.total,b.keys[e]={time:y,pos:h[e]};g.hierarchy[0]=b;THREE.AnimationHandler.add(g);return new THREE.Animation(a,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function b(a,b){var c,
 f,g=new THREE.Geometry;for(c=0;c<a.points.length*b;c++)f=c/(a.points.length*b),f=a.getPoint(f),g.vertices[c]=new THREE.Vertex(new THREE.Vector3(f.x,f.y,f.z));return g}function f(a,c){var f=b(c,10),g=b(c,10),e=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(f,e);particleObj=new THREE.ParticleSystem(g,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);g=new THREE.SphereGeometry(1,
 16,8);e=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)f=new THREE.Mesh(g,e),f.position.copy(c.points[i]),f.updateMatrix(),a.addChild(f)}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.0050;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!==
@@ -62,12 +62,12 @@ this.rollSpeed;this.translateX(this.moveVector.x*a);this.translateY(this.moveVec
 this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-a+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=
 document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this,this.mouseup),!1);window.addEventListener("keydown",c(this,this.keydown),!1);window.addEventListener("keyup",c(this,
 this.keyup),!1);this.updateMovementVector();this.updateRotationVector()};THREE.FlyCamera.prototype=new THREE.Camera;THREE.FlyCamera.prototype.constructor=THREE.FlyCamera;THREE.FlyCamera.prototype.supr=THREE.Camera.prototype;
-THREE.RollCamera=function(a,c,b,f){THREE.Camera.call(this,a,c,b,f);this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.domElement=document;this.matrixAutoUpdate=this.useTarget=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var e=new THREE.Vector3,g=new THREE.Vector3,h=new THREE.Vector3,j=new THREE.Matrix4,k=!1,l=1,m=0,n=0,o=0,p=0,v=0,w=window.innerWidth/2,x=window.innerHeight/2;this.update=
+THREE.RollCamera=function(a,c,b,f){THREE.Camera.call(this,a,c,b,f);this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.domElement=document;this.matrixAutoUpdate=this.useTarget=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var e=new THREE.Vector3,g=new THREE.Vector3,h=new THREE.Vector3,j=new THREE.Matrix4,k=!1,l=1,m=0,n=0,o=0,p=0,v=0,u=window.innerWidth/2,w=window.innerHeight/2;this.update=
 function(){var a=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=a;this.delta=(a-this.lastUpdate)/1E3;this.lastUpdate=a;this.mouseLook&&(a=this.delta*this.lookSpeed,this.rotateHorizontally(a*p),this.rotateVertically(a*v));a=this.delta*this.movementSpeed;this.translateZ(a*(m>0||this.autoForward&&!(m<0)?1:m));this.translateX(a*n);this.translateY(a*o);k&&(this.roll+=this.rollSpeed*this.delta*l);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();
 else if(this.forward.y<this.constrainVertical[0])this.forward.y=this.constrainVertical[0],this.forward.normalize();h.copy(this.forward);g.set(0,1,0);e.cross(g,h).normalize();g.cross(h,e).normalize();this.matrix.n11=e.x;this.matrix.n12=g.x;this.matrix.n13=h.x;this.matrix.n21=e.y;this.matrix.n22=g.y;this.matrix.n23=h.y;this.matrix.n31=e.z;this.matrix.n32=g.z;this.matrix.n33=h.z;j.identity();j.n11=Math.cos(this.roll);j.n12=-Math.sin(this.roll);j.n21=Math.sin(this.roll);j.n22=Math.cos(this.roll);this.matrix.multiplySelf(j);
 this.matrixWorldNeedsUpdate=!0;this.matrix.n14=this.position.x;this.matrix.n24=this.position.y;this.matrix.n34=this.position.z;this.supr.update.call(this)};this.translateX=function(a){this.position.x+=this.matrix.n11*a;this.position.y+=this.matrix.n21*a;this.position.z+=this.matrix.n31*a};this.translateY=function(a){this.position.x+=this.matrix.n12*a;this.position.y+=this.matrix.n22*a;this.position.z+=this.matrix.n32*a};this.translateZ=function(a){this.position.x-=this.matrix.n13*a;this.position.y-=
 this.matrix.n23*a;this.position.z-=this.matrix.n33*a};this.rotateHorizontally=function(a){e.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);e.multiplyScalar(a);this.forward.subSelf(e);this.forward.normalize()};this.rotateVertically=function(a){g.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);g.multiplyScalar(a);this.forward.addSelf(g);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",
-function(a){p=(a.clientX-w)/window.innerWidth;v=(a.clientY-x)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:m=1;break;case 2:m=-1}},!1);this.domElement.addEventListener("mouseup",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:m=0;break;case 2:m=0}},!1);this.domElement.addEventListener("keydown",function(a){switch(a.keyCode){case 38:case 87:m=1;break;case 37:case 65:n=-1;break;
+function(a){p=(a.clientX-u)/window.innerWidth;v=(a.clientY-w)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:m=1;break;case 2:m=-1}},!1);this.domElement.addEventListener("mouseup",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:m=0;break;case 2:m=0}},!1);this.domElement.addEventListener("keydown",function(a){switch(a.keyCode){case 38:case 87:m=1;break;case 37:case 65:n=-1;break;
 case 40:case 83:m=-1;break;case 39:case 68:n=1;break;case 81:k=!0;l=1;break;case 69:k=!0;l=-1;break;case 82:o=1;break;case 70:o=-1}},!1);this.domElement.addEventListener("keyup",function(a){switch(a.keyCode){case 38:case 87:m=0;break;case 37:case 65:n=0;break;case 40:case 83:m=0;break;case 39:case 68:n=0;break;case 81:k=!1;break;case 69:k=!1;break;case 82:o=0;break;case 70:o=0}},!1)};THREE.RollCamera.prototype=new THREE.Camera;THREE.RollCamera.prototype.constructor=THREE.RollCamera;
 THREE.RollCamera.prototype.supr=THREE.Camera.prototype;
 THREE.TrackballCamera=function(a){function c(a,b){return function(){b.apply(a,arguments)}}a=a||{};THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.domElement=a.domElement||document;this.screen=a.screen||{width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=a.radius||(this.screen.width+this.screen.height)/4;this.rotateSpeed=a.rotateSpeed||1;this.zoomSpeed=a.zoomSpeed||1.2;this.panSpeed=a.panSpeed||0.3;this.noZoom=a.noZoom||!1;this.noPan=a.noPan||
@@ -96,7 +96,7 @@ THREE.Path.prototype.splineThru=function(a){var c=Array.prototype.slice.call(arg
 THREE.Path.prototype.arc=function(a,c,b,f,e,g){var h=Array.prototype.slice.call(arguments);this.curves.push(new THREE.ArcCurve(a,c,b,f,e,g));this.actions.push({action:THREE.PathActions.ARC,args:h})};THREE.Path.prototype.getSpacedPoints=function(a){a||(a=40);for(var c=[],b=0;b<a;b++)c.push(this.getPoint(b/a));return c};
 THREE.Path.prototype.getPoints=function(a){var a=a||12,c=[],b,f,e,g,h,j,k,l,m,n,o,p,v;b=0;for(f=this.actions.length;b<f;b++)switch(e=this.actions[b],g=e.action,e=e.args,g){case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(e[0],e[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=e[2];j=e[3];m=e[0];n=e[1];c.length>0?(g=c[c.length-1],o=g.x,p=g.y):(g=this.actions[b-1].args,o=g[g.length-2],p=g[g.length-1]);for(g=1;g<=a;g++)v=g/a,e=THREE.FontUtils.b2(v,o,m,h),v=THREE.FontUtils.b2(v,p,n,j),c.push(new THREE.Vector2(e,
 v));break;case THREE.PathActions.BEZIER_CURVE_TO:h=e[4];j=e[5];m=e[0];n=e[1];k=e[2];l=e[3];c.length>0?(g=c[c.length-1],o=g.x,p=g.y):(g=this.actions[b-1].args,o=g[g.length-2],p=g[g.length-1]);for(g=1;g<=a;g++)v=g/a,e=THREE.FontUtils.b3(v,o,m,k,h),v=THREE.FontUtils.b3(v,p,n,l,j),c.push(new THREE.Vector2(e,v));break;case THREE.PathActions.CSPLINE_THRU:g=this.actions[b-1].args;g=[new THREE.Vector2(g[g.length-2],g[g.length-1])];v=a*e[0].length;g=g.concat(e[0]);e=new THREE.SplineCurve(g);for(g=1;g<=v;g++)c.push(e.getPointAt(g/
-v));break;case THREE.PathActions.ARC:g=this.actions[b-1].args;h=e[0];j=e[1];k=e[2];m=e[3];v=e[4];n=!!e[5];l=g[g.length-2];o=g[g.length-1];g.length==0&&(l=o=0);p=v-m;var w=a*2;for(g=1;g<=w;g++)v=g/w,n||(v=1-v),v=m+v*p,e=l+h+k*Math.cos(v),v=o+j+k*Math.sin(v),c.push(new THREE.Vector2(e,v))}return c};
+v));break;case THREE.PathActions.ARC:g=this.actions[b-1].args;h=e[0];j=e[1];k=e[2];m=e[3];v=e[4];n=!!e[5];l=g[g.length-2];o=g[g.length-1];g.length==0&&(l=o=0);p=v-m;var u=a*2;for(g=1;g<=u;g++)v=g/u,n||(v=1-v),v=m+v*p,e=l+h+k*Math.cos(v),v=o+j+k*Math.sin(v),c.push(new THREE.Vector2(e,v))}return c};
 THREE.Path.prototype.getMinAndMax=function(){var a=this.getPoints(),c,b,f,e;c=b=Number.NEGATIVE_INFINITY;f=e=Number.POSITIVE_INFINITY;var g,h,j;h=0;for(j=a.length;h<j;h++){g=a[h];if(g.x>c)c=g.x;else if(g.x<f)f=g.x;if(g.y>b)b=g.y;else if(g.y<b)e=g.y}return{minX:f,minY:e,maxX:c,maxY:b}};THREE.Path.prototype.getPoint=function(a){for(var c=a*this.getLength(),b=this.sums,a=0;a<b.length;){if(b[a]>=c)return c=b[a]-c,a=this.curves[a],c=1-c/a.getLength(),a.getPointAt(c);a++}return null};
 THREE.Path.prototype.getLength=function(){var a=[],c=0,b,f=this.curves.length;for(b=0;b<f;b++)c+=this.curves[b].getLength(),a.push(c);this.sums=a;return c};
 THREE.Path.prototype.createPathGeometry=function(a,c){var b=this.getPoints(a),f,e=new THREE.Object3D;c||(c=new THREE.LineBasicMaterial({color:0,opacity:0.7}));for(var g=1;g<b.length;g++)f=new THREE.Geometry,f.vertices.push(new THREE.Vertex(new THREE.Vector3(b[g-1].x,b[g-1].y,0))),f.vertices.push(new THREE.Vertex(new THREE.Vector3(b[g].x,b[g].y,0))),f=new THREE.Line(f,c),e.addChild(f);return e};
@@ -105,21 +105,21 @@ THREE.Path.prototype.nltransform=function(a,c,b,f,e,g){var h=this.getPoints(),j,
 THREE.Path.prototype.debug=function(a){var c=this.getMinAndMax();a||(a=document.createElement("canvas"),a.setAttribute("width",c.maxX+100),a.setAttribute("height",c.maxY+100),document.body.appendChild(a));c=a.getContext("2d");c.fillStyle="white";c.fillRect(0,0,a.width,a.height);c.strokeStyle="black";c.beginPath();var b,f,e,a=0;for(b=this.actions.length;a<b;a++)f=this.actions[a],e=f.args,f=f.action,f!=THREE.PathActions.CSPLINE_THRU&&c[f].apply(c,e);c.stroke();c.closePath();c.strokeStyle="red";f=this.transform(0.866,
 -0.866,0,0.5,0.5,-50);a=0;for(b=f.length;a<b;a++)e=f[a],c.beginPath(),c.arc(e.x,e.y,1.5,0,Math.PI*2,!1),c.stroke(),c.closePath()};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=new THREE.Path;THREE.Shape.prototype.constructor=THREE.Path;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
 THREE.Shape.prototype.getHoles=function(a){var a=a?"getSpacedPoints":"getPoints",c,b=this.holes.length,f=[];for(c=0;c<b;c++)f[c]=this.holes[c][a]();return f};THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this[a?"getSpacedPoints":"getPoints"](),holes:this.getHoles(a)}};
-THREE.Shape.Utils={removeHoles:function(a,c){var b=a.concat(),f=b.concat(),e,g,h,j,k,l,m,n,o,p,v=[];for(k=0;k<c.length;k++){l=c[k];f=f.concat(l);g=Number.POSITIVE_INFINITY;for(e=0;e<l.length;e++){o=l[e];p=[];for(n=0;n<b.length;n++)m=b[n],m=o.distanceTo(m),p.push(m),m<g&&(g=m,h=e,j=n)}e=j-1>=0?j-1:b.length-1;g=h-1>=0?h-1:l.length-1;var w=[l[h],b[j],b[e]];n=THREE.FontUtils.Triangulate.area(w);var x=[l[h],l[g],b[j]];o=THREE.FontUtils.Triangulate.area(x);p=j;m=h;j+=1;h+=-1;j<0&&(j+=b.length);j%=b.length;
-h<0&&(h+=l.length);h%=l.length;e=j-1>=0?j-1:b.length-1;g=h-1>=0?h-1:l.length-1;w=[l[h],b[j],b[e]];w=THREE.FontUtils.Triangulate.area(w);x=[l[h],l[g],b[j]];x=THREE.FontUtils.Triangulate.area(x);n+o>w+x&&(j=p,h=m,j<0&&(j+=b.length),j%=b.length,h<0&&(h+=l.length),h%=l.length,e=j-1>=0?j-1:b.length-1,g=h-1>=0?h-1:l.length-1);n=b.slice(0,j);o=b.slice(j);p=l.slice(h);m=l.slice(0,h);g=[l[h],l[g],b[j]];v.push([l[h],b[j],b[e]]);v.push(g);b=n.concat(p).concat(m).concat(o)}return{shape:b,isolatedPts:v,allpoints:f}},
+THREE.Shape.Utils={removeHoles:function(a,c){var b=a.concat(),f=b.concat(),e,g,h,j,k,l,m,n,o,p,v=[];for(k=0;k<c.length;k++){l=c[k];f=f.concat(l);g=Number.POSITIVE_INFINITY;for(e=0;e<l.length;e++){o=l[e];p=[];for(n=0;n<b.length;n++)m=b[n],m=o.distanceTo(m),p.push(m),m<g&&(g=m,h=e,j=n)}e=j-1>=0?j-1:b.length-1;g=h-1>=0?h-1:l.length-1;var u=[l[h],b[j],b[e]];n=THREE.FontUtils.Triangulate.area(u);var w=[l[h],l[g],b[j]];o=THREE.FontUtils.Triangulate.area(w);p=j;m=h;j+=1;h+=-1;j<0&&(j+=b.length);j%=b.length;
+h<0&&(h+=l.length);h%=l.length;e=j-1>=0?j-1:b.length-1;g=h-1>=0?h-1:l.length-1;u=[l[h],b[j],b[e]];u=THREE.FontUtils.Triangulate.area(u);w=[l[h],l[g],b[j]];w=THREE.FontUtils.Triangulate.area(w);n+o>u+w&&(j=p,h=m,j<0&&(j+=b.length),j%=b.length,h<0&&(h+=l.length),h%=l.length,e=j-1>=0?j-1:b.length-1,g=h-1>=0?h-1:l.length-1);n=b.slice(0,j);o=b.slice(j);p=l.slice(h);m=l.slice(0,h);g=[l[h],l[g],b[j]];v.push([l[h],b[j],b[e]]);v.push(g);b=n.concat(p).concat(m).concat(o)}return{shape:b,isolatedPts:v,allpoints:f}},
 triangulateShape:function(a,c){var b=THREE.Shape.Utils.removeHoles(a,c),f=b.allpoints,e=b.isolatedPts,b=THREE.FontUtils.Triangulate(b.shape,!1),g,h,j,k;for(g=0;g<b.length;g++){k=b[g];for(h=0;h<3;h++)for(j=0;j<f.length;j++)f[j].equals(k[h])&&(k[h]=j)}for(g=0;g<e.length;g++){k=e[g];for(h=0;h<3;h++)for(j=0;j<f.length;j++)f[j].equals(k[h])&&(k[h]=j)}return b.concat(e)},isClockWise:function(a){return THREE.FontUtils.Triangulate.area(a)<0}};
-THREE.CubeGeometry=function(a,c,b,f,e,g,h,j,k){function l(a,b,c,h,j,k,l,n){var p,o,v=f||1,w=e||1,F=j/2,L=k/2,N=m.vertices.length;if(a=="x"&&b=="y"||a=="y"&&b=="x")p="z";else if(a=="x"&&b=="z"||a=="z"&&b=="x")p="y",w=g||1;else if(a=="z"&&b=="y"||a=="y"&&b=="z")p="x",v=g||1;var M=v+1,O=w+1;j/=v;var Q=k/w;for(o=0;o<O;o++)for(k=0;k<M;k++){var E=new THREE.Vector3;E[a]=(k*j-F)*c;E[b]=(o*Q-L)*h;E[p]=l;m.vertices.push(new THREE.Vertex(E))}for(o=0;o<w;o++)for(k=0;k<v;k++)m.faces.push(new THREE.Face4(k+M*o+
-N,k+M*(o+1)+N,k+1+M*(o+1)+N,k+1+M*o+N,null,null,n)),m.faceVertexUvs[0].push([new THREE.UV(k/v,o/w),new THREE.UV(k/v,(o+1)/w),new THREE.UV((k+1)/v,(o+1)/w),new THREE.UV((k+1)/v,o/w)])}THREE.Geometry.call(this);var m=this,n=a/2,o=c/2,p=b/2,j=j?-1:1;if(h!==void 0)if(h instanceof Array)this.materials=h;else{this.materials=[];for(var v=0;v<6;v++)this.materials.push([h])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(k!=void 0)for(var w in k)this.sides[w]!=void 0&&(this.sides[w]=
-k[w]);this.sides.px&&l("z","y",1*j,-1,b,c,-n,this.materials[0]);this.sides.nx&&l("z","y",-1*j,-1,b,c,n,this.materials[1]);this.sides.py&&l("x","z",1*j,1,a,b,o,this.materials[2]);this.sides.ny&&l("x","z",1*j,-1,a,b,-o,this.materials[3]);this.sides.pz&&l("x","y",1*j,-1,a,c,p,this.materials[4]);this.sides.nz&&l("x","y",-1*j,-1,a,c,-p,this.materials[5]);(function(){for(var a=[],b=[],c=0,f=m.vertices.length;c<f;c++){for(var g=m.vertices[c],e=!1,h=0,j=a.length;h<j;h++){var k=a[h];if(g.position.x==k.position.x&&
+THREE.CubeGeometry=function(a,c,b,f,e,g,h,j,k){function l(a,b,c,h,j,k,l,n){var p,o,v=f||1,u=e||1,D=j/2,K=k/2,F=m.vertices.length;if(a=="x"&&b=="y"||a=="y"&&b=="x")p="z";else if(a=="x"&&b=="z"||a=="z"&&b=="x")p="y",u=g||1;else if(a=="z"&&b=="y"||a=="y"&&b=="z")p="x",v=g||1;var I=v+1,O=u+1;j/=v;var M=k/u;for(o=0;o<O;o++)for(k=0;k<I;k++){var C=new THREE.Vector3;C[a]=(k*j-D)*c;C[b]=(o*M-K)*h;C[p]=l;m.vertices.push(new THREE.Vertex(C))}for(o=0;o<u;o++)for(k=0;k<v;k++)m.faces.push(new THREE.Face4(k+I*o+
+F,k+I*(o+1)+F,k+1+I*(o+1)+F,k+1+I*o+F,null,null,n)),m.faceVertexUvs[0].push([new THREE.UV(k/v,o/u),new THREE.UV(k/v,(o+1)/u),new THREE.UV((k+1)/v,(o+1)/u),new THREE.UV((k+1)/v,o/u)])}THREE.Geometry.call(this);var m=this,n=a/2,o=c/2,p=b/2,j=j?-1:1;if(h!==void 0)if(h instanceof Array)this.materials=h;else{this.materials=[];for(var v=0;v<6;v++)this.materials.push([h])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(k!=void 0)for(var u in k)this.sides[u]!=void 0&&(this.sides[u]=
+k[u]);this.sides.px&&l("z","y",1*j,-1,b,c,-n,this.materials[0]);this.sides.nx&&l("z","y",-1*j,-1,b,c,n,this.materials[1]);this.sides.py&&l("x","z",1*j,1,a,b,o,this.materials[2]);this.sides.ny&&l("x","z",1*j,-1,a,b,-o,this.materials[3]);this.sides.pz&&l("x","y",1*j,-1,a,c,p,this.materials[4]);this.sides.nz&&l("x","y",-1*j,-1,a,c,-p,this.materials[5]);(function(){for(var a=[],b=[],c=0,f=m.vertices.length;c<f;c++){for(var g=m.vertices[c],e=!1,h=0,j=a.length;h<j;h++){var k=a[h];if(g.position.x==k.position.x&&
 g.position.y==k.position.y&&g.position.z==k.position.z){b[c]=h;e=!0;break}}if(!e)b[c]=a.length,a.push(new THREE.Vertex(g.position.clone()))}c=0;for(f=m.faces.length;c<f;c++)g=m.faces[c],g.a=b[g.a],g.b=b[g.b],g.c=b[g.c],g.d=b[g.d];m.vertices=a})();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
 THREE.CylinderGeometry=function(a,c,b,f,e,g){function h(a,b,c){j.vertices.push(new THREE.Vertex(new THREE.Vector3(a,b,c)))}THREE.Geometry.call(this);var j=this,k,l=Math.PI*2,m=f/2;for(k=0;k<a;k++)h(Math.sin(l*k/a)*c,Math.cos(l*k/a)*c,-m);for(k=0;k<a;k++)h(Math.sin(l*k/a)*b,Math.cos(l*k/a)*b,m);for(k=0;k<a;k++)j.faces.push(new THREE.Face4(k,k+a,a+(k+1)%a,(k+1)%a));if(b>0){h(0,0,-m-(g||0));for(k=a;k<a+a/2;k++)j.faces.push(new THREE.Face4(2*a,(2*k-2*a)%a,(2*k-2*a+1)%a,(2*k-2*a+2)%a))}if(c>0){h(0,0,m+
 (e||0));for(k=a+a/2;k<2*a;k++)j.faces.push(new THREE.Face4(2*a+1,(2*k-2*a+2)%a+a,(2*k-2*a+1)%a+a,(2*k-2*a)%a+a))}k=0;for(a=this.faces.length;k<a;k++){var c=[],b=this.faces[k],e=this.vertices[b.a],g=this.vertices[b.b],m=this.vertices[b.c],n=this.vertices[b.d];c.push(new THREE.UV(0.5+Math.atan2(e.position.x,e.position.y)/l,0.5+e.position.z/f));c.push(new THREE.UV(0.5+Math.atan2(g.position.x,g.position.y)/l,0.5+g.position.z/f));c.push(new THREE.UV(0.5+Math.atan2(m.position.x,m.position.y)/l,0.5+m.position.z/
 f));b instanceof THREE.Face4&&c.push(new THREE.UV(0.5+Math.atan2(n.position.x,n.position.y)/l,0.5+n.position.z/f));this.faceVertexUvs[0].push(c)}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
-THREE.ExtrudeGeometry=function(a,c){function b(a,b,c,f){vectorFromCentroid=a.clone().subSelf(b);adj=c/vectorFromCentroid.length();f?adj+=1:adj=1-adj;return vectorFromCentroid.multiplyScalar(adj).addSelf(b)}function f(a){for(D=a.length;--D>=0;){N=D;M=D-1;M<0&&(M=a.length-1);for(var b=0;b<n+m*2;b++){var c=F*b,f=F*(b+1);A.faces.push(new THREE.Face4(O+N+c,O+M+c,O+M+f,O+N+f))}}}function e(a,b,c){A.vertices.push(new THREE.Vertex(new THREE.Vector3(a,b,c)))}function g(a,b,c){A.faces.push(new THREE.Face3(a,
-b,c))}var h=c.amount!==void 0?c.amount:100,j=c.bevelThickness!==void 0?c.bevelThickness:8,k=c.bevelSize!==void 0?c.bevelSize:j,l=c.bevelEnabled!==void 0?c.bevelEnabled:!0,m=c.bevelSegments!==void 0?c.bevelSegments:3;l||(m=0);var n=c.steps!==void 0?c.steps:1,o=c.path!==void 0?c.path:null,p,v=!1;if(o)p=o.getPoints(),n=p.length,v=!0;THREE.Geometry.call(this);var w,x,y,A=this,o=a.extractAllPoints(!1),u=o.shape,o=o.holes,B=!THREE.Shape.Utils.isClockWise(u);if(B){u=u.reverse();x=0;for(y=o.length;x<y;x++)w=
-o[x],THREE.Shape.Utils.isClockWise(w)&&(o[x]=w.reverse());B=!1}var B=THREE.Shape.Utils.triangulateShape(u,o),C=u;x=0;for(y=o.length;x<y;x++)w=o[x],u=u.concat(w);var H,J=new THREE.Vector2,K,I,D=0;for(il=C.length;D<il;D++)J.addSelf(C[D]);K=J.divideScalar(C.length);I=[];x=0;for(y=o.length;x<y;x++){J=new THREE.Vector2;w=o[x];D=0;for(il=w.length;D<il;D++)J.addSelf(w[D]);I[x]=J.divideScalar(w.length)}var D,G,F=u.length,J=B.length,L;for(H=m;H>0;H--){t=H/m;z=j*t;L=k*(1-Math.sin((1-t)*Math.PI/2));D=0;for(il=
-C.length;D<il;D++)G=b(C[D],K,L,!1),e(G.x,G.y,-z);x=0;for(y=o.length;x<y;x++){w=o[x];D=0;for(il=w.length;D<il;D++)G=b(w[D],I[x],L,!0),e(G.x,G.y,-z)}}for(D=0;D<F;D++)G=u[D],v?e(G.x,G.y+p[0].y,p[0].x):e(G.x,G.y,0);for(w=1;w<=n;w++)for(D=0;D<F;D++)G=u[D],v?e(G.x,G.y+p[w-1].y,p[w-1].x):e(G.x,G.y,h/n*w);for(H=1;H<=m;H++){t=H/m;z=j*t;L=k*(1-Math.sin((1-t)*Math.PI/2));D=0;for(il=C.length;D<il;D++)G=b(C[D],K,L,!1),e(G.x,G.y,h+z);x=0;for(y=o.length;x<y;x++){w=o[x];D=0;for(il=w.length;D<il;D++)G=b(w[D],I[x],
-L,!0),v?e(G.x,G.y+p[n-1].y,p[n-1].x+z):e(G.x,G.y,h+z)}}if(l){j=F*0;for(D=0;D<J;D++)h=B[D],g(h[2]+j,h[1]+j,h[0]+j);j=F*(n+m*2);for(D=0;D<J;D++)h=B[D],g(h[0]+j,h[1]+j,h[2]+j)}else{for(D=0;D<J;D++)h=B[D],g(h[2],h[1],h[0]);for(D=0;D<J;D++)h=B[D],g(h[0]+F*n,h[1]+F*n,h[2]+F*n)}var N,M,O=0;f(C);O+=C.length;x=0;for(y=o.length;x<y;x++)w=o[x],f(w),O+=w.length;this.computeCentroids();this.computeFaceNormals()};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
+THREE.ExtrudeGeometry=function(a,c){function b(a,b,c,f){a=a.clone().subSelf(b);c/=a.length();return a.multiplyScalar(f?1+c:1-c).addSelf(b)}function f(a){for(A=a.length;--A>=0;){O=A;M=A-1;M<0&&(M=a.length-1);for(var b=0,b=0;b<n+m*2;b++){var c=I*b,f=I*(b+1);y.faces.push(new THREE.Face4(C+O+c,C+M+c,C+M+f,C+O+f))}}}function e(a,b,c){y.vertices.push(new THREE.Vertex(new THREE.Vector3(a,b,c)))}function g(a,b,c){y.faces.push(new THREE.Face3(a,b,c))}var h=c.amount!==void 0?c.amount:100,j=c.bevelThickness!==
+void 0?c.bevelThickness:8,k=c.bevelSize!==void 0?c.bevelSize:j,l=c.bevelEnabled!==void 0?c.bevelEnabled:!0,m=c.bevelSegments!==void 0?c.bevelSegments:3;l||(m=0);var n=c.steps!==void 0?c.steps:1,o=c.path!==void 0?c.path:null,p,v=!1;if(o)p=o.getPoints(),n=p.length,v=!0;THREE.Geometry.call(this);var u,w,x,y=this,o=a.extractAllPoints(!1),t=o.shape,o=o.holes,z=!THREE.Shape.Utils.isClockWise(t);if(z){t=t.reverse();w=0;for(x=o.length;w<x;w++)u=o[w],THREE.Shape.Utils.isClockWise(u)&&(o[w]=u.reverse());z=
+!1}var z=THREE.Shape.Utils.triangulateShape(t,o),B=t;w=0;for(x=o.length;w<x;w++)u=o[w],t=t.concat(u);var A,E,G=new THREE.Vector2;A=0;for(E=B.length;A<E;A++)G.addSelf(B[A]);var H=G.divideScalar(B.length),L=[];w=0;for(x=o.length;w<x;w++){G=new THREE.Vector2;u=o[w];A=0;for(E=u.length;A<E;A++)G.addSelf(u[A]);L[w]=G.divideScalar(u.length)}var J,D,K,F,I=t.length,G=z.length;for(J=m;J>0;J--){u=J/m;K=j*u;D=k*(1-Math.sin((1-u)*Math.PI/2));A=0;for(E=B.length;A<E;A++)F=b(B[A],H,D,!1),e(F.x,F.y,-K);w=0;for(x=
+o.length;w<x;w++){u=o[w];A=0;for(E=u.length;A<E;A++)F=b(u[A],L[w],D,!0),e(F.x,F.y,-K)}}for(A=0;A<I;A++)F=t[A],v?e(F.x,F.y+p[0].y,p[0].x):e(F.x,F.y,0);for(u=1;u<=n;u++)for(A=0;A<I;A++)F=t[A],v?e(F.x,F.y+p[u-1].y,p[u-1].x):e(F.x,F.y,h/n*u);for(J=1;J<=m;J++){u=J/m;K=j*u;D=k*(1-Math.sin((1-u)*Math.PI/2));A=0;for(E=B.length;A<E;A++)F=b(B[A],H,D,!1),e(F.x,F.y,h+K);w=0;for(x=o.length;w<x;w++){u=o[w];A=0;for(E=u.length;A<E;A++)F=b(u[A],L[w],D,!0),v?e(F.x,F.y+p[n-1].y,p[n-1].x+K):e(F.x,F.y,h+K)}}if(l){j=I*
+0;for(A=0;A<G;A++)h=z[A],g(h[2]+j,h[1]+j,h[0]+j);j=I*(n+m*2);for(A=0;A<G;A++)h=z[A],g(h[0]+j,h[1]+j,h[2]+j)}else{for(A=0;A<G;A++)h=z[A],g(h[2],h[1],h[0]);for(A=0;A<G;A++)h=z[A],g(h[0]+I*n,h[1]+I*n,h[2]+I*n)}var O,M,C=0;f(B);C+=B.length;w=0;for(x=o.length;w<x;w++)u=o[w],f(u),C+=u.length;this.computeCentroids();this.computeFaceNormals()};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
 THREE.IcosahedronGeometry=function(a){function c(a,b,c){var f=Math.sqrt(a*a+b*b+c*c);return e.vertices.push(new THREE.Vertex(new THREE.Vector3(a/f,b/f,c/f)))-1}function b(a,b,c,f){f.faces.push(new THREE.Face3(a,b,c))}function f(a,b){var f=e.vertices[a].position,g=e.vertices[b].position;return c((f.x+g.x)/2,(f.y+g.y)/2,(f.z+g.z)/2)}var e=this,g=new THREE.Geometry,h;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;c(-1,a,0);c(1,a,0);c(-1,-a,0);c(1,-a,0);c(0,-1,a);c(0,1,a);c(0,-1,
 -a);c(0,1,-a);c(a,0,-1);c(a,0,1);c(-a,0,-1);c(-a,0,1);b(0,11,5,g);b(0,5,1,g);b(0,1,7,g);b(0,7,10,g);b(0,10,11,g);b(1,5,9,g);b(5,11,4,g);b(11,10,2,g);b(10,7,6,g);b(7,1,8,g);b(3,9,4,g);b(3,4,2,g);b(3,2,6,g);b(3,6,8,g);b(3,8,9,g);b(4,9,5,g);b(2,4,11,g);b(6,2,10,g);b(8,6,7,g);b(9,8,1,g);for(a=0;a<this.subdivisions;a++){h=new THREE.Geometry;for(var j in g.faces){var k=f(g.faces[j].a,g.faces[j].b),l=f(g.faces[j].b,g.faces[j].c),m=f(g.faces[j].c,g.faces[j].a);b(g.faces[j].a,k,m,h);b(g.faces[j].b,l,k,h);
 b(g.faces[j].c,m,l,h);b(k,l,m,h)}g.faces=h.faces}e.faces=g.faces;delete g;delete h;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
@@ -127,26 +127,26 @@ THREE.LatheGeometry=function(a,c,b){THREE.Geometry.call(this);this.steps=c||12;t
 for(j=0;j<f.length-1;j++)this.faces.push(new THREE.Face4(e[j],e[j+1],f[j+1],f[j])),this.faceVertexUvs[0].push([new THREE.UV(1-k/this.angle,j/a.length),new THREE.UV(1-k/this.angle,(j+1)/a.length),new THREE.UV(1-(k-c)/this.angle,(j+1)/a.length),new THREE.UV(1-(k-c)/this.angle,j/a.length)]);f=e;e=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
 THREE.PlaneGeometry=function(a,c,b,f){THREE.Geometry.call(this);var e,g=a/2,h=c/2,b=b||1,f=f||1,j=b+1,k=f+1;a/=b;var l=c/f;for(e=0;e<k;e++)for(c=0;c<j;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*a-g,-(e*l-h),0)));for(e=0;e<f;e++)for(c=0;c<b;c++)this.faces.push(new THREE.Face4(c+j*e,c+j*(e+1),c+1+j*(e+1),c+1+j*e)),this.faceVertexUvs[0].push([new THREE.UV(c/b,e/f),new THREE.UV(c/b,(e+1)/f),new THREE.UV((c+1)/b,(e+1)/f),new THREE.UV((c+1)/b,e/f)]);this.computeCentroids();this.computeFaceNormals()};
 THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
-THREE.SphereGeometry=function(a,c,b){THREE.Geometry.call(this);for(var a=a||50,f,e=Math.PI,g=Math.max(3,c||8),h=Math.max(2,b||6),c=[],b=0;b<h+1;b++){f=b/h;var j=a*Math.cos(f*e),k=a*Math.sin(f*e),l=[],m=0;for(f=0;f<g;f++){var n=2*f/g,o=k*Math.sin(n*e),n=k*Math.cos(n*e);(b==0||b==h)&&f>0||(m=this.vertices.push(new THREE.Vertex(new THREE.Vector3(n,j,o)))-1);l.push(m)}c.push(l)}for(var p,v,w,e=c.length,b=0;b<e;b++)if(g=c[b].length,b>0)for(f=0;f<g;f++){l=f==g-1;h=c[b][l?0:f+1];j=c[b][l?g-1:f];k=c[b-1][l?
-g-1:f];l=c[b-1][l?0:f+1];o=b/(e-1);p=(b-1)/(e-1);v=(f+1)/g;var n=f/g,m=new THREE.UV(1-v,o),o=new THREE.UV(1-n,o),n=new THREE.UV(1-n,p),x=new THREE.UV(1-v,p);b<c.length-1&&(p=this.vertices[h].position.clone(),v=this.vertices[j].position.clone(),w=this.vertices[k].position.clone(),p.normalize(),v.normalize(),w.normalize(),this.faces.push(new THREE.Face3(h,j,k,[new THREE.Vector3(p.x,p.y,p.z),new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(w.x,w.y,w.z)])),this.faceVertexUvs[0].push([m,o,n]));b>1&&(p=
-this.vertices[h].position.clone(),v=this.vertices[k].position.clone(),w=this.vertices[l].position.clone(),p.normalize(),v.normalize(),w.normalize(),this.faces.push(new THREE.Face3(h,k,l,[new THREE.Vector3(p.x,p.y,p.z),new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(w.x,w.y,w.z)])),this.faceVertexUvs[0].push([m,n,x]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry;
+THREE.SphereGeometry=function(a,c,b){THREE.Geometry.call(this);for(var a=a||50,f,e=Math.PI,g=Math.max(3,c||8),h=Math.max(2,b||6),c=[],b=0;b<h+1;b++){f=b/h;var j=a*Math.cos(f*e),k=a*Math.sin(f*e),l=[],m=0;for(f=0;f<g;f++){var n=2*f/g,o=k*Math.sin(n*e),n=k*Math.cos(n*e);(b==0||b==h)&&f>0||(m=this.vertices.push(new THREE.Vertex(new THREE.Vector3(n,j,o)))-1);l.push(m)}c.push(l)}for(var p,v,u,e=c.length,b=0;b<e;b++)if(g=c[b].length,b>0)for(f=0;f<g;f++){l=f==g-1;h=c[b][l?0:f+1];j=c[b][l?g-1:f];k=c[b-1][l?
+g-1:f];l=c[b-1][l?0:f+1];o=b/(e-1);p=(b-1)/(e-1);v=(f+1)/g;var n=f/g,m=new THREE.UV(1-v,o),o=new THREE.UV(1-n,o),n=new THREE.UV(1-n,p),w=new THREE.UV(1-v,p);b<c.length-1&&(p=this.vertices[h].position.clone(),v=this.vertices[j].position.clone(),u=this.vertices[k].position.clone(),p.normalize(),v.normalize(),u.normalize(),this.faces.push(new THREE.Face3(h,j,k,[new THREE.Vector3(p.x,p.y,p.z),new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(u.x,u.y,u.z)])),this.faceVertexUvs[0].push([m,o,n]));b>1&&(p=
+this.vertices[h].position.clone(),v=this.vertices[k].position.clone(),u=this.vertices[l].position.clone(),p.normalize(),v.normalize(),u.normalize(),this.faces.push(new THREE.Face3(h,k,l,[new THREE.Vector3(p.x,p.y,p.z),new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(u.x,u.y,u.z)])),this.faceVertexUvs[0].push([m,n,w]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry;
 THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.TextGeometry=function(a,c){THREE.Geometry.call(this);this.parameters=c||{};this.set(a)};THREE.TextGeometry.prototype=new THREE.Geometry;THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
-THREE.TextGeometry.prototype.set=function(a,c){function b(a,b,c){v.vertices.push(new THREE.Vertex(new THREE.Vector3(a,b,c)))}function f(a,b,c,f){v.faces.push(new THREE.Face4(a,b,c,f))}this.text=a;var c=c||this.parameters,e=c.height!==void 0?c.height:50,g=c.curveSegments!==void 0?c.curveSegments:4,h=c.font!==void 0?c.font:"helvetiker",j=c.weight!==void 0?c.weight:"normal",k=c.style!==void 0?c.style:"normal",l=c.bezelThickness!==void 0?c.bezelThickness:10,m=c.bezelSize!==void 0?c.bezelSize:8,n=c.bezelEnabled!==
-void 0?c.bezelEnabled:!1;THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=g;THREE.FontUtils.face=h;THREE.FontUtils.weight=j;THREE.FontUtils.style=k;THREE.FontUtils.bezelSize=m;var j=THREE.FontUtils.drawText(a),g=j.points,o=j.faces,h=j.contour,p=j.bezel,v=this;v.vertices=[];v.faces=[];for(var w,k=g.length,x=o.length,m=p.length,j=0;j<k;j++)w=g[j],b(w.x,w.y,0);for(j=0;j<k;j++)w=g[j],b(w.x,w.y,e);if(n){for(j=0;j<m;j++)w=p[j],b(w.x,w.y,l);for(j=0;j<m;j++)w=p[j],b(w.x,w.y,e-l)}for(j=
-0;j<x;j++)e=o[j],v.faces.push(new THREE.Face3(e[2],e[1],e[0]));for(j=0;j<x;j++)e=o[j],v.faces.push(new THREE.Face3(e[0]+k,e[1]+k,e[2]+k));var y;if(n)for(j=p.length;--j>0;){if(y){if(y.equals(h[j])){y=null;continue}}else y=h[j];l=k*2+j;o=l-1;f(l,o,o+m,l+m);for(n=0;n<k;n++)if(g[n].equals(h[j]))break;for(e=0;e<k;e++)if(g[e].equals(h[j-1]))break;f(n,e,o,l);f(l+m,o+m,e+k,n+k)}else for(j=h.length;--j>0;){if(y){if(y.equals(h[j])){y=null;continue}}else y=h[j];for(n=0;n<k;n++)if(g[n].equals(h[j]))break;for(e=
+THREE.TextGeometry.prototype.set=function(a,c){function b(a,b,c){v.vertices.push(new THREE.Vertex(new THREE.Vector3(a,b,c)))}function f(a,b,c,f){v.faces.push(new THREE.Face4(a,b,c,f))}this.text=a;var c=c||this.parameters,e=c.height!==void 0?c.height:50,g=c.curveSegments!==void 0?c.curveSegments:4,h=c.font!==void 0?c.font:"helvetiker",j=c.weight!==void 0?c.weight:"normal",k=c.style!==void 0?c.style:"normal",l=c.bevelThickness!==void 0?c.bevelThickness:10,m=c.bevelSize!==void 0?c.bevelSize:8,n=c.bevelEnabled!==
+void 0?c.bevelEnabled:!1;THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=g;THREE.FontUtils.face=h;THREE.FontUtils.weight=j;THREE.FontUtils.style=k;THREE.FontUtils.bevelSize=m;var j=THREE.FontUtils.drawText(a),g=j.points,o=j.faces,h=j.contour,p=j.bevel,v=this;v.vertices=[];v.faces=[];for(var u,k=g.length,w=o.length,m=p.length,j=0;j<k;j++)u=g[j],b(u.x,u.y,0);for(j=0;j<k;j++)u=g[j],b(u.x,u.y,e);if(n){for(j=0;j<m;j++)u=p[j],b(u.x,u.y,l);for(j=0;j<m;j++)u=p[j],b(u.x,u.y,e-l)}for(j=
+0;j<w;j++)e=o[j],v.faces.push(new THREE.Face3(e[2],e[1],e[0]));for(j=0;j<w;j++)e=o[j],v.faces.push(new THREE.Face3(e[0]+k,e[1]+k,e[2]+k));var x;if(n)for(j=p.length;--j>0;){if(x){if(x.equals(h[j])){x=null;continue}}else x=h[j];l=k*2+j;o=l-1;f(l,o,o+m,l+m);for(n=0;n<k;n++)if(g[n].equals(h[j]))break;for(e=0;e<k;e++)if(g[e].equals(h[j-1]))break;f(n,e,o,l);f(l+m,o+m,e+k,n+k)}else for(j=h.length;--j>0;){if(x){if(x.equals(h[j])){x=null;continue}}else x=h[j];for(n=0;n<k;n++)if(g[n].equals(h[j]))break;for(e=
 0;e<k;e++)if(g[e].equals(h[j-1]))break;f(n,e,e+k,n+k)}this.computeCentroids();this.computeFaceNormals()};
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(a){var c=a.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][a.cssFontWeight]=this.faces[c][a.cssFontWeight]||{};this.faces[c][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[c][a.cssFontWeight][a.cssFontStyle]=a},extractPoints:function(a,c){if(a.length<3)return console.log("not valid polygon"),
 {points:a,faces:[]};for(var b,f,e,g,h,j=[],k=0;k<c.length;k++){h=c[k];g=[];for(b=0;b<h.length;b++)f=h[b],g.push(f.x+","+f.y);var l;b=g.slice(1).indexOf(g[0]);var m=this.Triangulate.area(h.slice(0,b+1))<0;f=[];for(b=-1;b<g.length;){l=b+1;b=g[l];b=g.slice(l+1).indexOf(b)+l;if(b<=l)break;var n=h.slice(l,b+1);m?this.Triangulate.area(n)<0?(l>0&&j.push({shape:e,holes:f}),e=n,f=[]):f.push(n):this.Triangulate.area(n)<0?(j.push({shape:n,holes:f}),f=[]):f.push(n);b++}m&&j.push({shape:e,holes:f})}var o,p,v,
-w,x,y;g=[];for(h=0;h<j.length;h++){k=j[h];e=k.shape;f=k.holes;for(l=0;l<f.length;l++){m=f[l];v=Number.POSITIVE_INFINITY;for(n=0;n<m.length;n++){x=m[n];for(b=0;b<e.length;b++)w=e[b],w=x.distanceTo(w),w<v&&(v=w,o=n,p=b)}b=p-1>=0?p-1:e.length-1;var n=o-1>=0?o-1:m.length-1,A=[];A.push(m[o]);A.push(e[p]);A.push(e[b]);v=this.Triangulate.area(A);var u=[];u.push(m[o]);u.push(m[n]);u.push(e[p]);x=this.Triangulate.area(u);w=p;y=o;p+=1;o+=-1;p<0&&(p+=e.length);p%=e.length;o<0&&(o+=m.length);o%=e.length;b=p-
-1>=0?p-1:e.length-1;n=o-1>=0?o-1:m.length-1;A=[];A.push(m[o]);A.push(e[p]);A.push(e[b]);A=this.Triangulate.area(A);u=[];u.push(m[o]);u.push(m[n]);u.push(e[p]);u=this.Triangulate.area(u);v+x>A+u&&(p=w,o=y,p<0&&(p+=e.length),p%=e.length,o<0&&(o+=m.length),o%=e.length,b=p-1>=0?p-1:e.length-1,n=o-1>=0?o-1:m.length-1);v=e.slice(0,p);x=e.slice(p);w=m.slice(o);y=m.slice(0,o);g.push(m[o]);g.push(e[p]);g.push(e[b]);g.push(m[o]);g.push(m[n]);g.push(e[p]);e=v.concat(w).concat(y).concat(x)}k.shape=e}o=[];p=[];
-for(h=l=0;h<j.length;h++){k=j[h];e=k.shape;o=o.concat(e);m=THREE.FontUtils.Triangulate(e,!0);for(f=0;f<m.length;f++)k=m[f],k[0]+=l,k[1]+=l,k[2]+=l;p=p.concat(m);l+=e.length}var B;for(f=0;f<g.length/3;f++){k=[];for(j=0;j<3;j++){h=!1;for(e=0;e<o.length&&!h;e++)B=f*3+j,o[e].equals(g[B])&&(k.push(e),h=!0);h||(o.push(g[B]),k.push(o.length-1),console.log("not found"))}p.push(k)}return{points:o,faces:p}},drawText:function(a){var c=[],b=[],f,e=this.getFace(),g=this.size/e.resolution,h=0;f=String(a).split("");
+u,w,x;g=[];for(h=0;h<j.length;h++){k=j[h];e=k.shape;f=k.holes;for(l=0;l<f.length;l++){m=f[l];v=Number.POSITIVE_INFINITY;for(n=0;n<m.length;n++){w=m[n];for(b=0;b<e.length;b++)u=e[b],u=w.distanceTo(u),u<v&&(v=u,o=n,p=b)}b=p-1>=0?p-1:e.length-1;var n=o-1>=0?o-1:m.length-1,y=[];y.push(m[o]);y.push(e[p]);y.push(e[b]);v=this.Triangulate.area(y);var t=[];t.push(m[o]);t.push(m[n]);t.push(e[p]);w=this.Triangulate.area(t);u=p;x=o;p+=1;o+=-1;p<0&&(p+=e.length);p%=e.length;o<0&&(o+=m.length);o%=e.length;b=p-
+1>=0?p-1:e.length-1;n=o-1>=0?o-1:m.length-1;y=[];y.push(m[o]);y.push(e[p]);y.push(e[b]);y=this.Triangulate.area(y);t=[];t.push(m[o]);t.push(m[n]);t.push(e[p]);t=this.Triangulate.area(t);v+w>y+t&&(p=u,o=x,p<0&&(p+=e.length),p%=e.length,o<0&&(o+=m.length),o%=e.length,b=p-1>=0?p-1:e.length-1,n=o-1>=0?o-1:m.length-1);v=e.slice(0,p);w=e.slice(p);u=m.slice(o);x=m.slice(0,o);g.push(m[o]);g.push(e[p]);g.push(e[b]);g.push(m[o]);g.push(m[n]);g.push(e[p]);e=v.concat(u).concat(x).concat(w)}k.shape=e}o=[];p=[];
+for(h=l=0;h<j.length;h++){k=j[h];e=k.shape;o=o.concat(e);m=THREE.FontUtils.Triangulate(e,!0);for(f=0;f<m.length;f++)k=m[f],k[0]+=l,k[1]+=l,k[2]+=l;p=p.concat(m);l+=e.length}var z;for(f=0;f<g.length/3;f++){k=[];for(j=0;j<3;j++){h=!1;for(e=0;e<o.length&&!h;e++)z=f*3+j,o[e].equals(g[z])&&(k.push(e),h=!0);h||(o.push(g[z]),k.push(o.length-1),console.log("not found"))}p.push(k)}return{points:o,faces:p}},drawText:function(a){var c=[],b=[],f,e=this.getFace(),g=this.size/e.resolution,h=0;f=String(a).split("");
 for(var j=f.length,k=new THREE.Path,a=0;a<j;a++){var l=this.extractGlyphPoints(f[a],e,g,h,k);h+=l.offset;c.push(l.points);b=b.concat(l.points)}console.log(k);a=h/2;for(f=0;f<b.length;f++)b[f].x-=a;c=this.extractPoints(b,c);c.contour=b;e=[];g=[];f=[];for(var h=[],j=new THREE.Vector2,m,a=b.length;--a>=0;){if(m){if(m.equals(b[a])){m=null;k=this.Triangulate.area(f)>0;h.push(k);g.push(j.divideScalar(f.length));f=[];j=new THREE.Vector2;continue}}else m=b[a];j.addSelf(b[a]);f.push(b[a])}a=b.length;for(f=
-0;--a>=0;)k=b[a],j=g[f],k=k.clone().subSelf(j),l=this.bezelSize/k.length(),h[f]?l+=1:l=1-l,l=k.multiplyScalar(l).addSelf(j),e.unshift(l),m?m.equals(b[a])&&(m=null,f++):m=b[a];c.bezel=e;return c},b2p0:function(a,c){var b=1-a;return b*b*c},b2p1:function(a,c){return 2*(1-a)*a*c},b2p2:function(a,c){return a*a*c},b2:function(a,c,b,f){return this.b2p0(a,c)+this.b2p1(a,b)+this.b2p2(a,f)},b3p0:function(a,c){var b=1-a;return b*b*b*c},b3p1:function(a,c){var b=1-a;return 3*b*b*a*c},b3p2:function(a,c){return 3*
-(1-a)*a*a*c},b3p3:function(a,c){return a*a*a*c},b3:function(a,c,b,f,e){return this.b3p0(a,c)+this.b3p1(a,b)+this.b3p2(a,f)+this.b3p3(a,e)},extractGlyphPoints:function(a,c,b,f,e){var g=[],h,j,k,l,m,n,o,p,v,w,x=c.glyphs[a]||c.glyphs[ctxt.options.fallbackCharacter];if(x){if(x.o){c=x._cachedOutline||(x._cachedOutline=x.o.split(" "));k=c.length;for(a=0;a<k;)switch(j=c[a++],j){case "m":j=c[a++]*b+f;l=c[a++]*b;g.push(new THREE.Vector2(j,l));e.moveTo(j,l);break;case "l":j=c[a++]*b+f;l=c[a++]*b;g.push(new THREE.Vector2(j,
-l));e.lineTo(j,l);break;case "q":j=c[a++]*b+f;l=c[a++]*b;o=c[a++]*b+f;p=c[a++]*b;e.quadraticCurveTo(o,p,j,l);if(h=g[g.length-1]){m=h.x;n=h.y;h=1;for(divisions=this.divisions;h<=divisions;h++){var y=h/divisions,A=THREE.FontUtils.b2(y,m,o,j),y=THREE.FontUtils.b2(y,n,p,l);g.push(new THREE.Vector2(A,y))}}break;case "b":if(j=c[a++]*b+f,l=c[a++]*b,o=c[a++]*b+f,p=c[a++]*-b,v=c[a++]*b+f,w=c[a++]*-b,e.bezierCurveTo(j,l,o,p,v,w),h=g[g.length-1]){m=h.x;n=h.y;h=1;for(divisions=this.divisions;h<=divisions;h++)y=
-h/divisions,A=THREE.FontUtils.b3(y,m,o,v,j),y=THREE.FontUtils.b3(y,n,p,w,l),g.push(new THREE.Vector2(A,y))}}}return{offset:x.ha*b,points:g,path:e}}}};
-(function(a){var c=function(a){for(var c=a.length,e=0,g=c-1,h=0;h<c;g=h++)e+=a[g].x*a[h].y-a[h].x*a[g].y;return e*0.5};a.Triangulate=function(a,f){var e=a.length;if(e<3)return null;var g=[],h=[],j=[],k,l,m;if(c(a)>0)for(l=0;l<e;l++)h[l]=l;else for(l=0;l<e;l++)h[l]=e-1-l;var n=2*e;for(l=e-1;e>2;){if(n--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return j;return g}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);m=l+1;e<=m&&(m=0);var o;a:{o=a;var p=k,v=l,w=m,x=e,y=h,A=void 0,u=void 0,B=void 0,
-C=void 0,H=void 0,J=void 0,K=void 0,I=void 0,D=void 0,u=o[y[p]].x,B=o[y[p]].y,C=o[y[v]].x,H=o[y[v]].y,J=o[y[w]].x,K=o[y[w]].y;if(1.0E-10>(C-u)*(K-B)-(H-B)*(J-u))o=!1;else{for(A=0;A<x;A++)if(!(A==p||A==v||A==w)){var I=o[y[A]].x,D=o[y[A]].y,G=void 0,F=void 0,L=void 0,N=void 0,M=void 0,O=void 0,Q=void 0,E=void 0,R=void 0,P=void 0,T=void 0,U=void 0,G=L=M=void 0,G=J-C,F=K-H,L=u-J,N=B-K,M=C-u,O=H-B,Q=I-u,E=D-B,R=I-C,P=D-H,T=I-J,U=D-K,G=G*P-F*R,M=M*E-O*Q,L=L*U-N*T;if(G>=0&&L>=0&&M>=0){o=!1;break a}}o=!0}}if(o){g.push([a[h[k]],
+0;--a>=0;)k=b[a],j=g[f],k=k.clone().subSelf(j),l=this.bevelSize/k.length(),h[f]?l+=1:l=1-l,l=k.multiplyScalar(l).addSelf(j),e.unshift(l),m?m.equals(b[a])&&(m=null,f++):m=b[a];c.bevel=e;return c},b2p0:function(a,c){var b=1-a;return b*b*c},b2p1:function(a,c){return 2*(1-a)*a*c},b2p2:function(a,c){return a*a*c},b2:function(a,c,b,f){return this.b2p0(a,c)+this.b2p1(a,b)+this.b2p2(a,f)},b3p0:function(a,c){var b=1-a;return b*b*b*c},b3p1:function(a,c){var b=1-a;return 3*b*b*a*c},b3p2:function(a,c){return 3*
+(1-a)*a*a*c},b3p3:function(a,c){return a*a*a*c},b3:function(a,c,b,f,e){return this.b3p0(a,c)+this.b3p1(a,b)+this.b3p2(a,f)+this.b3p3(a,e)},extractGlyphPoints:function(a,c,b,f,e){var g=[],h,j,k,l,m,n,o,p,v,u,w=c.glyphs[a]||c.glyphs[ctxt.options.fallbackCharacter];if(w){if(w.o){c=w._cachedOutline||(w._cachedOutline=w.o.split(" "));k=c.length;for(a=0;a<k;)switch(j=c[a++],j){case "m":j=c[a++]*b+f;l=c[a++]*b;g.push(new THREE.Vector2(j,l));e.moveTo(j,l);break;case "l":j=c[a++]*b+f;l=c[a++]*b;g.push(new THREE.Vector2(j,
+l));e.lineTo(j,l);break;case "q":j=c[a++]*b+f;l=c[a++]*b;o=c[a++]*b+f;p=c[a++]*b;e.quadraticCurveTo(o,p,j,l);if(h=g[g.length-1]){m=h.x;n=h.y;h=1;for(divisions=this.divisions;h<=divisions;h++){var x=h/divisions,y=THREE.FontUtils.b2(x,m,o,j),x=THREE.FontUtils.b2(x,n,p,l);g.push(new THREE.Vector2(y,x))}}break;case "b":if(j=c[a++]*b+f,l=c[a++]*b,o=c[a++]*b+f,p=c[a++]*-b,v=c[a++]*b+f,u=c[a++]*-b,e.bezierCurveTo(j,l,o,p,v,u),h=g[g.length-1]){m=h.x;n=h.y;h=1;for(divisions=this.divisions;h<=divisions;h++)x=
+h/divisions,y=THREE.FontUtils.b3(x,m,o,v,j),x=THREE.FontUtils.b3(x,n,p,u,l),g.push(new THREE.Vector2(y,x))}}}return{offset:w.ha*b,points:g,path:e}}}};
+(function(a){var c=function(a){for(var c=a.length,e=0,g=c-1,h=0;h<c;g=h++)e+=a[g].x*a[h].y-a[h].x*a[g].y;return e*0.5};a.Triangulate=function(a,f){var e=a.length;if(e<3)return null;var g=[],h=[],j=[],k,l,m;if(c(a)>0)for(l=0;l<e;l++)h[l]=l;else for(l=0;l<e;l++)h[l]=e-1-l;var n=2*e;for(l=e-1;e>2;){if(n--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return j;return g}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);m=l+1;e<=m&&(m=0);var o;a:{o=a;var p=k,v=l,u=m,w=e,x=h,y=void 0,t=void 0,z=void 0,
+B=void 0,A=void 0,E=void 0,G=void 0,H=void 0,L=void 0,t=o[x[p]].x,z=o[x[p]].y,B=o[x[v]].x,A=o[x[v]].y,E=o[x[u]].x,G=o[x[u]].y;if(1.0E-10>(B-t)*(G-z)-(A-z)*(E-t))o=!1;else{for(y=0;y<w;y++)if(!(y==p||y==v||y==u)){var H=o[x[y]].x,L=o[x[y]].y,J=void 0,D=void 0,K=void 0,F=void 0,I=void 0,O=void 0,M=void 0,C=void 0,P=void 0,N=void 0,R=void 0,S=void 0,J=K=I=void 0,J=E-B,D=G-A,K=t-E,F=z-G,I=B-t,O=A-z,M=H-t,C=L-z,P=H-B,N=L-A,R=H-E,S=L-G,J=J*N-D*P,I=I*C-O*M,K=K*S-F*R;if(J>=0&&K>=0&&I>=0){o=!1;break a}}o=!0}}if(o){g.push([a[h[k]],
 a[h[l]],a[h[m]]]);j.push([h[k],h[l],h[m]]);k=l;for(m=l+1;m<e;k++,m++)h[k]=h[m];e--;n=2*e}}if(f)return j;return g};a.Triangulate.area=c;return a})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
 THREE.TorusGeometry=function(a,c,b,f){THREE.Geometry.call(this);this.radius=a||100;this.tube=c||40;this.segmentsR=b||8;this.segmentsT=f||6;a=[];for(c=0;c<=this.segmentsR;++c)for(b=0;b<=this.segmentsT;++b){var f=b/this.segmentsT*2*Math.PI,e=c/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(e))*Math.cos(f),(this.radius+this.tube*Math.cos(e))*Math.sin(f),this.tube*Math.sin(e))));a.push([b/this.segmentsT,1-c/this.segmentsR])}for(c=1;c<=this.segmentsR;++c)for(b=
 1;b<=this.segmentsT;++b){var f=(this.segmentsT+1)*c+b,e=(this.segmentsT+1)*c+b-1,g=(this.segmentsT+1)*(c-1)+b-1,h=(this.segmentsT+1)*(c-1)+b;this.faces.push(new THREE.Face4(f,e,g,h));this.faceVertexUvs[0].push([new THREE.UV(a[f][0],a[f][1]),new THREE.UV(a[e][0],a[e][1]),new THREE.UV(a[g][0],a[g][1]),new THREE.UV(a[h][0],a[h][1])])}delete a;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusGeometry.prototype=new THREE.Geometry;
@@ -164,52 +164,52 @@ else if(a.DbgColor)h.color=a.DbgColor;if(a.colorSpecular)h.specular=g(a.colorSpe
 a.mapSpecular&&c&&e(h,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap);if(a.mapNormal){var l=THREE.ShaderUtils.lib.normal,m=THREE.UniformsUtils.clone(l.uniforms),n=h.color;j=h.specular;k=h.ambient;var o=h.shininess;m.tNormal.texture=h.normalMap;if(a.mapNormalFactor)m.uNormalScale.value=a.mapNormalFactor;if(h.map)m.tDiffuse.texture=h.map,m.enableDiffuse.value=!0;if(h.specularMap)m.tSpecular.texture=h.specularMap,m.enableSpecular.value=!0;if(h.lightMap)m.tAO.texture=
 h.lightMap,m.enableAO.value=!0;m.uDiffuseColor.value.setHex(n);m.uSpecularColor.value.setHex(j);m.uAmbientColor.value.setHex(k);m.uShininess.value=o;if(h.opacity)m.uOpacity.value=h.opacity;h=new THREE.MeshShaderMaterial({fragmentShader:l.fragmentShader,vertexShader:l.vertexShader,uniforms:m,lights:!0,fog:!0})}else h=new THREE[j](h);return h}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;
 THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;THREE.JSONLoader.prototype.load=function(a){var c=this,b=a.model,f=a.callback,e=a.texture_path?a.texture_path:this.extractUrlbase(b),a=new Worker(b);a.onmessage=function(a){c.createModel(a.data,f,e);c.onLoadComplete()};this.onLoadStart();a.postMessage((new Date).getTime())};
-THREE.JSONLoader.prototype.createModel=function(a,c,b){var f=new THREE.Geometry,e=a.scale!==void 0?1/a.scale:1;this.init_materials(f,a.materials,b);(function(b){if(a.version===void 0||a.version!=2)console.error("Deprecated file format.");else{var c,e,k,l,m,n,o,p,v,w,x,y,A,u,B=a.faces;n=a.vertices;var C=a.normals,H=a.colors,J=0;for(c=0;c<a.uvs.length;c++)a.uvs[c].length&&J++;for(c=0;c<J;c++)f.faceUvs[c]=[],f.faceVertexUvs[c]=[];l=0;for(m=n.length;l<m;)o=new THREE.Vertex,o.position.x=n[l++]*b,o.position.y=
-n[l++]*b,o.position.z=n[l++]*b,f.vertices.push(o);l=0;for(m=B.length;l<m;){b=B[l++];n=b&1;k=b&2;c=b&4;e=b&8;p=b&16;o=b&32;w=b&64;b&=128;n?(x=new THREE.Face4,x.a=B[l++],x.b=B[l++],x.c=B[l++],x.d=B[l++],n=4):(x=new THREE.Face3,x.a=B[l++],x.b=B[l++],x.c=B[l++],n=3);if(k)k=B[l++],x.materials=f.materials[k];k=f.faces.length;if(c)for(c=0;c<J;c++)y=a.uvs[c],v=B[l++],u=y[v*2],v=y[v*2+1],f.faceUvs[c][k]=new THREE.UV(u,v);if(e)for(c=0;c<J;c++){y=a.uvs[c];A=[];for(e=0;e<n;e++)v=B[l++],u=y[v*2],v=y[v*2+1],A[e]=
-new THREE.UV(u,v);f.faceVertexUvs[c][k]=A}if(p)p=B[l++]*3,e=new THREE.Vector3,e.x=C[p++],e.y=C[p++],e.z=C[p],x.normal=e;if(o)for(c=0;c<n;c++)p=B[l++]*3,e=new THREE.Vector3,e.x=C[p++],e.y=C[p++],e.z=C[p],x.vertexNormals.push(e);if(w)o=B[l++],o=new THREE.Color(H[o]),x.color=o;if(b)for(c=0;c<n;c++)o=B[l++],o=new THREE.Color(H[o]),x.vertexColors.push(o);f.faces.push(x)}}})(e);(function(){var b,c,e,k;if(a.skinWeights){b=0;for(c=a.skinWeights.length;b<c;b+=2)e=a.skinWeights[b],k=a.skinWeights[b+1],f.skinWeights.push(new THREE.Vector4(e,
+THREE.JSONLoader.prototype.createModel=function(a,c,b){var f=new THREE.Geometry,e=a.scale!==void 0?1/a.scale:1;this.init_materials(f,a.materials,b);(function(b){if(a.version===void 0||a.version!=2)console.error("Deprecated file format.");else{var c,e,k,l,m,n,o,p,v,u,w,x,y,t,z=a.faces;n=a.vertices;var B=a.normals,A=a.colors,E=0;for(c=0;c<a.uvs.length;c++)a.uvs[c].length&&E++;for(c=0;c<E;c++)f.faceUvs[c]=[],f.faceVertexUvs[c]=[];l=0;for(m=n.length;l<m;)o=new THREE.Vertex,o.position.x=n[l++]*b,o.position.y=
+n[l++]*b,o.position.z=n[l++]*b,f.vertices.push(o);l=0;for(m=z.length;l<m;){b=z[l++];n=b&1;k=b&2;c=b&4;e=b&8;p=b&16;o=b&32;u=b&64;b&=128;n?(w=new THREE.Face4,w.a=z[l++],w.b=z[l++],w.c=z[l++],w.d=z[l++],n=4):(w=new THREE.Face3,w.a=z[l++],w.b=z[l++],w.c=z[l++],n=3);if(k)k=z[l++],w.materials=f.materials[k];k=f.faces.length;if(c)for(c=0;c<E;c++)x=a.uvs[c],v=z[l++],t=x[v*2],v=x[v*2+1],f.faceUvs[c][k]=new THREE.UV(t,v);if(e)for(c=0;c<E;c++){x=a.uvs[c];y=[];for(e=0;e<n;e++)v=z[l++],t=x[v*2],v=x[v*2+1],y[e]=
+new THREE.UV(t,v);f.faceVertexUvs[c][k]=y}if(p)p=z[l++]*3,e=new THREE.Vector3,e.x=B[p++],e.y=B[p++],e.z=B[p],w.normal=e;if(o)for(c=0;c<n;c++)p=z[l++]*3,e=new THREE.Vector3,e.x=B[p++],e.y=B[p++],e.z=B[p],w.vertexNormals.push(e);if(u)o=z[l++],o=new THREE.Color(A[o]),w.color=o;if(b)for(c=0;c<n;c++)o=z[l++],o=new THREE.Color(A[o]),w.vertexColors.push(o);f.faces.push(w)}}})(e);(function(){var b,c,e,k;if(a.skinWeights){b=0;for(c=a.skinWeights.length;b<c;b+=2)e=a.skinWeights[b],k=a.skinWeights[b+1],f.skinWeights.push(new THREE.Vector4(e,
 k,0,0))}if(a.skinIndices){b=0;for(c=a.skinIndices.length;b<c;b+=2)e=a.skinIndices[b],k=a.skinIndices[b+1],f.skinIndices.push(new THREE.Vector4(e,k,0,0))}f.bones=a.bones;f.animation=a.animation})();(function(b){if(a.morphTargets!==void 0){var c,e,k,l,m,n,o,p,v;c=0;for(e=a.morphTargets.length;c<e;c++){f.morphTargets[c]={};f.morphTargets[c].name=a.morphTargets[c].name;f.morphTargets[c].vertices=[];p=f.morphTargets[c].vertices;v=a.morphTargets[c].vertices;k=0;for(l=v.length;k<l;k+=3)m=v[k]*b,n=v[k+1]*
 b,o=v[k+2]*b,p.push(new THREE.Vertex(new THREE.Vector3(m,n,o)))}}if(a.morphColors!==void 0){c=0;for(e=a.morphColors.length;c<e;c++){f.morphColors[c]={};f.morphColors[c].name=a.morphColors[c].name;f.morphColors[c].colors=[];l=f.morphColors[c].colors;m=a.morphColors[c].colors;b=0;for(k=m.length;b<k;b+=3)n=new THREE.Color(16755200),n.setRGB(m[b],m[b+1],m[b+2]),l.push(n)}}})(e);(function(){if(a.edges!==void 0){var b,c,e;for(b=0;b<a.edges.length;b+=2)c=a.edges[b],e=a.edges[b+1],f.edges.push(new THREE.Edge(f.vertices[c],
 f.vertices[e],c,e))}})();f.computeCentroids();f.computeFaceNormals();this.hasNormals(f)&&f.computeTangents();c(f)};THREE.BinaryLoader=function(a){THREE.Loader.call(this,a)};THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
 THREE.BinaryLoader.prototype={load:function(a){var c=a.model,b=a.callback,f=a.texture_path?a.texture_path:THREE.Loader.prototype.extractUrlbase(c),e=a.bin_path?a.bin_path:THREE.Loader.prototype.extractUrlbase(c),a=(new Date).getTime(),c=new Worker(c),g=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(a){THREE.BinaryLoader.prototype.loadAjaxBuffers(a.data.buffers,a.data.materials,b,e,f,g)};c.onerror=function(a){alert("worker.onerror: "+a.message+"\n"+a.data);a.preventDefault()};
 c.postMessage(a)},loadAjaxBuffers:function(a,c,b,f,e,g){var h=new XMLHttpRequest,j=f+"/"+a,k=0;h.onreadystatechange=function(){h.readyState==4?h.status==200||h.status==0?THREE.BinaryLoader.prototype.createBinModel(h.responseText,b,e,c):alert("Couldn't load ["+j+"] ["+h.status+"]"):h.readyState==3?g&&(k==0&&(k=h.getResponseHeader("Content-Length")),g({total:k,loaded:h.responseText.length})):h.readyState==2&&(k=h.getResponseHeader("Content-Length"))};h.open("GET",j,!0);h.overrideMimeType("text/plain; charset=x-user-defined");
 h.setRequestHeader("Content-Type","text/plain");h.send(null)},createBinModel:function(a,c,b,f){var e=function(b){function c(a,b){var f=m(a,b),e=m(a,b+1),g=m(a,b+2),h=m(a,b+3),j=(h<<1&255|g>>7)-127;f|=(g&127)<<16|e<<8;if(f==0&&j==-127)return 0;return(1-2*(h>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,j)}function e(a,b){var c=m(a,b),f=m(a,b+1),g=m(a,b+2);return(m(a,b+3)<<24)+(g<<16)+(f<<8)+c}function k(a,b){var c=m(a,b);return(m(a,b+1)<<8)+c}function l(a,b){var c=m(a,b);return c>127?c-256:c}function m(a,
-b){return a.charCodeAt(b)&255}function n(b){var c,f,g;c=e(a,b);f=e(a,b+H);g=e(a,b+J);b=k(a,b+K);THREE.BinaryLoader.prototype.f3(y,c,f,g,b)}function o(b){var c,f,g,h,l,m;c=e(a,b);f=e(a,b+H);g=e(a,b+J);h=k(a,b+K);l=e(a,b+I);m=e(a,b+D);b=e(a,b+G);THREE.BinaryLoader.prototype.f3n(y,B,c,f,g,h,l,m,b)}function p(b){var c,f,g,h;c=e(a,b);f=e(a,b+F);g=e(a,b+L);h=e(a,b+N);b=k(a,b+M);THREE.BinaryLoader.prototype.f4(y,c,f,g,h,b)}function v(b){var c,f,g,h,l,m,n,o;c=e(a,b);f=e(a,b+F);g=e(a,b+L);h=e(a,b+N);l=k(a,
-b+M);m=e(a,b+O);n=e(a,b+Q);o=e(a,b+E);b=e(a,b+R);THREE.BinaryLoader.prototype.f4n(y,B,c,f,g,h,l,m,n,o,b)}function w(b){var c,f;c=e(a,b);f=e(a,b+P);b=e(a,b+T);THREE.BinaryLoader.prototype.uv3(y.faceVertexUvs[0],C[c*2],C[c*2+1],C[f*2],C[f*2+1],C[b*2],C[b*2+1])}function x(b){var c,f,g;c=e(a,b);f=e(a,b+U);g=e(a,b+$);b=e(a,b+aa);THREE.BinaryLoader.prototype.uv4(y.faceVertexUvs[0],C[c*2],C[c*2+1],C[f*2],C[f*2+1],C[g*2],C[g*2+1],C[b*2],C[b*2+1])}var y=this,A=0,u,B=[],C=[],H,J,K,I,D,G,F,L,N,M,O,Q,E,R,P,T,
-U,$,aa,V,W,X,Y,Z,S;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(y,f,b);u={signature:a.substr(A,8),header_bytes:m(a,A+8),vertex_coordinate_bytes:m(a,A+9),normal_coordinate_bytes:m(a,A+10),uv_coordinate_bytes:m(a,A+11),vertex_index_bytes:m(a,A+12),normal_index_bytes:m(a,A+13),uv_index_bytes:m(a,A+14),material_index_bytes:m(a,A+15),nvertices:e(a,A+16),nnormals:e(a,A+16+4),nuvs:e(a,A+16+8),ntri_flat:e(a,A+16+12),ntri_smooth:e(a,A+16+16),ntri_flat_uv:e(a,A+16+20),ntri_smooth_uv:e(a,
-A+16+24),nquad_flat:e(a,A+16+28),nquad_smooth:e(a,A+16+32),nquad_flat_uv:e(a,A+16+36),nquad_smooth_uv:e(a,A+16+40)};A+=u.header_bytes;H=u.vertex_index_bytes;J=u.vertex_index_bytes*2;K=u.vertex_index_bytes*3;I=u.vertex_index_bytes*3+u.material_index_bytes;D=u.vertex_index_bytes*3+u.material_index_bytes+u.normal_index_bytes;G=u.vertex_index_bytes*3+u.material_index_bytes+u.normal_index_bytes*2;F=u.vertex_index_bytes;L=u.vertex_index_bytes*2;N=u.vertex_index_bytes*3;M=u.vertex_index_bytes*4;O=u.vertex_index_bytes*
-4+u.material_index_bytes;Q=u.vertex_index_bytes*4+u.material_index_bytes+u.normal_index_bytes;E=u.vertex_index_bytes*4+u.material_index_bytes+u.normal_index_bytes*2;R=u.vertex_index_bytes*4+u.material_index_bytes+u.normal_index_bytes*3;P=u.uv_index_bytes;T=u.uv_index_bytes*2;U=u.uv_index_bytes;$=u.uv_index_bytes*2;aa=u.uv_index_bytes*3;b=u.vertex_index_bytes*3+u.material_index_bytes;S=u.vertex_index_bytes*4+u.material_index_bytes;V=u.ntri_flat*b;W=u.ntri_smooth*(b+u.normal_index_bytes*3);X=u.ntri_flat_uv*
-(b+u.uv_index_bytes*3);Y=u.ntri_smooth_uv*(b+u.normal_index_bytes*3+u.uv_index_bytes*3);Z=u.nquad_flat*S;b=u.nquad_smooth*(S+u.normal_index_bytes*4);S=u.nquad_flat_uv*(S+u.uv_index_bytes*4);A+=function(b){for(var f,e,g,j=u.vertex_coordinate_bytes*3,k=b+u.nvertices*j;b<k;b+=j)f=c(a,b),e=c(a,b+u.vertex_coordinate_bytes),g=c(a,b+u.vertex_coordinate_bytes*2),THREE.BinaryLoader.prototype.v(y,f,e,g);return u.nvertices*j}(A);A+=function(b){for(var c,f,e,g=u.normal_coordinate_bytes*3,h=b+u.nnormals*g;b<h;b+=
-g)c=l(a,b),f=l(a,b+u.normal_coordinate_bytes),e=l(a,b+u.normal_coordinate_bytes*2),B.push(c/127,f/127,e/127);return u.nnormals*g}(A);A+=function(b){for(var f,e,g=u.uv_coordinate_bytes*2,j=b+u.nuvs*g;b<j;b+=g)f=c(a,b),e=c(a,b+u.uv_coordinate_bytes),C.push(f,e);return u.nuvs*g}(A);V=A+V;W=V+W;X=W+X;Y=X+Y;Z=Y+Z;b=Z+b;S=b+S;(function(a){var b,c=u.vertex_index_bytes*3+u.material_index_bytes,f=c+u.uv_index_bytes*3,e=a+u.ntri_flat_uv*f;for(b=a;b<e;b+=f)n(b),w(b+c);return e-a})(W);(function(a){var b,c=u.vertex_index_bytes*
-3+u.material_index_bytes+u.normal_index_bytes*3,f=c+u.uv_index_bytes*3,e=a+u.ntri_smooth_uv*f;for(b=a;b<e;b+=f)o(b),w(b+c);return e-a})(X);(function(a){var b,c=u.vertex_index_bytes*4+u.material_index_bytes,f=c+u.uv_index_bytes*4,e=a+u.nquad_flat_uv*f;for(b=a;b<e;b+=f)p(b),x(b+c);return e-a})(b);(function(a){var b,c=u.vertex_index_bytes*4+u.material_index_bytes+u.normal_index_bytes*4,f=c+u.uv_index_bytes*4,e=a+u.nquad_smooth_uv*f;for(b=a;b<e;b+=f)v(b),x(b+c);return e-a})(S);(function(a){var b,c=u.vertex_index_bytes*
-3+u.material_index_bytes,f=a+u.ntri_flat*c;for(b=a;b<f;b+=c)n(b);return f-a})(A);(function(a){var b,c=u.vertex_index_bytes*3+u.material_index_bytes+u.normal_index_bytes*3,f=a+u.ntri_smooth*c;for(b=a;b<f;b+=c)o(b);return f-a})(V);(function(a){var b,c=u.vertex_index_bytes*4+u.material_index_bytes,f=a+u.nquad_flat*c;for(b=a;b<f;b+=c)p(b);return f-a})(Y);(function(a){var b,c=u.vertex_index_bytes*4+u.material_index_bytes+u.normal_index_bytes*4,f=a+u.nquad_smooth*c;for(b=a;b<f;b+=c)v(b);return f-a})(Z);
+b){return a.charCodeAt(b)&255}function n(b){var c,f,g;c=e(a,b);f=e(a,b+A);g=e(a,b+E);b=k(a,b+G);THREE.BinaryLoader.prototype.f3(x,c,f,g,b)}function o(b){var c,f,g,h,l,m;c=e(a,b);f=e(a,b+A);g=e(a,b+E);h=k(a,b+G);l=e(a,b+H);m=e(a,b+L);b=e(a,b+J);THREE.BinaryLoader.prototype.f3n(x,z,c,f,g,h,l,m,b)}function p(b){var c,f,g,h;c=e(a,b);f=e(a,b+D);g=e(a,b+K);h=e(a,b+F);b=k(a,b+I);THREE.BinaryLoader.prototype.f4(x,c,f,g,h,b)}function v(b){var c,f,g,h,l,m,n,o;c=e(a,b);f=e(a,b+D);g=e(a,b+K);h=e(a,b+F);l=k(a,
+b+I);m=e(a,b+O);n=e(a,b+M);o=e(a,b+C);b=e(a,b+P);THREE.BinaryLoader.prototype.f4n(x,z,c,f,g,h,l,m,n,o,b)}function u(b){var c,f;c=e(a,b);f=e(a,b+N);b=e(a,b+R);THREE.BinaryLoader.prototype.uv3(x.faceVertexUvs[0],B[c*2],B[c*2+1],B[f*2],B[f*2+1],B[b*2],B[b*2+1])}function w(b){var c,f,g;c=e(a,b);f=e(a,b+S);g=e(a,b+Y);b=e(a,b+Z);THREE.BinaryLoader.prototype.uv4(x.faceVertexUvs[0],B[c*2],B[c*2+1],B[f*2],B[f*2+1],B[g*2],B[g*2+1],B[b*2],B[b*2+1])}var x=this,y=0,t,z=[],B=[],A,E,G,H,L,J,D,K,F,I,O,M,C,P,N,R,
+S,Y,Z,T,U,V,W,X,Q;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(x,f,b);t={signature:a.substr(y,8),header_bytes:m(a,y+8),vertex_coordinate_bytes:m(a,y+9),normal_coordinate_bytes:m(a,y+10),uv_coordinate_bytes:m(a,y+11),vertex_index_bytes:m(a,y+12),normal_index_bytes:m(a,y+13),uv_index_bytes:m(a,y+14),material_index_bytes:m(a,y+15),nvertices:e(a,y+16),nnormals:e(a,y+16+4),nuvs:e(a,y+16+8),ntri_flat:e(a,y+16+12),ntri_smooth:e(a,y+16+16),ntri_flat_uv:e(a,y+16+20),ntri_smooth_uv:e(a,y+
+16+24),nquad_flat:e(a,y+16+28),nquad_smooth:e(a,y+16+32),nquad_flat_uv:e(a,y+16+36),nquad_smooth_uv:e(a,y+16+40)};y+=t.header_bytes;A=t.vertex_index_bytes;E=t.vertex_index_bytes*2;G=t.vertex_index_bytes*3;H=t.vertex_index_bytes*3+t.material_index_bytes;L=t.vertex_index_bytes*3+t.material_index_bytes+t.normal_index_bytes;J=t.vertex_index_bytes*3+t.material_index_bytes+t.normal_index_bytes*2;D=t.vertex_index_bytes;K=t.vertex_index_bytes*2;F=t.vertex_index_bytes*3;I=t.vertex_index_bytes*4;O=t.vertex_index_bytes*
+4+t.material_index_bytes;M=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes;C=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes*2;P=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes*3;N=t.uv_index_bytes;R=t.uv_index_bytes*2;S=t.uv_index_bytes;Y=t.uv_index_bytes*2;Z=t.uv_index_bytes*3;b=t.vertex_index_bytes*3+t.material_index_bytes;Q=t.vertex_index_bytes*4+t.material_index_bytes;T=t.ntri_flat*b;U=t.ntri_smooth*(b+t.normal_index_bytes*3);V=t.ntri_flat_uv*
+(b+t.uv_index_bytes*3);W=t.ntri_smooth_uv*(b+t.normal_index_bytes*3+t.uv_index_bytes*3);X=t.nquad_flat*Q;b=t.nquad_smooth*(Q+t.normal_index_bytes*4);Q=t.nquad_flat_uv*(Q+t.uv_index_bytes*4);y+=function(b){for(var f,e,g,j=t.vertex_coordinate_bytes*3,k=b+t.nvertices*j;b<k;b+=j)f=c(a,b),e=c(a,b+t.vertex_coordinate_bytes),g=c(a,b+t.vertex_coordinate_bytes*2),THREE.BinaryLoader.prototype.v(x,f,e,g);return t.nvertices*j}(y);y+=function(b){for(var c,f,e,g=t.normal_coordinate_bytes*3,h=b+t.nnormals*g;b<h;b+=
+g)c=l(a,b),f=l(a,b+t.normal_coordinate_bytes),e=l(a,b+t.normal_coordinate_bytes*2),z.push(c/127,f/127,e/127);return t.nnormals*g}(y);y+=function(b){for(var f,e,g=t.uv_coordinate_bytes*2,j=b+t.nuvs*g;b<j;b+=g)f=c(a,b),e=c(a,b+t.uv_coordinate_bytes),B.push(f,e);return t.nuvs*g}(y);T=y+T;U=T+U;V=U+V;W=V+W;X=W+X;b=X+b;Q=b+Q;(function(a){var b,c=t.vertex_index_bytes*3+t.material_index_bytes,f=c+t.uv_index_bytes*3,e=a+t.ntri_flat_uv*f;for(b=a;b<e;b+=f)n(b),u(b+c);return e-a})(U);(function(a){var b,c=t.vertex_index_bytes*
+3+t.material_index_bytes+t.normal_index_bytes*3,f=c+t.uv_index_bytes*3,e=a+t.ntri_smooth_uv*f;for(b=a;b<e;b+=f)o(b),u(b+c);return e-a})(V);(function(a){var b,c=t.vertex_index_bytes*4+t.material_index_bytes,f=c+t.uv_index_bytes*4,e=a+t.nquad_flat_uv*f;for(b=a;b<e;b+=f)p(b),w(b+c);return e-a})(b);(function(a){var b,c=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes*4,f=c+t.uv_index_bytes*4,e=a+t.nquad_smooth_uv*f;for(b=a;b<e;b+=f)v(b),w(b+c);return e-a})(Q);(function(a){var b,c=t.vertex_index_bytes*
+3+t.material_index_bytes,f=a+t.ntri_flat*c;for(b=a;b<f;b+=c)n(b);return f-a})(y);(function(a){var b,c=t.vertex_index_bytes*3+t.material_index_bytes+t.normal_index_bytes*3,f=a+t.ntri_smooth*c;for(b=a;b<f;b+=c)o(b);return f-a})(T);(function(a){var b,c=t.vertex_index_bytes*4+t.material_index_bytes,f=a+t.nquad_flat*c;for(b=a;b<f;b+=c)p(b);return f-a})(W);(function(a){var b,c=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes*4,f=a+t.nquad_smooth*c;for(b=a;b<f;b+=c)v(b);return f-a})(X);
 this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};e.prototype=new THREE.Geometry;e.prototype.constructor=e;c(new e(b))},v:function(a,c,b,f){a.vertices.push(new THREE.Vertex(new THREE.Vector3(c,b,f)))},f3:function(a,c,b,f,e){a.faces.push(new THREE.Face3(c,b,f,null,null,a.materials[e]))},f4:function(a,c,b,f,e,g){a.faces.push(new THREE.Face4(c,b,f,e,null,null,a.materials[g]))},f3n:function(a,c,b,f,e,g,h,j,k){var g=a.materials[g],l=c[j*
-3],m=c[j*3+1],j=c[j*3+2],n=c[k*3],o=c[k*3+1],k=c[k*3+2];a.faces.push(new THREE.Face3(b,f,e,[new THREE.Vector3(c[h*3],c[h*3+1],c[h*3+2]),new THREE.Vector3(l,m,j),new THREE.Vector3(n,o,k)],null,g))},f4n:function(a,c,b,f,e,g,h,j,k,l,m){var h=a.materials[h],n=c[k*3],o=c[k*3+1],k=c[k*3+2],p=c[l*3],v=c[l*3+1],l=c[l*3+2],w=c[m*3],x=c[m*3+1],m=c[m*3+2];a.faces.push(new THREE.Face4(b,f,e,g,[new THREE.Vector3(c[j*3],c[j*3+1],c[j*3+2]),new THREE.Vector3(n,o,k),new THREE.Vector3(p,v,l),new THREE.Vector3(w,x,
+3],m=c[j*3+1],j=c[j*3+2],n=c[k*3],o=c[k*3+1],k=c[k*3+2];a.faces.push(new THREE.Face3(b,f,e,[new THREE.Vector3(c[h*3],c[h*3+1],c[h*3+2]),new THREE.Vector3(l,m,j),new THREE.Vector3(n,o,k)],null,g))},f4n:function(a,c,b,f,e,g,h,j,k,l,m){var h=a.materials[h],n=c[k*3],o=c[k*3+1],k=c[k*3+2],p=c[l*3],v=c[l*3+1],l=c[l*3+2],u=c[m*3],w=c[m*3+1],m=c[m*3+2];a.faces.push(new THREE.Face4(b,f,e,g,[new THREE.Vector3(c[j*3],c[j*3+1],c[j*3+2]),new THREE.Vector3(n,o,k),new THREE.Vector3(p,v,l),new THREE.Vector3(u,w,
 m)],null,h))},uv3:function(a,c,b,f,e,g,h){var j=[];j.push(new THREE.UV(c,b));j.push(new THREE.UV(f,e));j.push(new THREE.UV(g,h));a.push(j)},uv4:function(a,c,b,f,e,g,h,j,k){var l=[];l.push(new THREE.UV(c,b));l.push(new THREE.UV(f,e));l.push(new THREE.UV(g,h));l.push(new THREE.UV(j,k));a.push(l)}};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
-THREE.SceneLoader.prototype={load:function(a,c){var b=this,f=new Worker(a);f.postMessage(0);var e=THREE.Loader.prototype.extractUrlbase(a);f.onmessage=function(a){function f(a,b){return b=="relativeToHTML"?a:e+"/"+a}function j(){for(p in F.objects)if(!E.objects[p])if(A=F.objects[p],A.geometry!==void 0){if(H=E.geometries[A.geometry]){var a=!1;D=[];for(P=0;P<A.materials.length;P++)D[P]=E.materials[A.materials[P]],a=D[P]instanceof THREE.MeshShaderMaterial;a&&H.computeTangents();u=A.position;r=A.rotation;
-q=A.quaternion;s=A.scale;q=0;D.length==0&&(D[0]=new THREE.MeshFaceMaterial);D.length>1&&(D=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(H,D);object.name=p;object.position.set(u[0],u[1],u[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=A.visible;E.scene.addObject(object);E.objects[p]=object;A.meshCollider&&(a=THREE.CollisionUtils.MeshColliderWBox(object),E.scene.collisions.colliders.push(a));
-if(A.castsShadow)a=new THREE.ShadowVolume(H),E.scene.addChild(a),a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;A.trigger&&A.trigger.toLowerCase()!="none"&&(a={type:A.trigger,object:A},E.triggers[object.name]=a)}}else u=A.position,r=A.rotation,q=A.quaternion,s=A.scale,q=0,object=new THREE.Object3D,object.name=p,object.position.set(u[0],u[1],u[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0],
-s[1],s[2]),object.visible=A.visible!==void 0?A.visible:!1,E.scene.addObject(object),E.objects[p]=object,E.empties[p]=object,A.trigger&&A.trigger.toLowerCase()!="none"&&(a={type:A.trigger,object:A},E.triggers[object.name]=a)}function k(a){return function(c){E.geometries[a]=c;j();N-=1;b.onLoadComplete();m()}}function l(a){return function(b){E.geometries[a]=b}}function m(){b.callbackProgress({totalModels:O,totalTextures:Q,loadedModels:O-N,loadedTextures:Q-M},E);b.onLoadProgress();N==0&&M==0&&c(E)}var n,
-o,p,v,w,x,y,A,u,B,C,H,J,K,I,D,G,F,L,N,M,O,Q,E;F=a.data;I=new THREE.BinaryLoader;L=new THREE.JSONLoader;M=N=0;E={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};a=!1;for(p in F.objects)if(A=F.objects[p],A.meshCollider){a=!0;break}if(a)E.scene.collisions=new THREE.CollisionSystem;if(F.transform){a=F.transform.position;B=F.transform.rotation;var R=F.transform.scale;a&&E.scene.position.set(a[0],a[1],a[2]);B&&E.scene.rotation.set(B[0],
-B[1],B[2]);R&&E.scene.scale.set(R[0],R[1],R[2]);(a||B||R)&&E.scene.updateMatrix()}a=function(){M-=1;m();b.onLoadComplete()};for(w in F.cameras){B=F.cameras[w];if(B.type=="perspective")J=new THREE.Camera(B.fov,B.aspect,B.near,B.far);else if(B.type=="ortho")J=new THREE.Camera,J.projectionMatrix=THREE.Matrix4.makeOrtho(B.left,B.right,B.top,B.bottom,B.near,B.far);u=B.position;B=B.target;J.position.set(u[0],u[1],u[2]);J.target.position.set(B[0],B[1],B[2]);E.cameras[w]=J}for(v in F.lights)w=F.lights[v],
-J=w.color!==void 0?w.color:16777215,B=w.intensity!==void 0?w.intensity:1,w.type=="directional"?(u=w.direction,G=new THREE.DirectionalLight(J,B),G.position.set(u[0],u[1],u[2]),G.position.normalize()):w.type=="point"?(u=w.position,d=w.distance,G=new THREE.PointLight(J,B,d),G.position.set(u[0],u[1],u[2])):w.type=="ambient"&&(G=new THREE.AmbientLight(J)),E.scene.addLight(G),E.lights[v]=G;for(x in F.fogs)v=F.fogs[x],v.type=="linear"?K=new THREE.Fog(0,v.near,v.far):v.type=="exp2"&&(K=new THREE.FogExp2(0,
-v.density)),B=v.color,K.color.setRGB(B[0],B[1],B[2]),E.fogs[x]=K;if(E.cameras&&F.defaults.camera)E.currentCamera=E.cameras[F.defaults.camera];if(E.fogs&&F.defaults.fog)E.scene.fog=E.fogs[F.defaults.fog];B=F.defaults.bgcolor;E.bgColor=new THREE.Color;E.bgColor.setRGB(B[0],B[1],B[2]);E.bgColorAlpha=F.defaults.bgalpha;for(n in F.geometries)if(x=F.geometries[n],x.type=="bin_mesh"||x.type=="ascii_mesh")N+=1,b.onLoadStart();O=N;for(n in F.geometries)x=F.geometries[n],x.type=="cube"?(H=new THREE.CubeGeometry(x.width,
-x.height,x.depth,x.segmentsWidth,x.segmentsHeight,x.segmentsDepth,null,x.flipped,x.sides),E.geometries[n]=H):x.type=="plane"?(H=new THREE.PlaneGeometry(x.width,x.height,x.segmentsWidth,x.segmentsHeight),E.geometries[n]=H):x.type=="sphere"?(H=new THREE.SphereGeometry(x.radius,x.segmentsWidth,x.segmentsHeight),E.geometries[n]=H):x.type=="cylinder"?(H=new THREE.CylinderGeometry(x.numSegs,x.topRad,x.botRad,x.height,x.topOffset,x.botOffset),E.geometries[n]=H):x.type=="torus"?(H=new THREE.TorusGeometry(x.radius,
-x.tube,x.segmentsR,x.segmentsT),E.geometries[n]=H):x.type=="icosahedron"?(H=new THREE.IcosahedronGeometry(x.subdivisions),E.geometries[n]=H):x.type=="bin_mesh"?I.load({model:f(x.url,F.urlBaseType),callback:k(n)}):x.type=="ascii_mesh"?L.load({model:f(x.url,F.urlBaseType),callback:k(n)}):x.type=="embedded_mesh"&&(x=F.embeds[x.id])&&L.createModel(x,l(n),"");for(y in F.textures)if(n=F.textures[y],n.url instanceof Array){M+=n.url.length;for(I=0;I<n.url.length;I++)b.onLoadStart()}else M+=1,b.onLoadStart();
-Q=M;for(y in F.textures){n=F.textures[y];if(n.mapping!=void 0&&THREE[n.mapping]!=void 0)n.mapping=new THREE[n.mapping];if(n.url instanceof Array){I=[];for(var P=0;P<n.url.length;P++)I[P]=f(n.url[P],F.urlBaseType);I=THREE.ImageUtils.loadTextureCube(I,n.mapping,a)}else{I=THREE.ImageUtils.loadTexture(f(n.url,F.urlBaseType),n.mapping,a);if(THREE[n.minFilter]!=void 0)I.minFilter=THREE[n.minFilter];if(THREE[n.magFilter]!=void 0)I.magFilter=THREE[n.magFilter];if(n.repeat){I.repeat.set(n.repeat[0],n.repeat[1]);
-if(n.repeat[0]!=1)I.wrapS=THREE.RepeatWrapping;if(n.repeat[1]!=1)I.wrapT=THREE.RepeatWrapping}n.offset&&I.offset.set(n.offset[0],n.offset[1]);if(n.wrap){L={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(L[n.wrap[0]]!==void 0)I.wrapS=L[n.wrap[0]];if(L[n.wrap[1]]!==void 0)I.wrapT=L[n.wrap[1]]}}E.textures[y]=I}for(o in F.materials){y=F.materials[o];for(C in y.parameters)if(C=="envMap"||C=="map"||C=="lightMap")y.parameters[C]=E.textures[y.parameters[C]];else if(C=="shading")y.parameters[C]=
-y.parameters[C]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(C=="blending")y.parameters[C]=THREE[y.parameters[C]]?THREE[y.parameters[C]]:THREE.NormalBlending;else if(C=="combine")y.parameters[C]=y.parameters[C]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(C=="vertexColors")if(y.parameters[C]=="face")y.parameters[C]=THREE.FaceColors;else if(y.parameters[C])y.parameters[C]=THREE.VertexColors;if(y.parameters.opacity!==void 0&&y.parameters.opacity<1)y.parameters.transparent=
-!0;if(y.parameters.normalMap){n=THREE.ShaderUtils.lib.normal;a=THREE.UniformsUtils.clone(n.uniforms);I=y.parameters.color;L=y.parameters.specular;x=y.parameters.ambient;K=y.parameters.shininess;a.tNormal.texture=E.textures[y.parameters.normalMap];if(y.parameters.normalMapFactor)a.uNormalScale.value=y.parameters.normalMapFactor;if(y.parameters.map)a.tDiffuse.texture=y.parameters.map,a.enableDiffuse.value=!0;if(y.parameters.lightMap)a.tAO.texture=y.parameters.lightMap,a.enableAO.value=!0;if(y.parameters.specularMap)a.tSpecular.texture=
-E.textures[y.parameters.specularMap],a.enableSpecular.value=!0;a.uDiffuseColor.value.setHex(I);a.uSpecularColor.value.setHex(L);a.uAmbientColor.value.setHex(x);a.uShininess.value=K;if(y.parameters.opacity)a.uOpacity.value=y.parameters.opacity;y=new THREE.MeshShaderMaterial({fragmentShader:n.fragmentShader,vertexShader:n.vertexShader,uniforms:a,lights:!0,fog:!0})}else y=new THREE[y.type](y.parameters);E.materials[o]=y}j();b.callbackSync(E)}}};
+THREE.SceneLoader.prototype={load:function(a,c){var b=this,f=new Worker(a);f.postMessage(0);var e=THREE.Loader.prototype.extractUrlbase(a);f.onmessage=function(a){function f(a,b){return b=="relativeToHTML"?a:e+"/"+a}function j(){for(p in D.objects)if(!C.objects[p])if(y=D.objects[p],y.geometry!==void 0){if(A=C.geometries[y.geometry]){var a=!1;L=[];for(N=0;N<y.materials.length;N++)L[N]=C.materials[y.materials[N]],a=L[N]instanceof THREE.MeshShaderMaterial;a&&A.computeTangents();t=y.position;r=y.rotation;
+q=y.quaternion;s=y.scale;q=0;L.length==0&&(L[0]=new THREE.MeshFaceMaterial);L.length>1&&(L=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(A,L);object.name=p;object.position.set(t[0],t[1],t[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=y.visible;C.scene.addObject(object);C.objects[p]=object;y.meshCollider&&(a=THREE.CollisionUtils.MeshColliderWBox(object),C.scene.collisions.colliders.push(a));
+if(y.castsShadow)a=new THREE.ShadowVolume(A),C.scene.addChild(a),a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;y.trigger&&y.trigger.toLowerCase()!="none"&&(a={type:y.trigger,object:y},C.triggers[object.name]=a)}}else t=y.position,r=y.rotation,q=y.quaternion,s=y.scale,q=0,object=new THREE.Object3D,object.name=p,object.position.set(t[0],t[1],t[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0],
+s[1],s[2]),object.visible=y.visible!==void 0?y.visible:!1,C.scene.addObject(object),C.objects[p]=object,C.empties[p]=object,y.trigger&&y.trigger.toLowerCase()!="none"&&(a={type:y.trigger,object:y},C.triggers[object.name]=a)}function k(a){return function(c){C.geometries[a]=c;j();F-=1;b.onLoadComplete();m()}}function l(a){return function(b){C.geometries[a]=b}}function m(){b.callbackProgress({totalModels:O,totalTextures:M,loadedModels:O-F,loadedTextures:M-I},C);b.onLoadProgress();F==0&&I==0&&c(C)}var n,
+o,p,v,u,w,x,y,t,z,B,A,E,G,H,L,J,D,K,F,I,O,M,C;D=a.data;H=new THREE.BinaryLoader;K=new THREE.JSONLoader;I=F=0;C={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};a=!1;for(p in D.objects)if(y=D.objects[p],y.meshCollider){a=!0;break}if(a)C.scene.collisions=new THREE.CollisionSystem;if(D.transform){a=D.transform.position;z=D.transform.rotation;var P=D.transform.scale;a&&C.scene.position.set(a[0],a[1],a[2]);z&&C.scene.rotation.set(z[0],
+z[1],z[2]);P&&C.scene.scale.set(P[0],P[1],P[2]);(a||z||P)&&C.scene.updateMatrix()}a=function(){I-=1;m();b.onLoadComplete()};for(u in D.cameras){z=D.cameras[u];if(z.type=="perspective")E=new THREE.Camera(z.fov,z.aspect,z.near,z.far);else if(z.type=="ortho")E=new THREE.Camera,E.projectionMatrix=THREE.Matrix4.makeOrtho(z.left,z.right,z.top,z.bottom,z.near,z.far);t=z.position;z=z.target;E.position.set(t[0],t[1],t[2]);E.target.position.set(z[0],z[1],z[2]);C.cameras[u]=E}for(v in D.lights)u=D.lights[v],
+E=u.color!==void 0?u.color:16777215,z=u.intensity!==void 0?u.intensity:1,u.type=="directional"?(t=u.direction,J=new THREE.DirectionalLight(E,z),J.position.set(t[0],t[1],t[2]),J.position.normalize()):u.type=="point"?(t=u.position,d=u.distance,J=new THREE.PointLight(E,z,d),J.position.set(t[0],t[1],t[2])):u.type=="ambient"&&(J=new THREE.AmbientLight(E)),C.scene.addLight(J),C.lights[v]=J;for(w in D.fogs)v=D.fogs[w],v.type=="linear"?G=new THREE.Fog(0,v.near,v.far):v.type=="exp2"&&(G=new THREE.FogExp2(0,
+v.density)),z=v.color,G.color.setRGB(z[0],z[1],z[2]),C.fogs[w]=G;if(C.cameras&&D.defaults.camera)C.currentCamera=C.cameras[D.defaults.camera];if(C.fogs&&D.defaults.fog)C.scene.fog=C.fogs[D.defaults.fog];z=D.defaults.bgcolor;C.bgColor=new THREE.Color;C.bgColor.setRGB(z[0],z[1],z[2]);C.bgColorAlpha=D.defaults.bgalpha;for(n in D.geometries)if(w=D.geometries[n],w.type=="bin_mesh"||w.type=="ascii_mesh")F+=1,b.onLoadStart();O=F;for(n in D.geometries)w=D.geometries[n],w.type=="cube"?(A=new THREE.CubeGeometry(w.width,
+w.height,w.depth,w.segmentsWidth,w.segmentsHeight,w.segmentsDepth,null,w.flipped,w.sides),C.geometries[n]=A):w.type=="plane"?(A=new THREE.PlaneGeometry(w.width,w.height,w.segmentsWidth,w.segmentsHeight),C.geometries[n]=A):w.type=="sphere"?(A=new THREE.SphereGeometry(w.radius,w.segmentsWidth,w.segmentsHeight),C.geometries[n]=A):w.type=="cylinder"?(A=new THREE.CylinderGeometry(w.numSegs,w.topRad,w.botRad,w.height,w.topOffset,w.botOffset),C.geometries[n]=A):w.type=="torus"?(A=new THREE.TorusGeometry(w.radius,
+w.tube,w.segmentsR,w.segmentsT),C.geometries[n]=A):w.type=="icosahedron"?(A=new THREE.IcosahedronGeometry(w.subdivisions),C.geometries[n]=A):w.type=="bin_mesh"?H.load({model:f(w.url,D.urlBaseType),callback:k(n)}):w.type=="ascii_mesh"?K.load({model:f(w.url,D.urlBaseType),callback:k(n)}):w.type=="embedded_mesh"&&(w=D.embeds[w.id])&&K.createModel(w,l(n),"");for(x in D.textures)if(n=D.textures[x],n.url instanceof Array){I+=n.url.length;for(H=0;H<n.url.length;H++)b.onLoadStart()}else I+=1,b.onLoadStart();
+M=I;for(x in D.textures){n=D.textures[x];if(n.mapping!=void 0&&THREE[n.mapping]!=void 0)n.mapping=new THREE[n.mapping];if(n.url instanceof Array){H=[];for(var N=0;N<n.url.length;N++)H[N]=f(n.url[N],D.urlBaseType);H=THREE.ImageUtils.loadTextureCube(H,n.mapping,a)}else{H=THREE.ImageUtils.loadTexture(f(n.url,D.urlBaseType),n.mapping,a);if(THREE[n.minFilter]!=void 0)H.minFilter=THREE[n.minFilter];if(THREE[n.magFilter]!=void 0)H.magFilter=THREE[n.magFilter];if(n.repeat){H.repeat.set(n.repeat[0],n.repeat[1]);
+if(n.repeat[0]!=1)H.wrapS=THREE.RepeatWrapping;if(n.repeat[1]!=1)H.wrapT=THREE.RepeatWrapping}n.offset&&H.offset.set(n.offset[0],n.offset[1]);if(n.wrap){K={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(K[n.wrap[0]]!==void 0)H.wrapS=K[n.wrap[0]];if(K[n.wrap[1]]!==void 0)H.wrapT=K[n.wrap[1]]}}C.textures[x]=H}for(o in D.materials){x=D.materials[o];for(B in x.parameters)if(B=="envMap"||B=="map"||B=="lightMap")x.parameters[B]=C.textures[x.parameters[B]];else if(B=="shading")x.parameters[B]=
+x.parameters[B]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(B=="blending")x.parameters[B]=THREE[x.parameters[B]]?THREE[x.parameters[B]]:THREE.NormalBlending;else if(B=="combine")x.parameters[B]=x.parameters[B]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(B=="vertexColors")if(x.parameters[B]=="face")x.parameters[B]=THREE.FaceColors;else if(x.parameters[B])x.parameters[B]=THREE.VertexColors;if(x.parameters.opacity!==void 0&&x.parameters.opacity<1)x.parameters.transparent=
+!0;if(x.parameters.normalMap){n=THREE.ShaderUtils.lib.normal;a=THREE.UniformsUtils.clone(n.uniforms);H=x.parameters.color;K=x.parameters.specular;w=x.parameters.ambient;G=x.parameters.shininess;a.tNormal.texture=C.textures[x.parameters.normalMap];if(x.parameters.normalMapFactor)a.uNormalScale.value=x.parameters.normalMapFactor;if(x.parameters.map)a.tDiffuse.texture=x.parameters.map,a.enableDiffuse.value=!0;if(x.parameters.lightMap)a.tAO.texture=x.parameters.lightMap,a.enableAO.value=!0;if(x.parameters.specularMap)a.tSpecular.texture=
+C.textures[x.parameters.specularMap],a.enableSpecular.value=!0;a.uDiffuseColor.value.setHex(H);a.uSpecularColor.value.setHex(K);a.uAmbientColor.value.setHex(w);a.uShininess.value=G;if(x.parameters.opacity)a.uOpacity.value=x.parameters.opacity;x=new THREE.MeshShaderMaterial({fragmentShader:n.fragmentShader,vertexShader:n.vertexShader,uniforms:a,lights:!0,fog:!0})}else x=new THREE[x.type](x.parameters);C.materials[o]=x}j();b.callbackSync(C)}}};
 THREE.MarchingCubes=function(a,c){THREE.Object3D.call(this);this.materials=c instanceof Array?c:[c];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,c,e){return a+(c-a)*e};this.VIntX=function(a,c,e,g,h,j,k,l,m,n){h=(h-m)/(n-m);m=this.normal_cache;c[g]=j+h*this.delta;c[g+1]=k;c[g+2]=l;e[g]=this.lerp(m[a],m[a+3],h);e[g+1]=this.lerp(m[a+1],m[a+4],h);e[g+2]=this.lerp(m[a+2],m[a+5],h)};this.VIntY=function(a,c,e,g,h,j,k,l,m,n){h=(h-m)/(n-m);m=this.normal_cache;c[g]=j;c[g+1]=k+h*this.delta;c[g+
 2]=l;c=a+this.yd*3;e[g]=this.lerp(m[a],m[c],h);e[g+1]=this.lerp(m[a+1],m[c+1],h);e[g+2]=this.lerp(m[a+2],m[c+2],h)};this.VIntZ=function(a,c,e,g,h,j,k,l,m,n){h=(h-m)/(n-m);m=this.normal_cache;c[g]=j;c[g+1]=k;c[g+2]=l+h*this.delta;c=a+this.zd*3;e[g]=this.lerp(m[a],m[c],h);e[g+1]=this.lerp(m[a+1],m[c+1],h);e[g+2]=this.lerp(m[a+2],m[c+2],h)};this.compNorm=function(a){var c=a*3;this.normal_cache[c]==0&&(this.normal_cache[c]=this.field[a-1]-this.field[a+1],this.normal_cache[c+1]=this.field[a-this.yd]-this.field[a+
-this.yd],this.normal_cache[c+2]=this.field[a-this.zd]-this.field[a+this.zd])};this.polygonize=function(a,c,e,g,h,j){var k=g+1,l=g+this.yd,m=g+this.zd,n=k+this.yd,o=k+this.zd,p=g+this.yd+this.zd,v=k+this.yd+this.zd,w=0,x=this.field[g],y=this.field[k],A=this.field[l],u=this.field[n],B=this.field[m],C=this.field[o],H=this.field[p],J=this.field[v];x<h&&(w|=1);y<h&&(w|=2);A<h&&(w|=8);u<h&&(w|=4);B<h&&(w|=16);C<h&&(w|=32);H<h&&(w|=128);J<h&&(w|=64);var K=THREE.edgeTable[w];if(K==0)return 0;var I=this.delta,
-D=a+I,G=c+I,I=e+I;K&1&&(this.compNorm(g),this.compNorm(k),this.VIntX(g*3,this.vlist,this.nlist,0,h,a,c,e,x,y));K&2&&(this.compNorm(k),this.compNorm(n),this.VIntY(k*3,this.vlist,this.nlist,3,h,D,c,e,y,u));K&4&&(this.compNorm(l),this.compNorm(n),this.VIntX(l*3,this.vlist,this.nlist,6,h,a,G,e,A,u));K&8&&(this.compNorm(g),this.compNorm(l),this.VIntY(g*3,this.vlist,this.nlist,9,h,a,c,e,x,A));K&16&&(this.compNorm(m),this.compNorm(o),this.VIntX(m*3,this.vlist,this.nlist,12,h,a,c,I,B,C));K&32&&(this.compNorm(o),
-this.compNorm(v),this.VIntY(o*3,this.vlist,this.nlist,15,h,D,c,I,C,J));K&64&&(this.compNorm(p),this.compNorm(v),this.VIntX(p*3,this.vlist,this.nlist,18,h,a,G,I,H,J));K&128&&(this.compNorm(m),this.compNorm(p),this.VIntY(m*3,this.vlist,this.nlist,21,h,a,c,I,B,H));K&256&&(this.compNorm(g),this.compNorm(m),this.VIntZ(g*3,this.vlist,this.nlist,24,h,a,c,e,x,B));K&512&&(this.compNorm(k),this.compNorm(o),this.VIntZ(k*3,this.vlist,this.nlist,27,h,D,c,e,y,C));K&1024&&(this.compNorm(n),this.compNorm(v),this.VIntZ(n*
-3,this.vlist,this.nlist,30,h,D,G,e,u,J));K&2048&&(this.compNorm(l),this.compNorm(p),this.VIntZ(l*3,this.vlist,this.nlist,33,h,a,G,e,A,H));w<<=4;for(h=g=0;THREE.triTable[w+h]!=-1;)a=w+h,c=a+1,e=a+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[a],3*THREE.triTable[c],3*THREE.triTable[e],j),h+=3,g++;return g};this.posnormtriv=function(a,c,e,g,h,j){var k=this.count*3;this.positionArray[k]=a[e];this.positionArray[k+1]=a[e+1];this.positionArray[k+2]=a[e+2];this.positionArray[k+3]=a[g];this.positionArray[k+
+this.yd],this.normal_cache[c+2]=this.field[a-this.zd]-this.field[a+this.zd])};this.polygonize=function(a,c,e,g,h,j){var k=g+1,l=g+this.yd,m=g+this.zd,n=k+this.yd,o=k+this.zd,p=g+this.yd+this.zd,v=k+this.yd+this.zd,u=0,w=this.field[g],x=this.field[k],y=this.field[l],t=this.field[n],z=this.field[m],B=this.field[o],A=this.field[p],E=this.field[v];w<h&&(u|=1);x<h&&(u|=2);y<h&&(u|=8);t<h&&(u|=4);z<h&&(u|=16);B<h&&(u|=32);A<h&&(u|=128);E<h&&(u|=64);var G=THREE.edgeTable[u];if(G==0)return 0;var H=this.delta,
+L=a+H,J=c+H,H=e+H;G&1&&(this.compNorm(g),this.compNorm(k),this.VIntX(g*3,this.vlist,this.nlist,0,h,a,c,e,w,x));G&2&&(this.compNorm(k),this.compNorm(n),this.VIntY(k*3,this.vlist,this.nlist,3,h,L,c,e,x,t));G&4&&(this.compNorm(l),this.compNorm(n),this.VIntX(l*3,this.vlist,this.nlist,6,h,a,J,e,y,t));G&8&&(this.compNorm(g),this.compNorm(l),this.VIntY(g*3,this.vlist,this.nlist,9,h,a,c,e,w,y));G&16&&(this.compNorm(m),this.compNorm(o),this.VIntX(m*3,this.vlist,this.nlist,12,h,a,c,H,z,B));G&32&&(this.compNorm(o),
+this.compNorm(v),this.VIntY(o*3,this.vlist,this.nlist,15,h,L,c,H,B,E));G&64&&(this.compNorm(p),this.compNorm(v),this.VIntX(p*3,this.vlist,this.nlist,18,h,a,J,H,A,E));G&128&&(this.compNorm(m),this.compNorm(p),this.VIntY(m*3,this.vlist,this.nlist,21,h,a,c,H,z,A));G&256&&(this.compNorm(g),this.compNorm(m),this.VIntZ(g*3,this.vlist,this.nlist,24,h,a,c,e,w,z));G&512&&(this.compNorm(k),this.compNorm(o),this.VIntZ(k*3,this.vlist,this.nlist,27,h,L,c,e,x,B));G&1024&&(this.compNorm(n),this.compNorm(v),this.VIntZ(n*
+3,this.vlist,this.nlist,30,h,L,J,e,t,E));G&2048&&(this.compNorm(l),this.compNorm(p),this.VIntZ(l*3,this.vlist,this.nlist,33,h,a,J,e,y,A));u<<=4;for(h=g=0;THREE.triTable[u+h]!=-1;)a=u+h,c=a+1,e=a+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[a],3*THREE.triTable[c],3*THREE.triTable[e],j),h+=3,g++;return g};this.posnormtriv=function(a,c,e,g,h,j){var k=this.count*3;this.positionArray[k]=a[e];this.positionArray[k+1]=a[e+1];this.positionArray[k+2]=a[e+2];this.positionArray[k+3]=a[g];this.positionArray[k+
 4]=a[g+1];this.positionArray[k+5]=a[g+2];this.positionArray[k+6]=a[h];this.positionArray[k+7]=a[h+1];this.positionArray[k+8]=a[h+2];this.normalArray[k]=c[e];this.normalArray[k+1]=c[e+1];this.normalArray[k+2]=c[e+2];this.normalArray[k+3]=c[g];this.normalArray[k+4]=c[g+1];this.normalArray[k+5]=c[g+2];this.normalArray[k+6]=c[h];this.normalArray[k+7]=c[h+1];this.normalArray[k+8]=c[h+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&j(this)};this.begin=function(){this.count=0;
 this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!=0){for(var c=this.count*3;c<this.positionArray.length;c++)this.positionArray[c]=0;a(this)}};this.addBall=function(a,c,e,g,h){var j=this.size*Math.sqrt(g/h),k=e*this.size,l=c*this.size,m=a*this.size,n=Math.floor(k-j);n<1&&(n=1);k=Math.floor(k+j);k>this.size-1&&(k=this.size-1);var o=Math.floor(l-j);o<1&&(o=1);l=Math.floor(l+j);l>this.size-1&&(l=this.size-1);var p=Math.floor(m-j);p<1&&(p=1);j=Math.floor(m+j);j>this.size-1&&(j=this.size-
-1);for(var v,w,x,y,A,u;n<k;n++){m=this.size2*n;w=n/this.size-e;A=w*w;for(w=o;w<l;w++){x=m+this.size*w;v=w/this.size-c;u=v*v;for(v=p;v<j;v++)y=v/this.size-a,y=g/(1.0E-6+y*y+u+A)-h,y>0&&(this.field[x+v]+=y)}}};this.addPlaneX=function(a,c){var e,g,h,j,k,l=this.size,m=this.yd,n=this.zd,o=this.field,p=l*Math.sqrt(a/c);p>l&&(p=l);for(e=0;e<p;e++)if(g=e/l,g*=g,j=a/(1.0E-4+g)-c,j>0)for(g=0;g<l;g++){k=e+g*m;for(h=0;h<l;h++)o[n*h+k]+=j}};this.addPlaneY=function(a,c){var e,g,h,j,k,l,m=this.size,n=this.yd,o=
+1);for(var v,u,w,x,y,t;n<k;n++){m=this.size2*n;u=n/this.size-e;y=u*u;for(u=o;u<l;u++){w=m+this.size*u;v=u/this.size-c;t=v*v;for(v=p;v<j;v++)x=v/this.size-a,x=g/(1.0E-6+x*x+t+y)-h,x>0&&(this.field[w+v]+=x)}}};this.addPlaneX=function(a,c){var e,g,h,j,k,l=this.size,m=this.yd,n=this.zd,o=this.field,p=l*Math.sqrt(a/c);p>l&&(p=l);for(e=0;e<p;e++)if(g=e/l,g*=g,j=a/(1.0E-4+g)-c,j>0)for(g=0;g<l;g++){k=e+g*m;for(h=0;h<l;h++)o[n*h+k]+=j}};this.addPlaneY=function(a,c){var e,g,h,j,k,l,m=this.size,n=this.yd,o=
 this.zd,p=this.field,v=m*Math.sqrt(a/c);v>m&&(v=m);for(g=0;g<v;g++)if(e=g/m,e*=e,j=a/(1.0E-4+e)-c,j>0){k=g*n;for(e=0;e<m;e++){l=k+e;for(h=0;h<m;h++)p[o*h+l]+=j}}};this.addPlaneZ=function(a,c){var e,g,h,j,k,l;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(a/c);dist>size&&(dist=size);for(h=0;h<dist;h++)if(e=h/size,e*=e,j=a/(1.0E-4+e)-c,j>0){k=zd*h;for(g=0;g<size;g++){l=k+g*yd;for(e=0;e<size;e++)field[l+e]+=j}}};this.reset=function(){var a;for(a=0;a<this.size3;a++)this.normal_cache[a*
 3]=0,this.field[a]=0};this.render=function(a){this.begin();var c,e,g,h,j,k,l,m,n,o=this.size-2;for(h=1;h<o;h++){n=this.size2*h;l=(h-this.halfsize)/this.halfsize;for(g=1;g<o;g++){m=n+this.size*g;k=(g-this.halfsize)/this.halfsize;for(e=1;e<o;e++)j=(e-this.halfsize)/this.halfsize,c=m+e,this.polygonize(j,k,l,c,this.isolation,a)}}this.end(a)};this.generateGeometry=function(){var a=0,c=new THREE.Geometry,e=[];this.render(function(g){var h,j,k,l,m,n,o,p;for(h=0;h<g.count;h++)o=h*3,m=o+1,p=o+2,j=g.positionArray[o],
 k=g.positionArray[m],l=g.positionArray[p],n=new THREE.Vector3(j,k,l),j=g.normalArray[o],k=g.normalArray[m],l=g.normalArray[p],o=new THREE.Vector3(j,k,l),o.normalize(),m=new THREE.Vertex(n),c.vertices.push(m),e.push(o);nfaces=g.count/3;for(h=0;h<nfaces;h++)o=(a+h)*3,m=o+1,p=o+2,n=e[o],j=e[m],k=e[p],o=new THREE.Face3(o,m,p,[n,j,k]),c.faces.push(o);a+=nfaces;g.count=0});return c};this.init(a)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
@@ -257,7 +257,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 c=this,b=this.setSize,f=this.render,e=new THREE.Camera,g=new THREE.Camera,h=new THREE.Matrix4,j=new THREE.Matrix4,k,l,m;e.useTarget=g.useTarget=!1;e.matrixAutoUpdate=g.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},n=new THREE.WebGLRenderTarget(512,512,a),o=new THREE.WebGLRenderTarget(512,512,a),p=new THREE.Camera(53,1,1,1E4);p.position.z=
 2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:n},mapRight:{type:"t",value:1,texture:o}},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 v=new THREE.Scene;v.addObject(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,e){b.call(c,a,e);n.width=a;n.height=e;o.width=a;o.height=e};this.render=function(a,b){b.update(null,!0);if(k!==b.aspect||l!==b.near||m!==b.fov){k=b.aspect;l=b.near;m=b.fov;var y=b.projectionMatrix.clone(),A=125/30*0.5,u=A*l/125,B=l*Math.tan(m*Math.PI/360),C;h.n14=A;j.n14=-A;A=-B*k+u;C=B*k+u;y.n11=2*l/(C-A);y.n13=(C+A)/(C-A);e.projectionMatrix=y.clone();A=-B*k-u;C=B*k-u;y.n11=2*l/(C-A);
-y.n13=(C+A)/(C-A);g.projectionMatrix=y.clone()}e.matrix=b.matrixWorld.clone().multiplySelf(j);e.update(null,!0);e.position.copy(b.position);e.near=l;e.far=b.far;f.call(c,a,e,n,!0);g.matrix=b.matrixWorld.clone().multiplySelf(h);g.update(null,!0);g.position.copy(b.position);g.near=l;g.far=b.far;f.call(c,a,g,o,!0);f.call(c,v,p)}};
+var v=new THREE.Scene;v.addObject(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,e){b.call(c,a,e);n.width=a;n.height=e;o.width=a;o.height=e};this.render=function(a,b){b.update(null,!0);if(k!==b.aspect||l!==b.near||m!==b.fov){k=b.aspect;l=b.near;m=b.fov;var x=b.projectionMatrix.clone(),y=125/30*0.5,t=y*l/125,z=l*Math.tan(m*Math.PI/360),B;h.n14=y;j.n14=-y;y=-z*k+t;B=z*k+t;x.n11=2*l/(B-y);x.n13=(B+y)/(B-y);e.projectionMatrix=x.clone();y=-z*k-t;B=z*k-t;x.n11=2*l/(B-y);
+x.n13=(B+y)/(B-y);g.projectionMatrix=x.clone()}e.matrix=b.matrixWorld.clone().multiplySelf(j);e.update(null,!0);e.position.copy(b.position);e.near=l;e.far=b.far;f.call(c,a,e,n,!0);g.matrix=b.matrixWorld.clone().multiplySelf(h);g.update(null,!0);g.position.copy(b.position);g.near=l;g.far=b.far;f.call(c,a,g,o,!0);f.call(c,v,p)}};
 if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var c=this,b=this.setSize,f=this.render,e,g,h=new THREE.Camera,j=new THREE.Camera;c.separation=10;if(a&&a.separation!==void 0)c.separation=a.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(a,f){b.call(c,a,f);e=a/2;g=f};this.render=function(a,b){this.clear();h.fov=b.fov;h.aspect=0.5*b.aspect;h.near=b.near;h.far=b.far;
 h.updateProjectionMatrix();h.position.copy(b.position);h.target.position.copy(b.target.position);h.translateX(c.separation);j.projectionMatrix=h.projectionMatrix;j.position.copy(b.position);j.target.position.copy(b.target.position);j.translateX(-c.separation);this.setViewport(0,0,e,g);f.call(c,a,h);this.setViewport(e,0,e,g);f.call(c,a,j,!1)}};

+ 80 - 80
examples/webgl_geometry_text.html

@@ -26,14 +26,14 @@
 	<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 
+		<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>, 
+		<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="bezel">change bezel</span>,
-			<span class="button" id="postprocessing">change postprocessing</span>, 
+			<span class="button" id="bevel">change bevel</span>,
+			<span class="button" id="postprocessing">change postprocessing</span>,
 			<a id="permalink" href="#">permalink</a>
 		</div>
 
@@ -43,12 +43,12 @@
 		<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>
@@ -60,7 +60,7 @@
 		<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">
 
@@ -82,9 +82,9 @@
 
 				curveSegments = 6,
 
-				bezelThickness = 2,
-				bezelSize = 1.5,
-				bezelEnabled = true,
+				bevelThickness = 2,
+				bevelSize = 1.5,
+				bevelEnabled = true,
 
 				font = "optimer", 		// helvetiker, optimer, gentilis, droid sans, droid serif
 				weight = "bold",		// normal bold
@@ -134,9 +134,9 @@
 			}
 
 			function decimalToHex( d ) {
-  
+
 				var hex = Number( d ).toString( 16 );
-				hex = "000000".substr( 0, 6 - hex.length ) + hex; 
+				hex = "000000".substr( 0, 6 - hex.length ) + hex;
 				return hex.toUpperCase();
 
 			}
@@ -180,7 +180,7 @@
 					var fonthash   = hash.substring( 6, 7 );
 					var weighthash = hash.substring( 7, 8 );
 					var pphash 	   = hash.substring( 8, 9 );
-					var bezelhash  = hash.substring( 9, 10 );
+					var bevelhash  = hash.substring( 9, 10 );
 					var texthash   = hash.substring( 11 );
 
 					hex = colorhash;
@@ -190,7 +190,7 @@
 					weight = reverseWeightMap[ parseInt( weighthash ) ];
 
 					postprocessing.enabled = parseInt( pphash );
-					bezelEnabled = parseInt( bezelhash );
+					bevelEnabled = parseInt( bevelhash );
 
 					text = decodeURI( texthash );
 
@@ -206,7 +206,7 @@
 
 				textGeo = new THREE.TextGeometry( text, {
 
-					size: size, 
+					size: size,
 					height: height,
 					curveSegments: curveSegments,
 
@@ -214,16 +214,16 @@
 					weight: weight,
 					style: style,
 
-					bezelThickness: bezelThickness,
-					bezelSize: bezelSize,
-					bezelEnabled: bezelEnabled
+					bevelThickness: bevelThickness,
+					bevelSize: bevelSize,
+					bevelEnabled: bevelEnabled
 
 				});
-				
+
 				textMaterial = new THREE.MeshPhongMaterial( { color: 0xffffff, wireframe: false } );
 
 				parent = new THREE.Object3D();
-				
+
 				textMesh1 = new THREE.Mesh( textGeo, textMaterial );
 
 				textMesh1.position.x = 0;
@@ -247,7 +247,7 @@
 					textMesh2.rotation.y = Math.PI * 2;
 
 					parent.addChild( textMesh2 );
-					
+
 				}
 
 				parent.position.y = 100;
@@ -260,7 +260,7 @@
 
 				renderer = new THREE.WebGLRenderer( { antialias: false } );
 				renderer.setSize( window.innerWidth, window.innerHeight );
-				
+
 				renderer.setClearColor( scene.fog.color, 1 );
 
 				container.appendChild( renderer.domElement );
@@ -277,91 +277,91 @@
 				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( "bezel" ).addEventListener( 'click', function() {
-				
-					bezelEnabled = !bezelEnabled;
-					
+				document.getElementById( "bevel" ).addEventListener( 'click', function() {
+
+					bevelEnabled = !bevelEnabled;
+
 					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 ) + boolToNum( bezelEnabled ) + "#" + encodeURI( text );
-				
+
+				var link = hex + fontMap[ font ] + weightMap[ weight ] + boolToNum( postprocessing.enabled ) + boolToNum( bevelEnabled ) + "#" + encodeURI( text );
+
 				permalink.href = "#" + link;
 				window.location.hash = link;
 
@@ -370,14 +370,14 @@
 			function onDocumentKeyDown( event ) {
 
 				if ( firstLetter ) {
-				
+
 					firstLetter = false;
 					text = "";
 
 				}
-				
+
 				var keyCode = event.keyCode;
-				
+
 				// backspace
 
 				if ( keyCode == 8 ) {
@@ -388,23 +388,23 @@
 					refreshText();
 
 					return false;
-					
+
 				}
 
 			}
-			
+
 			function onDocumentKeyPress( event ) {
-				
+
 				var keyCode = event.which;
-				
+
 				// backspace
 
 				if ( keyCode == 8 ) {
-					
+
 					event.preventDefault();
-					
+
 				} else {
-				
+
 					var ch = String.fromCharCode( keyCode );
 					text += ch;
 
@@ -413,16 +413,16 @@
 				}
 
 			}
-			
+
 			function refreshText() {
 
 				updatePermalink();
-				
+
 				scene.removeChild( textMesh1 );
 
 				textGeo = new THREE.TextGeometry( text, {
 
-					size: size, 
+					size: size,
 					height: height,
 					curveSegments: curveSegments,
 
@@ -430,9 +430,9 @@
 					weight: weight,
 					style: style,
 
-					bezelThickness: bezelThickness,
-					bezelSize: bezelSize,
-					bezelEnabled: bezelEnabled
+					bevelThickness: bevelThickness,
+					bevelSize: bevelSize,
+					bevelEnabled: bevelEnabled
 
 				});
 
@@ -459,14 +459,14 @@
 
 					textMesh2.rotation.x = Math.PI;
 					textMesh2.rotation.y = Math.PI * 2;
-					
-					
+
+
 					parent.addChild( textMesh2 );
-					
+
 				}
 
 			}
-			
+
 			function onDocumentMouseDown( event ) {
 
 				event.preventDefault();
@@ -531,7 +531,7 @@
 			}
 
 			//
-			
+
 			function initPostprocessing() {
 
 				postprocessing.scene = new THREE.Scene();
@@ -621,9 +621,9 @@
 				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();
@@ -669,7 +669,7 @@
 					renderer.clear();
 					renderer.render( scene, camera );
 
-				}				
+				}
 
 			}
 

+ 28 - 28
src/extras/geometries/TextGeometry.js

@@ -15,9 +15,9 @@
  *  weight: 		<string>,		// font weight (normal, bold)
  *  style: 			<string>,		// font style  (normal, italics)
  *
- *  bezelEnabled:	<bool>,			// turn on bezel
- *  bezelThickness: <float>, 		// how deep into text bezel goes
- *  bezelSize:		<float>, 		// how far from text outline is bezel
+ *  bevelEnabled:	<bool>,			// turn on bevel
+ *  bevelThickness: <float>, 		// how deep into text bevel goes
+ *  bevelSize:		<float>, 		// how far from text outline is bevel
  *  }
  *
  * It uses techniques used in:
@@ -60,9 +60,9 @@ THREE.TextGeometry.prototype.set = function ( text, parameters ) {
 	var weight = parameters.weight !== undefined ? parameters.weight : "normal";
 	var style = parameters.style !== undefined ? parameters.style : "normal";
 
-	var bezelThickness = parameters.bezelThickness !== undefined ? parameters.bezelThickness : 10;
-	var bezelSize = parameters.bezelSize !== undefined ? parameters.bezelSize : 8;
-	var bezelEnabled = parameters.bezelEnabled !== undefined ? parameters.bezelEnabled : false;
+	var bevelThickness = parameters.bevelThickness !== undefined ? parameters.bevelThickness : 10;
+	var bevelSize = parameters.bevelSize !== undefined ? parameters.bevelSize : 8;
+	var bevelEnabled = parameters.bevelEnabled !== undefined ? parameters.bevelEnabled : false;
 
 	THREE.FontUtils.size = size;
 	THREE.FontUtils.divisions = curveSegments;
@@ -71,7 +71,7 @@ THREE.TextGeometry.prototype.set = function ( text, parameters ) {
 	THREE.FontUtils.weight = weight;
 	THREE.FontUtils.style = style;
 
-	THREE.FontUtils.bezelSize = bezelSize;
+	THREE.FontUtils.bevelSize = bevelSize;
 
 	// Get a Font data json object
 
@@ -80,7 +80,7 @@ THREE.TextGeometry.prototype.set = function ( text, parameters ) {
 	var vertices = data.points;
 	var faces = data.faces;
 	var contour = data.contour;
-	var bezelPoints = data.bezel;
+	var bevelPoints = data.bevel;
 
 	var scope = this;
 
@@ -90,7 +90,7 @@ THREE.TextGeometry.prototype.set = function ( text, parameters ) {
 	var i,
 		vert, vlen = vertices.length,
 		face, flen = faces.length,
-		bezelPt, blen = bezelPoints.length;
+		bevelPt, blen = bevelPoints.length;
 
 	// Back facing vertices
 
@@ -110,19 +110,19 @@ THREE.TextGeometry.prototype.set = function ( text, parameters ) {
 
 	}
 
-	if ( bezelEnabled ) {
+	if ( bevelEnabled ) {
 
 		for ( i = 0; i < blen; i++ ) {
 
-			bezelPt = bezelPoints[ i ];
-			v( bezelPt.x, bezelPt.y, bezelThickness );
+			bevelPt = bevelPoints[ i ];
+			v( bevelPt.x, bevelPt.y, bevelThickness );
 
 		}
 
 		for ( i = 0; i < blen; i++ ) {
 
-			bezelPt = bezelPoints[ i ];
-			v( bezelPt.x, bezelPt.y, height - bezelThickness );
+			bevelPt = bevelPoints[ i ];
+			v( bevelPt.x, bevelPt.y, height - bevelThickness );
 
 		}
 
@@ -149,9 +149,9 @@ THREE.TextGeometry.prototype.set = function ( text, parameters ) {
 	var lastV;
 	var j, k, l, m;
 
-	if ( bezelEnabled ) {
+	if ( bevelEnabled ) {
 
-		i = bezelPoints.length;
+		i = bevelPoints.length;
 
 		while ( --i > 0 ) {
 
@@ -668,18 +668,18 @@ THREE.FontUtils = {
 
 		var path = new THREE.Path();
 		for ( i = 0; i < length; i++ ) {
-			
+
 			var ret = this.extractGlyphPoints( chars[ i ], face, scale, offset, path );
 			offset += ret.offset;
 			characterPts.push( ret.points );
 			allPts = allPts.concat( ret.points );
 			//fontPaths.push( ret.path );
-			
+
 		}
-		
+
 		//path.debug(document.getElementById("boo"));
 		console.log(path);
-		
+
 
 		// get the width
 
@@ -694,7 +694,7 @@ THREE.FontUtils = {
 		var extract = this.extractPoints( allPts, characterPts );
 		extract.contour = allPts;
 
-		var bezelPoints = [];
+		var bevelPoints = [];
 
 		var centroids = [], forCentroids = [], expandOutwards = [], sum = new THREE.Vector2(), lastV;
 
@@ -739,7 +739,7 @@ THREE.FontUtils = {
 			centroid = centroids[ p ];
 
 			dirV = pt.clone().subSelf( centroid );
-			adj = this.bezelSize / dirV.length();
+			adj = this.bevelSize / dirV.length();
 
 			if ( expandOutwards[ p ] ) {
 
@@ -752,7 +752,7 @@ THREE.FontUtils = {
 			}
 
 			adj = dirV.multiplyScalar( adj ).addSelf( centroid );
-			bezelPoints.unshift( adj );
+			bevelPoints.unshift( adj );
 
 
 			if ( !lastV ) {
@@ -776,12 +776,12 @@ THREE.FontUtils = {
 		for ( p = 0; p < allPts.length; p++ ) {
 
 			pt = allPts[ p ];
-			bezelPoints.push( new THREE.Vector2( pt.x + this.bezelSize, pt.y + this.bezelSize ) );
+			bevelPoints.push( new THREE.Vector2( pt.x + this.bevelSize, pt.y + this.bevelSize ) );
 
 		}
 		*/
 
-		extract.bezel = bezelPoints;
+		extract.bevel = bevelPoints;
 
 		return extract;
 
@@ -857,7 +857,7 @@ THREE.FontUtils = {
 	extractGlyphPoints : function( c, face, scale, offset, path ) {
 
 		var pts = [];
-		
+
 
 
 		var i, i2,
@@ -1074,10 +1074,10 @@ THREE.FontUtils = {
 				result.push( contour[ b ] );
 				result.push( contour[ c ] );
 				*/
-				result.push( [ contour[ a ], 
+				result.push( [ contour[ a ],
 					contour[ b ],
 					contour[ c ] ] );
-				
+
 
 				vertIndices.push( [ verts[ u ], verts[ v ], verts[ w ] ] );