Browse Source

updating to dev.

Jono Brandel 13 years ago
parent
commit
ef83ebe8f4
100 changed files with 3958 additions and 1233 deletions
  1. 47 3
      README.md
  2. 0 253
      build/custom/ThreeCanvas.js
  3. 0 39
      build/custom/ThreeExtras.js
  4. 0 244
      build/custom/ThreeWebGL.js
  5. 0 0
      build/three.js
  6. 294 0
      build/three.min.js
  7. 3 1
      docs/api/core/Face3.html
  8. 3 1
      docs/api/core/Face4.html
  9. 8 0
      docs/api/core/Object3D.html
  10. 3 3
      docs/api/core/Vector3.html
  11. 9 15
      docs/api/materials/Material.html
  12. 2 2
      docs/index.html
  13. 33 1
      docs/page.js
  14. 1 0
      docs/prettify/prettify.css
  15. 28 0
      docs/prettify/prettify.js
  16. 5 0
      docs/prettify/readme.txt
  17. 15 0
      docs/prettify/threejs.css
  18. 1 1
      examples/canvas_ascii_effect.html
  19. 14 12
      examples/canvas_camera_orthographic.html
  20. 14 11
      examples/canvas_camera_orthographic2.html
  21. 1 1
      examples/canvas_geometry_birds.html
  22. 1 1
      examples/canvas_geometry_cube.html
  23. 1 1
      examples/canvas_geometry_earth.html
  24. 1 1
      examples/canvas_geometry_hierarchy.html
  25. 1 1
      examples/canvas_geometry_panorama.html
  26. 1 1
      examples/canvas_geometry_panorama_fisheye.html
  27. 1 1
      examples/canvas_geometry_terrain.html
  28. 1 1
      examples/canvas_geometry_text.html
  29. 1 1
      examples/canvas_interactive_cubes.html
  30. 1 1
      examples/canvas_interactive_cubes_tween.html
  31. 1 1
      examples/canvas_interactive_particles.html
  32. 22 36
      examples/canvas_interactive_voxelpainter.html
  33. 1 1
      examples/canvas_lights_pointlights.html
  34. 1 1
      examples/canvas_lights_pointlights_smooth.html
  35. 1 1
      examples/canvas_lines.html
  36. 1 1
      examples/canvas_lines_sphere.html
  37. 14 15
      examples/canvas_materials.html
  38. 1 1
      examples/canvas_materials_depth.html
  39. 1 1
      examples/canvas_materials_normal.html
  40. 1 1
      examples/canvas_materials_reflection.html
  41. 1 1
      examples/canvas_materials_video.html
  42. 1 1
      examples/canvas_particles_floor.html
  43. 1 1
      examples/canvas_particles_random.html
  44. 1 1
      examples/canvas_particles_shapes.html
  45. 1 1
      examples/canvas_particles_sprites.html
  46. 1 1
      examples/canvas_particles_waves.html
  47. 14 13
      examples/canvas_performance.html
  48. 14 13
      examples/canvas_sandbox.html
  49. 45 3
      examples/js/ShaderSkin.js
  50. 101 0
      examples/js/loaders/STLLoader.js
  51. 1 1
      examples/misc_camera_fly.html
  52. 1 1
      examples/misc_camera_orbit.html
  53. 1 1
      examples/misc_camera_path.html
  54. 1 1
      examples/misc_camera_roll.html
  55. 1 1
      examples/misc_camera_trackball.html
  56. 1 1
      examples/misc_lights_test.html
  57. 1 1
      examples/misc_lookat.html
  58. 1 1
      examples/misc_software.html
  59. 1 1
      examples/misc_sound.html
  60. 1 1
      examples/misc_ubiquity_test.html
  61. 1 1
      examples/misc_uv_tests.html
  62. 35 0
      examples/models/skinned/knight.js
  63. 2018 0
      examples/models/stl/slotted_disk.stl
  64. BIN
      examples/obj/leeperrysmith/Infinite-Level_02_Disp_NoSmoothUV-4096.jpg
  65. 468 472
      examples/scenes/test_scene.js
  66. 1 1
      examples/webgl_animation_cloth.html
  67. 1 1
      examples/webgl_animation_skinning.html
  68. 330 0
      examples/webgl_animation_skinning_morph.html
  69. 313 0
      examples/webgl_buffergeometry.html
  70. 22 12
      examples/webgl_camera.html
  71. 1 1
      examples/webgl_custom_attributes.html
  72. 1 1
      examples/webgl_custom_attributes_lines.html
  73. 1 1
      examples/webgl_custom_attributes_particles.html
  74. 1 1
      examples/webgl_custom_attributes_particles2.html
  75. 1 1
      examples/webgl_custom_attributes_particles3.html
  76. 1 1
      examples/webgl_geometries.html
  77. 1 1
      examples/webgl_geometries2.html
  78. 2 2
      examples/webgl_geometry_colors.html
  79. 1 1
      examples/webgl_geometry_colors_blender.html
  80. 1 1
      examples/webgl_geometry_convex.html
  81. 1 1
      examples/webgl_geometry_cube.html
  82. 1 1
      examples/webgl_geometry_dynamic.html
  83. 1 1
      examples/webgl_geometry_extrude_shapes.html
  84. 15 16
      examples/webgl_geometry_extrude_splines.html
  85. 1 1
      examples/webgl_geometry_extrude_uvs2.html
  86. 1 1
      examples/webgl_geometry_hierarchy.html
  87. 1 1
      examples/webgl_geometry_hierarchy2.html
  88. 1 1
      examples/webgl_geometry_large_mesh.html
  89. 1 1
      examples/webgl_geometry_minecraft.html
  90. 1 1
      examples/webgl_geometry_minecraft_ao.html
  91. 1 1
      examples/webgl_geometry_shapes.html
  92. 1 1
      examples/webgl_geometry_subdivison.html
  93. 1 1
      examples/webgl_geometry_terrain.html
  94. 1 1
      examples/webgl_geometry_terrain_fog.html
  95. 1 1
      examples/webgl_geometry_tessellation.html
  96. 1 1
      examples/webgl_geometry_text.html
  97. 1 1
      examples/webgl_hdr.html
  98. 1 1
      examples/webgl_interactive_cubes.html
  99. 1 1
      examples/webgl_interactive_cubes_gpu.html
  100. 1 1
      examples/webgl_interactive_draggablecubes.html

+ 47 - 3
README.md

@@ -5,16 +5,16 @@ three.js
 
 The aim of the project is to create a lightweight 3D library with a very low level of complexity — in other words, for dummies. The library provides <canvas>, <svg> and WebGL renderers.
 
-[Examples](http://mrdoob.github.com/three.js/) — [Documentation](http://mrdoob.github.com/three.js/docs/latest/) — [Help](http://stackoverflow.com/questions/tagged/three.js)
+[Examples](http://mrdoob.github.com/three.js/) — [Documentation](http://mrdoob.github.com/three.js/docs/) — [Help](http://stackoverflow.com/questions/tagged/three.js)
 
 
 ### Usage ###
 
-Download the [minified library](http://mrdoob.github.com/three.js/build/Three.js) and include it in your html.
+Download the [minified library](http://mrdoob.github.com/three.js/build/three.min.js) and include it in your html.
 Alternatively see [how to build the library yourself](https://github.com/mrdoob/three.js/wiki/build.py,-or-how-to-generate-a-compressed-Three.js-file). 
 
 ```html
-<script src="js/Three.js"></script>
+<script src="js/three.min.js"></script>
 ```
 
 This code creates a scene, then creates a camera, adds the camera and cube to the scene, creates a &lt;canvas&gt; renderer and adds its viewport in the document.body element.
@@ -65,6 +65,50 @@ This code creates a scene, then creates a camera, adds the camera and cube to th
 
 ### Change log ###
 
+2012 08 15 - **r50** (391,250 KB, gzip: 96,143 KB)
+
+* Experimenting with [SoftwareRenderer](http://pouet.net/topic.php?which=8760&page=1). ([mrdoob](http://github.com/mrdoob) and [rygorous](http://github.com/rygorous))
+* Improved rotation conversion routines. ([WestLangley](http://github.com/WestLangley))
+* Moved `DOMRenderer` and `SVGRenderer` out of common build. ([mrdoob](http://github.com/mrdoob))
+* Improvements to Morph targets. ([alteredq](http://github.com/alteredq) and [gero3](http://github.com/gero3))
+* Added `.deallocateMaterial` method to `WebGLRenderer`. ([alteredq](http://github.com/alteredq))
+* Added `.worldToLocal` and `.localToWorld` methods to `Object3D`. ([zz85](http://github.com/zz85) and [WestLangley](http://github.com/WestLangley))
+* Added `ConvexGeometry`. ([qiao](http://github.com/qiao))
+* Added node.js build system. ([gero3](http://github.com/gero3))
+* Improvements to Blender exporter. ([timbot](http://github.com/timbot) and [alteredq](http://github.com/alteredq))
+* Added uvs and vertex colors support to `ImmediateRenderObjects`. ([alteredq](http://github.com/alteredq))
+* Started implementing `LoadingMonitor` and `EventTarget` in loaders. ([mrdoob](http://github.com/mrdoob))
+* Added `Path.ellipse`. ([linzhp](http://github.com/linzhp))
+* Added `near` and `far` properties to `Ray`. ([niklassa](http://github.com/niklassa))
+* Added `OrbitControls`. ([qiao](http://github.com/qiao), [mrdoob](http://github.com/mrdoob) and [alteredq](http://github.com/alteredq))
+* Completed some more documentation pages. ([mrdoob](http://github.com/mrdoob), [phenomnomnominal](http://github.com/phenomnomnominal), [FuzzYspo0N](http://github.com/FuzzYspo0N), [poeschko](http://github.com/poeschko), [wwwtyro](http://github.com/wwwtyro), [maximeq](http://github.com/maximeq) and [alteredq](http://github.com/alteredq))
+* Completed lots more documentation pages. ([sole](http://github.com/sole))
+* Started reworking [GUI](http://mrdoob.github.com/three.js/gui/). ([mrdoob](http://github.com/mrdoob))
+* Improved python build system. ([gero3](http://github.com/gero3))
+* Made `VTKLoader` parsing more robust. ([mrdoob](http://github.com/mrdoob))
+* Added `recursive` flag to `Ray`. ([mrdoob](http://github.com/mrdoob))
+* Handling resizes properly in controls and examples. ([alteredq](http://github.com/alteredq))
+* Improvements to ColladaLoader. ([spacecookies](http://github.com/spacecookies))
+* Unflipped V coordinate across the whole library. ([mrdoob](http://github.com/mrdoob) and [alteredq](http://github.com/alteredq))
+* Refactored `BufferGeometry`. ([alteredq](http://github.com/alteredq))
+* Improved GL extensions initialisation in `WebGLRenderer`. ([alteredq](http://github.com/alteredq))
+* Rescued `SkinnedMesh`. ([n3tfr34k](http://github.com/n3tfr34k) and [alteredq](http://github.com/alteredq))
+* Made `OBJLoader` parsing more robust. ([Dahie](http://github.com/Dahie))
+* Implemented skinning via floating point textures. ([alteredq](http://github.com/alteredq))
+* Improved documentation system. ([mrdoob](http://github.com/mrdoob) and [alteredq](http://github.com/alteredq))
+* Added support for anisotropic texture filtering and standard derivatives in `WebGLRenderer`. ([alteredq](http://github.com/alteredq))
+* Added support for `ParticleBasicMaterial` without `map` in `CanvasRenderer`. ([mrdoob](http://github.com/mrdoob))
+* `SceneLoader` now supports nested scene graphs and per object custom properties. ([skfcz](http://github.com/skfcz))
+* `Camera` doesn't need to be added to the scene anymore. ([mrdoob](http://github.com/mrdoob))
+* `Object3D`'s `flipSided` and `doubleSided` properties are now `Material`'s `side` property. ([alteredq](http://github.com/alteredq) and [mrdoob](http://github.com/mrdoob))
+* Added `.clone` method to `*Material`. ([gero3](http://github.com/gero3), [mrdoob](http://github.com/mrdoob) and [alteredq](http://github.com/alteredq))
+* [IEWEBGL](http://iewebgl.com/Engines.aspx#ThreeJS) support. ([iewebgl](http://github.com/iewebgl) and [mrdoob](http://github.com/mrdoob))
+* Added `CircleGeometry`. ([hughes](http://github.com/hughes))
+* Added `bumpMap` to `MeshPhongMaterial`. ([alteredq](http://github.com/alteredq))
+* Added `specularMap` to `MeshBasicMaterial`, `MeshLambertMaterial` and `MeshPhongMaterial`. ([alteredq](http://github.com/alteredq))
+* Reworked python build system. ([mrdoob](http://github.com/mrdoob))
+
+
 2012 04 22 - **r49** (364,242 KB, gzip: 89,057 KB)
 
 * Yet more `ColladaLoader` improvements. ([ekitson](http://github.com/ekitson), [AddictArts](http://github.com/AddictArts) and [pblasco](http://github.com/pblasco))

+ 0 - 253
build/custom/ThreeCanvas.js

@@ -1,253 +0,0 @@
-// ThreeCanvas.js - http://github.com/mrdoob/three.js
-'use strict';var THREE=THREE||{REVISION:"50dev"};self.console||(self.console={info:function(){},log:function(){},debug:function(){},warn:function(){},error:function(){}});self.Int32Array||(self.Int32Array=Array,self.Float32Array=Array);
-(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;++c){window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame)window.requestAnimationFrame=function(b){var c=Date.now(),e=Math.max(0,16-(c-a)),g=window.setTimeout(function(){b(c+e)},e);a=c+e;return g};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=
-function(a){clearTimeout(a)}})();THREE.FrontSide=0;THREE.BackSide=1;THREE.DoubleSide=2;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NoBlending=0;THREE.NormalBlending=1;THREE.AdditiveBlending=2;THREE.SubtractiveBlending=3;THREE.MultiplyBlending=4;THREE.CustomBlending=5;THREE.AddEquation=100;THREE.SubtractEquation=101;THREE.ReverseSubtractEquation=102;THREE.ZeroFactor=200;THREE.OneFactor=201;THREE.SrcColorFactor=202;
-THREE.OneMinusSrcColorFactor=203;THREE.SrcAlphaFactor=204;THREE.OneMinusSrcAlphaFactor=205;THREE.DstAlphaFactor=206;THREE.OneMinusDstAlphaFactor=207;THREE.DstColorFactor=208;THREE.OneMinusDstColorFactor=209;THREE.SrcAlphaSaturateFactor=210;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.UVMapping=function(){};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};
-THREE.RepeatWrapping=1E3;THREE.ClampToEdgeWrapping=1001;THREE.MirroredRepeatWrapping=1002;THREE.NearestFilter=1003;THREE.NearestMipMapNearestFilter=1004;THREE.NearestMipMapLinearFilter=1005;THREE.LinearFilter=1006;THREE.LinearMipMapNearestFilter=1007;THREE.LinearMipMapLinearFilter=1008;THREE.UnsignedByteType=1009;THREE.ByteType=1010;THREE.ShortType=1011;THREE.UnsignedShortType=1012;THREE.IntType=1013;THREE.UnsignedIntType=1014;THREE.FloatType=1015;THREE.UnsignedShort4444Type=1016;
-THREE.UnsignedShort5551Type=1017;THREE.UnsignedShort565Type=1018;THREE.AlphaFormat=1019;THREE.RGBFormat=1020;THREE.RGBAFormat=1021;THREE.LuminanceFormat=1022;THREE.LuminanceAlphaFormat=1023;THREE.Color=function(a){a!==void 0&&this.setHex(a);return this};
-THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;this.r=a*a;this.g=b*b;this.b=c*c;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);
-this.b=Math.sqrt(this.b);return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,f,e;if(c===0)this.r=this.g=this.b=0;else{d=Math.floor(a*6);f=a*6-d;a=c*(1-b);e=c*(1-b*f);b=c*(1-b*(1-f));if(d===0){this.r=c;this.g=b;this.b=a}else if(d===1){this.r=e;this.g=c;this.b=a}else if(d===2){this.r=a;this.g=c;this.b=b}else if(d===3){this.r=a;this.g=e;this.b=c}else if(d===4){this.r=b;this.g=a;this.b=c}else if(d===5){this.r=c;this.g=a;this.b=e}}return this},setHex:function(a){a=
-Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},lerpSelf:function(a,b){this.r=this.r+(a.r-this.r)*b;this.g=this.g+(a.g-this.g)*b;this.b=this.b+(a.b-this.b)*b;return this},getHex:function(){return Math.floor(this.r*255)<<16^Math.floor(this.g*255)<<8^Math.floor(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
-THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
-THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x=this.x+a.x;this.y=this.y+a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x=this.x-a.x;this.y=this.y-a.y;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;return this},divideScalar:function(a){if(a){this.x=
-this.x/a;this.y=this.y/a}else this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)},
-lerpSelf:function(a,b){this.x=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y},isZero:function(){return this.lengthSq()<1.0E-4},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0};
-THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addSelf:function(a){this.x=this.x+a.x;this.y=this.y+a.y;this.z=this.z+a.z;return this},addScalar:function(a){this.x=this.x+a;this.y=this.y+
-a;this.z=this.z+a;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},subSelf:function(a){this.x=this.x-a.x;this.y=this.y-a.y;this.z=this.z-a.z;return this},multiply:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},multiplySelf:function(a){this.x=this.x*a.x;this.y=this.y*a.y;this.z=this.z*a.z;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;return this},divideSelf:function(a){this.x=this.x/a.x;this.y=
-this.y/a.y;this.z=this.z/a.z;return this},divideScalar:function(a){if(a){this.x=this.x/a;this.y=this.y/a;this.z=this.z/a}else this.z=this.y=this.x=0;return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.lengthSq())},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},
-setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;this.z=this.z+(a.z-this.z)*b;return this},cross:function(a,b){this.x=a.y*b.z-a.z*b.y;this.y=a.z*b.x-a.x*b.z;this.z=a.x*b.y-a.y*b.x;return this},crossSelf:function(a){var b=this.x,c=this.y,d=this.z;this.x=c*a.z-d*a.y;this.y=d*a.x-b*a.z;this.z=b*a.y-c*a.x;return this},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){return(new THREE.Vector3).sub(this,
-a).lengthSq()},getPositionFromMatrix:function(a){this.x=a.elements[12];this.y=a.elements[13];this.z=a.elements[14];return this},setEulerFromRotationMatrix:function(a,b){function c(a){return Math.min(Math.max(a,-1),1)}var d=a.elements,f=d[0],e=d[4],g=d[8],l=d[1],m=d[5],j=d[9],h=d[2],n=d[6],d=d[10];if(b===void 0||b==="XYZ"){this.y=Math.asin(c(g));if(Math.abs(g)<0.99999){this.x=Math.atan2(-j,d);this.z=Math.atan2(-e,f)}else{this.x=Math.atan2(l,m);this.z=0}}else if(b==="YXZ"){this.x=Math.asin(-c(j));if(Math.abs(j)<
-0.99999){this.y=Math.atan2(g,d);this.z=Math.atan2(l,m)}else{this.y=Math.atan2(-h,f);this.z=0}}else if(b==="ZXY"){this.x=Math.asin(c(n));if(Math.abs(n)<0.99999){this.y=Math.atan2(-h,d);this.z=Math.atan2(-e,m)}else{this.y=0;this.z=Math.atan2(g,f)}}else if(b==="ZYX"){this.y=Math.asin(-c(h));if(Math.abs(h)<0.99999){this.x=Math.atan2(n,d);this.z=Math.atan2(l,f)}else{this.x=0;this.z=Math.atan2(-e,m)}}else if(b==="YZX"){this.z=Math.asin(c(l));if(Math.abs(l)<0.99999){this.x=Math.atan2(-j,m);this.y=Math.atan2(-h,
-f)}else{this.x=0;this.y=Math.atan2(h,d)}}else if(b==="XZY"){this.z=Math.asin(-c(e));if(Math.abs(e)<0.99999){this.x=Math.atan2(n,m);this.y=Math.atan2(g,f)}else{this.x=Math.atan2(-g,d);this.y=0}}return this},setEulerFromQuaternion:function(a,b){function c(a){return Math.min(Math.max(a,-1),1)}var d=a.x*a.x,f=a.y*a.y,e=a.z*a.z,g=a.w*a.w;if(b===void 0||b==="XYZ"){this.x=Math.atan2(2*(a.x*a.w-a.y*a.z),g-d-f+e);this.y=Math.asin(c(2*(a.x*a.z+a.y*a.w)));this.z=Math.atan2(2*(a.z*a.w-a.x*a.y),g+d-f-e)}else if(b===
-"YXZ"){this.x=Math.asin(c(2*(a.x*a.w-a.y*a.z)));this.y=Math.atan2(2*(a.x*a.z+a.y*a.w),g-d-f+e);this.z=Math.atan2(2*(a.x*a.y+a.z*a.w),g-d+f-e)}else if(b==="ZXY"){this.x=Math.asin(c(2*(a.x*a.w+a.y*a.z)));this.y=Math.atan2(2*(a.y*a.w-a.z*a.x),g-d-f+e);this.z=Math.atan2(2*(a.z*a.w-a.x*a.y),g-d+f-e)}else if(b==="ZYX"){this.x=Math.atan2(2*(a.x*a.w+a.z*a.y),g-d-f+e);this.y=Math.asin(c(2*(a.y*a.w-a.x*a.z)));this.z=Math.atan2(2*(a.x*a.y+a.z*a.w),g+d-f-e)}else if(b==="YZX"){this.x=Math.atan2(2*(a.x*a.w-a.z*
-a.y),g-d+f-e);this.y=Math.atan2(2*(a.y*a.w-a.x*a.z),g+d-f-e);this.z=Math.asin(c(2*(a.x*a.y+a.z*a.w)))}else if(b==="XZY"){this.x=Math.atan2(2*(a.x*a.w+a.y*a.z),g-d+f-e);this.y=Math.atan2(2*(a.x*a.z+a.y*a.w),g+d-f-e);this.z=Math.asin(c(2*(a.z*a.w-a.x*a.y)))}return this},getScaleFromMatrix:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length(),a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=
-b;this.y=c;this.z=a;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},isZero:function(){return this.lengthSq()<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?d:1};
-THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w!==void 0?a.w:1;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addSelf:function(a){this.x=this.x+a.x;this.y=this.y+a.y;this.z=this.z+a.z;this.w=this.w+a.w;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x=
-this.x-a.x;this.y=this.y-a.y;this.z=this.z-a.z;this.w=this.w-a.w;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a;return this},divideScalar:function(a){if(a){this.x=this.x/a;this.y=this.y/a;this.z=this.z/a;this.w=this.w/a}else{this.z=this.y=this.x=0;this.w=1}return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},
-normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;this.z=this.z+(a.z-this.z)*b;this.w=this.w+(a.w-this.w)*b;return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);if(b<1.0E-4){this.x=1;this.z=this.y=0}else{this.x=a.x/b;this.y=
-a.y/b;this.z=a.z/b}return this},setAxisAngleFromRotationMatrix:function(a){var b,c,d,a=a.elements,f=a[0];d=a[4];var e=a[8],g=a[1],l=a[5],m=a[9];c=a[2];b=a[6];var j=a[10];if(Math.abs(d-g)<0.01&&Math.abs(e-c)<0.01&&Math.abs(m-b)<0.01){if(Math.abs(d+g)<0.1&&Math.abs(e+c)<0.1&&Math.abs(m+b)<0.1&&Math.abs(f+l+j-3)<0.1){this.set(1,0,0,0);return this}a=Math.PI;f=(f+1)/2;l=(l+1)/2;j=(j+1)/2;d=(d+g)/4;e=(e+c)/4;m=(m+b)/4;if(f>l&&f>j)if(f<0.01){b=0;d=c=0.707106781}else{b=Math.sqrt(f);c=d/b;d=e/b}else if(l>
-j)if(l<0.01){b=0.707106781;c=0;d=0.707106781}else{c=Math.sqrt(l);b=d/c;d=m/c}else if(j<0.01){c=b=0.707106781;d=0}else{d=Math.sqrt(j);b=e/d;c=m/d}this.set(b,c,d,a);return this}a=Math.sqrt((b-m)*(b-m)+(e-c)*(e-c)+(g-d)*(g-d));Math.abs(a)<0.001&&(a=1);this.x=(b-m)/a;this.y=(e-c)/a;this.z=(g-d)/a;this.w=Math.acos((f+l+j-1)/2);return this}};
-THREE.EventTarget=function(){var a={};this.addEventListener=function(b,c){a[b]===void 0&&(a[b]=[]);a[b].indexOf(c)===-1&&a[b].push(c)};this.dispatchEvent=function(b){for(var c in a[b.type])a[b.type][c](b)};this.removeEventListener=function(b,c){var d=a[b].indexOf(c);d!==-1&&a[b].splice(d,1)}};THREE.Frustum=function(){this.planes=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4]};
-THREE.Frustum.prototype.setFromMatrix=function(a){var b=this.planes,c=a.elements,a=c[0],d=c[1],f=c[2],e=c[3],g=c[4],l=c[5],m=c[6],j=c[7],h=c[8],n=c[9],k=c[10],o=c[11],q=c[12],i=c[13],p=c[14],c=c[15];b[0].set(e-a,j-g,o-h,c-q);b[1].set(e+a,j+g,o+h,c+q);b[2].set(e+d,j+l,o+n,c+i);b[3].set(e-d,j-l,o-n,c-i);b[4].set(e-f,j-m,o-k,c-p);b[5].set(e+f,j+m,o+k,c+p);for(d=0;d<6;d++){a=b[d];a.divideScalar(Math.sqrt(a.x*a.x+a.y*a.y+a.z*a.z))}};
-THREE.Frustum.prototype.contains=function(a){for(var b=0,c=this.planes,b=a.matrixWorld,d=b.elements,a=-a.geometry.boundingSphere.radius*b.getMaxScaleOnAxis(),f=0;f<6;f++){b=c[f].x*d[12]+c[f].y*d[13]+c[f].z*d[14]+c[f].w;if(b<=a)return false}return true};THREE.Frustum.__v1=new THREE.Vector3;
-THREE.Ray=function(a,b,c,d){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3;this.near=c||0;this.far=d||Infinity;var f=new THREE.Vector3,e=new THREE.Vector3,g=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3,j=new THREE.Vector3,h=new THREE.Vector3,n=new THREE.Vector3,k=new THREE.Vector3,o=function(a,b){return a.distance-b.distance},q=new THREE.Vector3,i=new THREE.Vector3,p=new THREE.Vector3,r,u,v,B=function(a,b,c){q.sub(c,a);r=q.dot(b);u=i.add(a,p.copy(b).multiplyScalar(r));
-return v=c.distanceTo(u)},x,A,y,E,s,w,C,K,M=function(a,b,c,d){q.sub(d,b);i.sub(c,b);p.sub(a,b);x=q.dot(q);A=q.dot(i);y=q.dot(p);E=i.dot(i);s=i.dot(p);w=1/(x*E-A*A);C=(E*y-A*s)*w;K=(x*s-A*y)*w;return C>=0&&K>=0&&C+K<1},N=1.0E-4;this.setPrecision=function(a){N=a};this.intersectObject=function(a,b){var c,d=[];if(b===true)for(var i=0,q=a.children.length;i<q;i++)Array.prototype.push.apply(d,this.intersectObject(a.children[i],b));if(a instanceof THREE.Particle){v=B(this.origin,this.direction,a.matrixWorld.getPosition());
-if(v>a.scale.x)return[];c={distance:v,point:a.position,face:null,object:a};d.push(c)}else if(a instanceof THREE.Mesh){i=THREE.Frustum.__v1.set(a.matrixWorld.getColumnX().length(),a.matrixWorld.getColumnY().length(),a.matrixWorld.getColumnZ().length());i=a.geometry.boundingSphere.radius*Math.max(i.x,Math.max(i.y,i.z));v=B(this.origin,this.direction,a.matrixWorld.getPosition());if(v>i)return d;var z,p,r=a.geometry,J=r.vertices,s;a.matrixRotationWorld.extractRotation(a.matrixWorld);i=0;for(q=r.faces.length;i<
-q;i++){c=r.faces[i];m.copy(this.origin);j.copy(this.direction);s=a.matrixWorld;h=s.multiplyVector3(h.copy(c.centroid)).subSelf(m);n=a.matrixRotationWorld.multiplyVector3(n.copy(c.normal));z=j.dot(n);if(!(Math.abs(z)<N)){p=n.dot(h)/z;if(!(p<0)&&(a.doubleSided||(a.flipSided?z>0:z<0))){k.add(m,j.multiplyScalar(p));v=m.distanceTo(k);if(!(v<this.near)&&!(v>this.far))if(c instanceof THREE.Face3){f=s.multiplyVector3(f.copy(J[c.a]));e=s.multiplyVector3(e.copy(J[c.b]));g=s.multiplyVector3(g.copy(J[c.c]));
-if(M(k,f,e,g)){c={distance:v,point:k.clone(),face:c,faceIndex:i,object:a};d.push(c)}}else if(c instanceof THREE.Face4){f=s.multiplyVector3(f.copy(J[c.a]));e=s.multiplyVector3(e.copy(J[c.b]));g=s.multiplyVector3(g.copy(J[c.c]));l=s.multiplyVector3(l.copy(J[c.d]));if(M(k,f,e,l)||M(k,e,g,l)){c={distance:v,point:k.clone(),face:c,faceIndex:i,object:a};d.push(c)}}}}}}d.sort(o);return d};this.intersectObjects=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)Array.prototype.push.apply(c,this.intersectObject(a[d],
-b));c.sort(o);return c}};
-THREE.Rectangle=function(){function a(){e=d-b;g=f-c}var b=0,c=0,d=0,f=0,e=0,g=0,l=true;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return e};this.getHeight=function(){return g};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return f};this.set=function(e,g,h,n){l=false;b=e;c=g;d=h;f=n;a()};this.addPoint=function(e,g){if(l===true){l=false;b=e;c=g;d=e;f=g}else{b=b<e?b:e;c=c<g?c:
-g;d=d>e?d:e;f=f>g?f:g}a()};this.add3Points=function(e,g,h,n,k,o){if(l===true){l=false;b=e<h?e<k?e:k:h<k?h:k;c=g<n?g<o?g:o:n<o?n:o;d=e>h?e>k?e:k:h>k?h:k;f=g>n?g>o?g:o:n>o?n:o}else{b=e<h?e<k?e<b?e:b:k<b?k:b:h<k?h<b?h:b:k<b?k:b;c=g<n?g<o?g<c?g:c:o<c?o:c:n<o?n<c?n:c:o<c?o:c;d=e>h?e>k?e>d?e:d:k>d?k:d:h>k?h>d?h:d:k>d?k:d;f=g>n?g>o?g>f?g:f:o>f?o:f:n>o?n>f?n:f:o>f?o:f}a()};this.addRectangle=function(e){if(l===true){l=false;b=e.getLeft();c=e.getTop();d=e.getRight();f=e.getBottom()}else{b=b<e.getLeft()?b:e.getLeft();
-c=c<e.getTop()?c:e.getTop();d=d>e.getRight()?d:e.getRight();f=f>e.getBottom()?f:e.getBottom()}a()};this.inflate=function(e){b=b-e;c=c-e;d=d+e;f=f+e;a()};this.minSelf=function(e){b=b>e.getLeft()?b:e.getLeft();c=c>e.getTop()?c:e.getTop();d=d<e.getRight()?d:e.getRight();f=f<e.getBottom()?f:e.getBottom();a()};this.intersects=function(a){return d<a.getLeft()||b>a.getRight()||f<a.getTop()||c>a.getBottom()?false:true};this.empty=function(){l=true;f=d=c=b=0;a()};this.isEmpty=function(){return l}};
-THREE.Math={clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},mapLinear:function(a,b,c,d,f){return d+(a-b)*(f-d)/(c-b)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(0.5-Math.random())},sign:function(a){return a<0?-1:a>0?1:0}};THREE.Matrix3=function(){this.elements=new Float32Array(9)};
-THREE.Matrix3.prototype={constructor:THREE.Matrix3,getInverse:function(a){var b=a.elements,a=b[10]*b[5]-b[6]*b[9],c=-b[10]*b[1]+b[2]*b[9],d=b[6]*b[1]-b[2]*b[5],f=-b[10]*b[4]+b[6]*b[8],e=b[10]*b[0]-b[2]*b[8],g=-b[6]*b[0]+b[2]*b[4],l=b[9]*b[4]-b[5]*b[8],m=-b[9]*b[0]+b[1]*b[8],j=b[5]*b[0]-b[1]*b[4],b=b[0]*a+b[1]*f+b[2]*l;b===0&&console.warn("Matrix3.getInverse(): determinant == 0");var b=1/b,h=this.elements;h[0]=b*a;h[1]=b*c;h[2]=b*d;h[3]=b*f;h[4]=b*e;h[5]=b*g;h[6]=b*l;h[7]=b*m;h[8]=b*j;return this},
-transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};THREE.Matrix4=function(a,b,c,d,f,e,g,l,m,j,h,n,k,o,q,i){this.elements=new Float32Array(16);this.set(a!==void 0?a:1,b||0,c||0,d||0,f||0,e!==void 0?e:1,g||0,l||0,m||0,j||0,h!==void 0?h:1,n||0,k||0,o||0,q||0,i!==void 0?i:1)};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,f,e,g,l,m,j,h,n,k,o,q,i){var p=this.elements;p[0]=a;p[4]=b;p[8]=c;p[12]=d;p[1]=f;p[5]=e;p[9]=g;p[13]=l;p[2]=m;p[6]=j;p[10]=h;p[14]=n;p[3]=k;p[7]=o;p[11]=q;p[15]=i;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15]);return this},lookAt:function(a,b,c){var d=this.elements,
-f=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;f.cross(c,g).normalize();if(f.length()===0){g.x=g.x+1.0E-4;f.cross(c,g).normalize()}e.cross(g,f);d[0]=f.x;d[4]=e.x;d[8]=g.x;d[1]=f.y;d[5]=e.y;d[9]=g.y;d[2]=f.z;d[6]=e.z;d[10]=g.z;return this},multiply:function(a,b){var c=a.elements,d=b.elements,f=this.elements,e=c[0],g=c[4],l=c[8],m=c[12],j=c[1],h=c[5],n=c[9],k=c[13],o=c[2],q=c[6],i=c[10],p=c[14],r=c[3],u=c[7],v=c[11],c=c[15],B=d[0],x=d[4],
-A=d[8],y=d[12],E=d[1],s=d[5],w=d[9],C=d[13],K=d[2],M=d[6],N=d[10],t=d[14],G=d[3],I=d[7],O=d[11],d=d[15];f[0]=e*B+g*E+l*K+m*G;f[4]=e*x+g*s+l*M+m*I;f[8]=e*A+g*w+l*N+m*O;f[12]=e*y+g*C+l*t+m*d;f[1]=j*B+h*E+n*K+k*G;f[5]=j*x+h*s+n*M+k*I;f[9]=j*A+h*w+n*N+k*O;f[13]=j*y+h*C+n*t+k*d;f[2]=o*B+q*E+i*K+p*G;f[6]=o*x+q*s+i*M+p*I;f[10]=o*A+q*w+i*N+p*O;f[14]=o*y+q*C+i*t+p*d;f[3]=r*B+u*E+v*K+c*G;f[7]=r*x+u*s+v*M+c*I;f[11]=r*A+u*w+v*N+c*O;f[15]=r*y+u*C+v*t+c*d;return this},multiplySelf:function(a){return this.multiply(this,
-a)},multiplyToArray:function(a,b,c){var d=this.elements;this.multiply(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]=b[0]*a;b[4]=b[4]*a;b[8]=b[8]*a;b[12]=b[12]*a;b[1]=b[1]*a;b[5]=b[5]*a;b[9]=b[9]*a;b[13]=b[13]*a;b[2]=b[2]*a;b[6]=b[6]*a;b[10]=b[10]*a;b[14]=b[14]*a;b[3]=b[3]*a;b[7]=b[7]*a;b[11]=b[11]*a;b[15]=
-b[15]*a;return this},multiplyVector3:function(a){var b=this.elements,c=a.x,d=a.y,f=a.z,e=1/(b[3]*c+b[7]*d+b[11]*f+b[15]);a.x=(b[0]*c+b[4]*d+b[8]*f+b[12])*e;a.y=(b[1]*c+b[5]*d+b[9]*f+b[13])*e;a.z=(b[2]*c+b[6]*d+b[10]*f+b[14])*e;return a},multiplyVector4:function(a){var b=this.elements,c=a.x,d=a.y,f=a.z,e=a.w;a.x=b[0]*c+b[4]*d+b[8]*f+b[12]*e;a.y=b[1]*c+b[5]*d+b[9]*f+b[13]*e;a.z=b[2]*c+b[6]*d+b[10]*f+b[14]*e;a.w=b[3]*c+b[7]*d+b[11]*f+b[15]*e;return a},multiplyVector3Array:function(a){for(var b=THREE.Matrix4.__v1,
-c=0,d=a.length;c<d;c=c+3){b.x=a[c];b.y=a[c+1];b.z=a[c+2];this.multiplyVector3(b);a[c]=b.x;a[c+1]=b.y;a[c+2]=b.z}return a},rotateAxis:function(a){var b=this.elements,c=a.x,d=a.y,f=a.z;a.x=c*b[0]+d*b[4]+f*b[8];a.y=c*b[1]+d*b[5]+f*b[9];a.z=c*b[2]+d*b[6]+f*b[10];a.normalize();return a},crossVector:function(a){var b=this.elements,c=new THREE.Vector4;c.x=b[0]*a.x+b[4]*a.y+b[8]*a.z+b[12]*a.w;c.y=b[1]*a.x+b[5]*a.y+b[9]*a.z+b[13]*a.w;c.z=b[2]*a.x+b[6]*a.y+b[10]*a.z+b[14]*a.w;c.w=a.w?b[3]*a.x+b[7]*a.y+b[11]*
-a.z+b[15]*a.w:1;return c},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],f=a[12],e=a[1],g=a[5],l=a[9],m=a[13],j=a[2],h=a[6],n=a[10],k=a[14],o=a[3],q=a[7],i=a[11],a=a[15];return f*l*h*o-d*m*h*o-f*g*n*o+c*m*n*o+d*g*k*o-c*l*k*o-f*l*j*q+d*m*j*q+f*e*n*q-b*m*n*q-d*e*k*q+b*l*k*q+f*g*j*i-c*m*j*i-f*e*h*i+b*m*h*i+c*e*k*i-b*g*k*i-d*g*j*a+c*l*j*a+d*e*h*a-b*l*h*a-c*e*n*a+b*g*n*a},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;
-b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];a[9]=b[9];a[10]=b[10];a[11]=b[11];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return a},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=
-c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[12],a[13],a[14])},setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getColumnX:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[0],a[1],a[2])},getColumnY:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[4],a[5],a[6])},getColumnZ:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[8],
-a[9],a[10])},getInverse:function(a){var b=this.elements,c=a.elements,d=c[0],f=c[4],e=c[8],g=c[12],l=c[1],m=c[5],j=c[9],h=c[13],n=c[2],k=c[6],o=c[10],q=c[14],i=c[3],p=c[7],r=c[11],c=c[15];b[0]=j*q*p-h*o*p+h*k*r-m*q*r-j*k*c+m*o*c;b[4]=g*o*p-e*q*p-g*k*r+f*q*r+e*k*c-f*o*c;b[8]=e*h*p-g*j*p+g*m*r-f*h*r-e*m*c+f*j*c;b[12]=g*j*k-e*h*k-g*m*o+f*h*o+e*m*q-f*j*q;b[1]=h*o*i-j*q*i-h*n*r+l*q*r+j*n*c-l*o*c;b[5]=e*q*i-g*o*i+g*n*r-d*q*r-e*n*c+d*o*c;b[9]=g*j*i-e*h*i-g*l*r+d*h*r+e*l*c-d*j*c;b[13]=e*h*n-g*j*n+g*l*o-d*
-h*o-e*l*q+d*j*q;b[2]=m*q*i-h*k*i+h*n*p-l*q*p-m*n*c+l*k*c;b[6]=g*k*i-f*q*i-g*n*p+d*q*p+f*n*c-d*k*c;b[10]=f*h*i-g*m*i+g*l*p-d*h*p-f*l*c+d*m*c;b[14]=g*m*n-f*h*n-g*l*k+d*h*k+f*l*q-d*m*q;b[3]=j*k*i-m*o*i-j*n*p+l*o*p+m*n*r-l*k*r;b[7]=f*o*i-e*k*i+e*n*p-d*o*p-f*n*r+d*k*r;b[11]=e*m*i-f*j*i-e*l*p+d*j*p+f*l*r-d*m*r;b[15]=f*j*n-e*m*n+e*l*k-d*j*k-f*l*o+d*m*o;this.multiplyScalar(1/a.determinant());return this},setRotationFromEuler:function(a,b){var c=this.elements,d=a.x,f=a.y,e=a.z,g=Math.cos(d),d=Math.sin(d),
-l=Math.cos(f),f=Math.sin(f),m=Math.cos(e),e=Math.sin(e);if(b===void 0||b==="XYZ"){var j=g*m,h=g*e,n=d*m,k=d*e;c[0]=l*m;c[4]=-l*e;c[8]=f;c[1]=h+n*f;c[5]=j-k*f;c[9]=-d*l;c[2]=k-j*f;c[6]=n+h*f;c[10]=g*l}else if(b==="YXZ"){j=l*m;h=l*e;n=f*m;k=f*e;c[0]=j+k*d;c[4]=n*d-h;c[8]=g*f;c[1]=g*e;c[5]=g*m;c[9]=-d;c[2]=h*d-n;c[6]=k+j*d;c[10]=g*l}else if(b==="ZXY"){j=l*m;h=l*e;n=f*m;k=f*e;c[0]=j-k*d;c[4]=-g*e;c[8]=n+h*d;c[1]=h+n*d;c[5]=g*m;c[9]=k-j*d;c[2]=-g*f;c[6]=d;c[10]=g*l}else if(b==="ZYX"){j=g*m;h=g*e;n=d*m;
-k=d*e;c[0]=l*m;c[4]=n*f-h;c[8]=j*f+k;c[1]=l*e;c[5]=k*f+j;c[9]=h*f-n;c[2]=-f;c[6]=d*l;c[10]=g*l}else if(b==="YZX"){j=g*l;h=g*f;n=d*l;k=d*f;c[0]=l*m;c[4]=k-j*e;c[8]=n*e+h;c[1]=e;c[5]=g*m;c[9]=-d*m;c[2]=-f*m;c[6]=h*e+n;c[10]=j-k*e}else if(b==="XZY"){j=g*l;h=g*f;n=d*l;k=d*f;c[0]=l*m;c[4]=-e;c[8]=f*m;c[1]=j*e+k;c[5]=g*m;c[9]=h*e-n;c[2]=n*e-h;c[6]=d*m;c[10]=k*e+j}return this},setRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,f=a.z,e=a.w,g=c+c,l=d+d,m=f+f,a=c*g,j=c*l,c=c*m,h=d*l,d=d*
-m,f=f*m,g=e*g,l=e*l,e=e*m;b[0]=1-(h+f);b[4]=j-e;b[8]=c+l;b[1]=j+e;b[5]=1-(a+f);b[9]=d-g;b[2]=c-l;b[6]=d+g;b[10]=1-(a+h);return this},compose:function(a,b,c){var d=this.elements,f=THREE.Matrix4.__m1,e=THREE.Matrix4.__m2;f.identity();f.setRotationFromQuaternion(b);e.makeScale(c.x,c.y,c.z);this.multiply(f,e);d[12]=a.x;d[13]=a.y;d[14]=a.z;return this},decompose:function(a,b,c){var d=this.elements,f=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;f.set(d[0],d[1],d[2]);e.set(d[4],d[5],d[6]);
-g.set(d[8],d[9],d[10]);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=f.length();c.y=e.length();c.z=g.length();a.x=d[12];a.y=d[13];a.z=d[14];d=THREE.Matrix4.__m1;d.copy(this);d.elements[0]=d.elements[0]/c.x;d.elements[1]=d.elements[1]/c.x;d.elements[2]=d.elements[2]/c.x;d.elements[4]=d.elements[4]/c.y;d.elements[5]=d.elements[5]/c.y;d.elements[6]=d.elements[6]/c.y;d.elements[8]=d.elements[8]/
-c.z;d.elements[9]=d.elements[9]/c.z;d.elements[10]=d.elements[10]/c.z;b.setFromRotationMatrix(d);return[a,b,c]},extractPosition:function(a){var b=this.elements,a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractRotation:function(a){var b=this.elements,a=a.elements,c=THREE.Matrix4.__v1,d=1/c.set(a[0],a[1],a[2]).length(),f=1/c.set(a[4],a[5],a[6]).length(),c=1/c.set(a[8],a[9],a[10]).length();b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[4]=a[4]*f;b[5]=a[5]*f;b[6]=a[6]*f;b[8]=a[8]*c;b[9]=a[9]*
-c;b[10]=a[10]*c;return this},translate:function(a){var b=this.elements,c=a.x,d=a.y,a=a.z;b[12]=b[0]*c+b[4]*d+b[8]*a+b[12];b[13]=b[1]*c+b[5]*d+b[9]*a+b[13];b[14]=b[2]*c+b[6]*d+b[10]*a+b[14];b[15]=b[3]*c+b[7]*d+b[11]*a+b[15];return this},rotateX:function(a){var b=this.elements,c=b[4],d=b[5],f=b[6],e=b[7],g=b[8],l=b[9],m=b[10],j=b[11],h=Math.cos(a),a=Math.sin(a);b[4]=h*c+a*g;b[5]=h*d+a*l;b[6]=h*f+a*m;b[7]=h*e+a*j;b[8]=h*g-a*c;b[9]=h*l-a*d;b[10]=h*m-a*f;b[11]=h*j-a*e;return this},rotateY:function(a){var b=
-this.elements,c=b[0],d=b[1],f=b[2],e=b[3],g=b[8],l=b[9],m=b[10],j=b[11],h=Math.cos(a),a=Math.sin(a);b[0]=h*c-a*g;b[1]=h*d-a*l;b[2]=h*f-a*m;b[3]=h*e-a*j;b[8]=h*g+a*c;b[9]=h*l+a*d;b[10]=h*m+a*f;b[11]=h*j+a*e;return this},rotateZ:function(a){var b=this.elements,c=b[0],d=b[1],f=b[2],e=b[3],g=b[4],l=b[5],m=b[6],j=b[7],h=Math.cos(a),a=Math.sin(a);b[0]=h*c+a*g;b[1]=h*d+a*l;b[2]=h*f+a*m;b[3]=h*e+a*j;b[4]=h*g-a*c;b[5]=h*l-a*d;b[6]=h*m-a*f;b[7]=h*j-a*e;return this},rotateByAxis:function(a,b){var c=this.elements;
-if(a.x===1&&a.y===0&&a.z===0)return this.rotateX(b);if(a.x===0&&a.y===1&&a.z===0)return this.rotateY(b);if(a.x===0&&a.y===0&&a.z===1)return this.rotateZ(b);var d=a.x,f=a.y,e=a.z,g=Math.sqrt(d*d+f*f+e*e),d=d/g,f=f/g,e=e/g,g=d*d,l=f*f,m=e*e,j=Math.cos(b),h=Math.sin(b),n=1-j,k=d*f*n,o=d*e*n,n=f*e*n,d=d*h,q=f*h,h=e*h,e=g+(1-g)*j,g=k+h,f=o-q,k=k-h,l=l+(1-l)*j,h=n+d,o=o+q,n=n-d,m=m+(1-m)*j,j=c[0],d=c[1],q=c[2],i=c[3],p=c[4],r=c[5],u=c[6],v=c[7],B=c[8],x=c[9],A=c[10],y=c[11];c[0]=e*j+g*p+f*B;c[1]=e*d+g*
-r+f*x;c[2]=e*q+g*u+f*A;c[3]=e*i+g*v+f*y;c[4]=k*j+l*p+h*B;c[5]=k*d+l*r+h*x;c[6]=k*q+l*u+h*A;c[7]=k*i+l*v+h*y;c[8]=o*j+n*p+m*B;c[9]=o*d+n*r+m*x;c[10]=o*q+n*u+m*A;c[11]=o*i+n*v+m*y;return this},scale:function(a){var b=this.elements,c=a.x,d=a.y,a=a.z;b[0]=b[0]*c;b[4]=b[4]*d;b[8]=b[8]*a;b[1]=b[1]*c;b[5]=b[5]*d;b[9]=b[9]*a;b[2]=b[2]*c;b[6]=b[6]*d;b[10]=b[10]*a;b[3]=b[3]*c;b[7]=b[7]*d;b[11]=b[11]*a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+
-a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);
-return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),f=1-c,e=a.x,g=a.y,l=a.z,m=f*e,j=f*g;this.set(m*e+c,m*g-d*l,m*l+d*g,0,m*g+d*l,j*g+c,j*l-d*e,0,m*l-d*g,j*l+d*e,f*l*l+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},makeFrustum:function(a,b,c,d,f,e){var g=this.elements;g[0]=2*f/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*f/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(e+f)/(e-f);g[14]=-2*e*f/(e-f);g[3]=
-0;g[7]=0;g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){var a=c*Math.tan(a*Math.PI/360),f=-a;return this.makeFrustum(f*b,a*b,f,a,c,d)},makeOrthographic:function(a,b,c,d,f,e){var g=this.elements,l=b-a,m=c-d,j=e-f;g[0]=2/l;g[4]=0;g[8]=0;g[12]=-((b+a)/l);g[1]=0;g[5]=2/m;g[9]=0;g[13]=-((c+d)/m);g[2]=0;g[6]=0;g[10]=-2/j;g[14]=-((e+f)/j);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},clone:function(){var a=this.elements;return new THREE.Matrix4(a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],
-a[6],a[10],a[14],a[3],a[7],a[11],a[15])}};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
-THREE.Object3D=function(){this.id=THREE.Object3DCount++;this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.renderDepth=null;this.rotationAutoUpdate=true;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=true;this.quaternion=new THREE.Quaternion;
-this.useQuaternion=false;this.boundRadius=0;this.boundRadiusScale=1;this.visible=true;this.receiveShadow=this.castShadow=false;this.frustumCulled=true;this._vector=new THREE.Vector3};
-THREE.Object3D.prototype={constructor:THREE.Object3D,applyMatrix:function(a){this.matrix.multiply(a,this.matrix);this.scale.getScaleFromMatrix(this.matrix);this.rotation.setEulerFromRotationMatrix((new THREE.Matrix4).extractRotation(this.matrix),this.eulerOrder);this.position.getPositionFromMatrix(this.matrix)},translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,
-this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder)},add:function(a){if(a===this)console.warn("THREE.Object3D.add: An object can't be added as a child of itself.");else if(a instanceof THREE.Object3D){a.parent!==void 0&&a.parent.remove(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=
-b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__addObject(a)}},remove:function(a){var b=this.children.indexOf(a);if(b!==-1){a.parent=void 0;this.children.splice(b,1);for(b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__removeObject(a)}},getChildByName:function(a,b){var c,d,f;c=0;for(d=this.children.length;c<d;c++){f=this.children[c];if(f.name===a)return f;if(b){f=f.getChildByName(a,b);if(f!==void 0)return f}}},updateMatrix:function(){this.matrix.setPosition(this.position);
-this.useQuaternion===true?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1){this.matrix.scale(this.scale);this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z))}this.matrixWorldNeedsUpdate=true},updateMatrixWorld:function(a){this.matrixAutoUpdate===true&&this.updateMatrix();if(this.matrixWorldNeedsUpdate===true||a===true){this.parent!==void 0?this.matrixWorld.multiply(this.parent.matrixWorld,
-this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=false;a=true}for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},worldToLocal:function(a){return THREE.Object3D.__m1.getInverse(this.matrixWorld).multiplyVector3(a)},localToWorld:function(a){return this.matrixWorld.multiplyVector3(a)},clone:function(){}};THREE.Object3D.__m1=new THREE.Matrix4;THREE.Object3DCount=0;
-THREE.Projector=function(){function a(a,c){g=0;A.objects.length=0;A.sprites.length=0;A.lights.length=0;var f=function(a){if(a.visible!==false){if((a instanceof THREE.Mesh||a instanceof THREE.Line)&&(a.frustumCulled===false||C.contains(a)===true)){y.copy(a.matrixWorld.getPosition());s.multiplyVector3(y);e=b();e.object=a;e.z=y.z;A.objects.push(e)}else if(a instanceof THREE.Sprite||a instanceof THREE.Particle){y.copy(a.matrixWorld.getPosition());s.multiplyVector3(y);e=b();e.object=a;e.z=y.z;A.sprites.push(e)}else a instanceof
-THREE.Light&&A.lights.push(a);for(var c=0,d=a.children.length;c<d;c++)f(a.children[c])}};f(a);c===true&&A.objects.sort(d);return A}function b(){var a;if(g===l.length){a=new THREE.RenderableObject;l.push(a)}else a=l[g];g++;return a}function c(){var a;if(j===h.length){a=new THREE.RenderableVertex;h.push(a)}else a=h[j];j++;return a}function d(a,b){return b.z-a.z}function f(a,b){var c=0,d=1,e=a.z+a.w,g=b.z+b.w,f=-a.z+a.w,h=-b.z+b.w;if(e>=0&&g>=0&&f>=0&&h>=0)return true;if(e<0&&g<0||f<0&&h<0)return false;
-e<0?c=Math.max(c,e/(e-g)):g<0&&(d=Math.min(d,e/(e-g)));f<0?c=Math.max(c,f/(f-h)):h<0&&(d=Math.min(d,f/(f-h)));if(d<c)return false;a.lerpSelf(b,c);b.lerpSelf(a,1-d);return true}var e,g,l=[],m,j,h=[],n,k,o=[],q,i=[],p,r,u=[],v,B,x=[],A={objects:[],sprites:[],lights:[],elements:[]},y=new THREE.Vector3,E=new THREE.Vector4,s=new THREE.Matrix4,w=new THREE.Matrix4,C=new THREE.Frustum,K=new THREE.Vector4,M=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);s.multiply(b.projectionMatrix,
-b.matrixWorldInverse);s.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);s.multiply(b.matrixWorld,b.projectionMatrixInverse);s.multiplyVector3(a);return a};this.pickingRay=function(a,b){var c;a.z=-1;c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Ray(a,c)};this.projectScene=function(b,e,g){var l=e.near,y=e.far,P=false,R,z,$,aa,J,S,W,D,F,H,L,Q,la,T,ca,
-U,da;B=r=q=k=0;A.elements.length=0;b.updateMatrixWorld();e.parent===void 0&&e.updateMatrixWorld();e.matrixWorldInverse.getInverse(e.matrixWorld);s.multiply(e.projectionMatrix,e.matrixWorldInverse);C.setFromMatrix(s);A=a(b,false);b=0;for(R=A.objects.length;b<R;b++){F=A.objects[b].object;H=F.matrixWorld;j=0;if(F instanceof THREE.Mesh){L=F.geometry;Q=F.geometry.materials;aa=L.vertices;la=L.faces;ca=L.faceVertexUvs;L=F.matrixRotationWorld.extractRotation(H);da=F.material instanceof THREE.MeshFaceMaterial;
-z=0;for($=aa.length;z<$;z++){m=c();m.positionWorld.copy(aa[z]);H.multiplyVector3(m.positionWorld);m.positionScreen.copy(m.positionWorld);s.multiplyVector4(m.positionScreen);m.positionScreen.x=m.positionScreen.x/m.positionScreen.w;m.positionScreen.y=m.positionScreen.y/m.positionScreen.w;m.visible=m.positionScreen.z>l&&m.positionScreen.z<y}aa=0;for(z=la.length;aa<z;aa++){D=la[aa];$=da===true?Q[D.materialIndex]:F.material;if($!==void 0){W=$.side;if(D instanceof THREE.Face3){J=h[D.a];S=h[D.b];T=h[D.c];
-if(J.visible===true&&S.visible===true&&T.visible===true){P=(T.positionScreen.x-J.positionScreen.x)*(S.positionScreen.y-J.positionScreen.y)-(T.positionScreen.y-J.positionScreen.y)*(S.positionScreen.x-J.positionScreen.x)<0;if(W===THREE.DoubleSide||P===(W===THREE.FrontSide)){U=void 0;if(k===o.length){U=new THREE.RenderableFace3;o.push(U)}else U=o[k];k++;n=U;n.v1.copy(J);n.v2.copy(S);n.v3.copy(T)}else continue}else continue}else if(D instanceof THREE.Face4){J=h[D.a];S=h[D.b];T=h[D.c];U=h[D.d];if(J.visible===
-true&&S.visible===true&&T.visible===true&&U.visible===true){P=(U.positionScreen.x-J.positionScreen.x)*(S.positionScreen.y-J.positionScreen.y)-(U.positionScreen.y-J.positionScreen.y)*(S.positionScreen.x-J.positionScreen.x)<0||(S.positionScreen.x-T.positionScreen.x)*(U.positionScreen.y-T.positionScreen.y)-(S.positionScreen.y-T.positionScreen.y)*(U.positionScreen.x-T.positionScreen.x)<0;if(W===THREE.DoubleSide||P===(W===THREE.FrontSide)){var fa=void 0;if(q===i.length){fa=new THREE.RenderableFace4;i.push(fa)}else fa=
-i[q];q++;n=fa;n.v1.copy(J);n.v2.copy(S);n.v3.copy(T);n.v4.copy(U)}else continue}else continue}n.normalWorld.copy(D.normal);P===false&&(W===THREE.BackSide||W===THREE.DoubleSide)&&n.normalWorld.negate();L.multiplyVector3(n.normalWorld);n.centroidWorld.copy(D.centroid);H.multiplyVector3(n.centroidWorld);n.centroidScreen.copy(n.centroidWorld);s.multiplyVector3(n.centroidScreen);D=D.vertexNormals;J=0;for(S=D.length;J<S;J++){T=n.vertexNormalsWorld[J];T.copy(D[J]);P===false&&(W===THREE.BackSide||W===THREE.DoubleSide)&&
-T.negate();L.multiplyVector3(T)}J=0;for(S=ca.length;J<S;J++){T=ca[J][aa];if(T!==void 0){W=0;for(D=T.length;W<D;W++)n.uvs[J][W]=T[W]}}n.material=$;n.z=n.centroidScreen.z;A.elements.push(n)}}}else if(F instanceof THREE.Line){w.multiply(s,H);aa=F.geometry.vertices;J=c();J.positionScreen.copy(aa[0]);w.multiplyVector4(J.positionScreen);H=F.type===THREE.LinePieces?2:1;z=1;for($=aa.length;z<$;z++){J=c();J.positionScreen.copy(aa[z]);w.multiplyVector4(J.positionScreen);if(!((z+1)%H>0)){S=h[j-2];K.copy(J.positionScreen);
-M.copy(S.positionScreen);if(f(K,M)===true){K.multiplyScalar(1/K.w);M.multiplyScalar(1/M.w);Q=void 0;if(r===u.length){Q=new THREE.RenderableLine;u.push(Q)}else Q=u[r];r++;p=Q;p.v1.positionScreen.copy(K);p.v2.positionScreen.copy(M);p.z=Math.max(K.z,M.z);p.material=F.material;A.elements.push(p)}}}}}b=0;for(R=A.sprites.length;b<R;b++){F=A.sprites[b].object;H=F.matrixWorld;if(F instanceof THREE.Particle){E.set(H.elements[12],H.elements[13],H.elements[14],1);s.multiplyVector4(E);E.z=E.z/E.w;if(E.z>0&&E.z<
-1){l=void 0;if(B===x.length){l=new THREE.RenderableParticle;x.push(l)}else l=x[B];B++;v=l;v.object=F;v.x=E.x/E.w;v.y=E.y/E.w;v.z=E.z;v.rotation=F.rotation.z;v.scale.x=F.scale.x*Math.abs(v.x-(E.x+e.projectionMatrix.elements[0])/(E.w+e.projectionMatrix.elements[12]));v.scale.y=F.scale.y*Math.abs(v.y-(E.y+e.projectionMatrix.elements[5])/(E.w+e.projectionMatrix.elements[13]));v.material=F.material;A.elements.push(v)}}}g&&A.elements.sort(d);return A}};
-THREE.Quaternion=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?d:1};
-THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a,b){var c=Math.cos(a.x/2),d=Math.cos(a.y/2),f=Math.cos(a.z/2),e=Math.sin(a.x/2),g=Math.sin(a.y/2),l=Math.sin(a.z/2);if(b===void 0||b==="XYZ"){this.x=e*d*f+c*g*l;this.y=c*g*f-e*d*l;this.z=c*d*l+e*g*f;this.w=c*d*f-e*g*l}else if(b==="YXZ"){this.x=e*d*f+c*g*l;this.y=c*g*f-e*d*l;this.z=
-c*d*l-e*g*f;this.w=c*d*f+e*g*l}else if(b==="ZXY"){this.x=e*d*f-c*g*l;this.y=c*g*f+e*d*l;this.z=c*d*l+e*g*f;this.w=c*d*f-e*g*l}else if(b==="ZYX"){this.x=e*d*f-c*g*l;this.y=c*g*f+e*d*l;this.z=c*d*l-e*g*f;this.w=c*d*f+e*g*l}else if(b==="YZX"){this.x=e*d*f+c*g*l;this.y=c*g*f+e*d*l;this.z=c*d*l-e*g*f;this.w=c*d*f-e*g*l}else if(b==="XZY"){this.x=e*d*f-c*g*l;this.y=c*g*f-e*d*l;this.z=c*d*l+e*g*f;this.w=c*d*f+e*g*l}return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this.x=a.x*d;this.y=a.y*
-d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0],a=b[4],d=b[8],f=b[1],e=b[5],g=b[9],l=b[2],m=b[6],b=b[10],j=c+e+b;if(j>0){c=0.5/Math.sqrt(j+1);this.w=0.25/c;this.x=(m-g)*c;this.y=(d-l)*c;this.z=(f-a)*c}else if(c>e&&c>b){c=2*Math.sqrt(1+c-e-b);this.w=(m-g)/c;this.x=0.25*c;this.y=(a+f)/c;this.z=(d+l)/c}else if(e>b){c=2*Math.sqrt(1+e-c-b);this.w=(d-l)/c;this.x=(a+f)/c;this.y=0.25*c;this.z=(g+m)/c}else{c=2*Math.sqrt(1+b-c-e);this.w=(f-a)/c;this.x=
-(d+l)/c;this.y=(g+m)/c;this.z=0.25*c}return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x=this.x*-1;this.y=this.y*-1;this.z=this.z*-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a===0)this.w=this.z=this.y=this.x=0;else{a=1/a;this.x=this.x*a;this.y=
-this.y*a;this.z=this.z*a;this.w=this.w*a}return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,f=this.w,e=a.x,g=a.y,l=a.z,a=a.w;this.x=b*a+f*e+c*l-d*g;this.y=c*a+f*g+d*e-b*l;this.z=d*a+f*l+b*g-c*e;this.w=f*a-b*e-c*g-d*l;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,f=a.z,
-e=this.x,g=this.y,l=this.z,m=this.w,j=m*c+g*f-l*d,h=m*d+l*c-e*f,n=m*f+e*d-g*c,c=-e*c-g*d-l*f;b.x=j*m+c*-e+h*-l-n*-g;b.y=h*m+c*-g+n*-e-j*-l;b.z=n*m+c*-l+j*-g-h*-e;return b},slerpSelf:function(a,b){var c=this.x,d=this.y,f=this.z,e=this.w,g=e*a.w+c*a.x+d*a.y+f*a.z;if(g<0){this.w=-a.w;this.x=-a.x;this.y=-a.y;this.z=-a.z;g=-g}else this.copy(a);if(g>=1){this.w=e;this.x=c;this.y=d;this.z=f;return this}var l=Math.acos(g),m=Math.sqrt(1-g*g);if(Math.abs(m)<0.001){this.w=0.5*(e+this.w);this.x=0.5*(c+this.x);
-this.y=0.5*(d+this.y);this.z=0.5*(f+this.z);return this}g=Math.sin((1-b)*l)/m;l=Math.sin(b*l)/m;this.w=e*g+this.w*l;this.x=c*g+this.x*l;this.y=d*g+this.y*l;this.z=f*g+this.z*l;return this},clone:function(){return new THREE.Quaternion(this.x,this.y,this.z,this.w)}};
-THREE.Quaternion.slerp=function(a,b,c,d){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(f<0){c.w=-b.w;c.x=-b.x;c.y=-b.y;c.z=-b.z;f=-f}else c.copy(b);if(Math.abs(f)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var b=Math.acos(f),e=Math.sqrt(1-f*f);if(Math.abs(e)<0.001){c.w=0.5*(a.w+c.w);c.x=0.5*(a.x+c.x);c.y=0.5*(a.y+c.y);c.z=0.5*(a.z+c.z);return c}f=Math.sin((1-d)*b)/e;d=Math.sin(d*b)/e;c.w=a.w*f+c.w*d;c.x=a.x*f+c.x*d;c.y=a.y*f+c.y*d;c.z=a.z*f+c.z*d;return c};
-THREE.Vertex=function(a){console.warn("THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead.");return a};THREE.Face3=function(a,b,c,d,f,e){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=e;this.centroid=new THREE.Vector3};
-THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
-return a}};THREE.Face4=function(a,b,c,d,f,e,g){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};
-THREE.Face4.prototype={constructor:THREE.Face4,clone:function(){var a=new THREE.Face4(this.a,this.b,this.c,this.d);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
-return a}};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},lerpSelf:function(a,b){this.u=this.u+(a.u-this.u)*b;this.v=this.v+(a.v-this.v)*b;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
-THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.name="";this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=false;this.dynamic=true};
-THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a);for(var c=0,d=this.vertices.length;c<d;c++)a.multiplyVector3(this.vertices[c]);c=0;for(d=this.faces.length;c<d;c++){var f=this.faces[c];b.multiplyVector3(f.normal);for(var e=0,g=f.vertexNormals.length;e<g;e++)b.multiplyVector3(f.vertexNormals[e]);a.multiplyVector3(f.centroid)}},computeCentroids:function(){var a,b,c;a=0;for(b=this.faces.length;a<b;a++){c=this.faces[a];c.centroid.set(0,
-0,0);if(c instanceof THREE.Face3){c.centroid.addSelf(this.vertices[c.a]);c.centroid.addSelf(this.vertices[c.b]);c.centroid.addSelf(this.vertices[c.c]);c.centroid.divideScalar(3)}else if(c instanceof THREE.Face4){c.centroid.addSelf(this.vertices[c.a]);c.centroid.addSelf(this.vertices[c.b]);c.centroid.addSelf(this.vertices[c.c]);c.centroid.addSelf(this.vertices[c.d]);c.centroid.divideScalar(4)}}},computeFaceNormals:function(){var a,b,c,d,f,e,g=new THREE.Vector3,l=new THREE.Vector3;a=0;for(b=this.faces.length;a<
-b;a++){c=this.faces[a];d=this.vertices[c.a];f=this.vertices[c.b];e=this.vertices[c.c];g.sub(e,f);l.sub(d,f);g.crossSelf(l);g.isZero()||g.normalize();c.normal.copy(g)}},computeVertexNormals:function(){var a,b,c,d;if(this.__tmpVertices===void 0){d=this.__tmpVertices=Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)d[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++){c=this.faces[a];if(c instanceof THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];
-else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}}else{d=this.__tmpVertices;a=0;for(b=this.vertices.length;a<b;a++)d[a].set(0,0,0)}a=0;for(b=this.faces.length;a<b;a++){c=this.faces[a];if(c instanceof THREE.Face3){d[c.a].addSelf(c.normal);d[c.b].addSelf(c.normal);d[c.c].addSelf(c.normal)}else if(c instanceof THREE.Face4){d[c.a].addSelf(c.normal);d[c.b].addSelf(c.normal);d[c.c].addSelf(c.normal);d[c.d].addSelf(c.normal)}}a=0;
-for(b=this.vertices.length;a<b;a++)d[a].normalize();a=0;for(b=this.faces.length;a<b;a++){c=this.faces[a];if(c instanceof THREE.Face3){c.vertexNormals[0].copy(d[c.a]);c.vertexNormals[1].copy(d[c.b]);c.vertexNormals[2].copy(d[c.c])}else if(c instanceof THREE.Face4){c.vertexNormals[0].copy(d[c.a]);c.vertexNormals[1].copy(d[c.b]);c.vertexNormals[2].copy(d[c.c]);c.vertexNormals[3].copy(d[c.d])}}},computeMorphNormals:function(){var a,b,c,d,f;c=0;for(d=this.faces.length;c<d;c++){f=this.faces[c];f.__originalFaceNormal?
-f.__originalFaceNormal.copy(f.normal):f.__originalFaceNormal=f.normal.clone();if(!f.__originalVertexNormals)f.__originalVertexNormals=[];a=0;for(b=f.vertexNormals.length;a<b;a++)f.__originalVertexNormals[a]?f.__originalVertexNormals[a].copy(f.vertexNormals[a]):f.__originalVertexNormals[a]=f.vertexNormals[a].clone()}var e=new THREE.Geometry;e.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=
-[];var g=this.morphNormals[a].faceNormals,l=this.morphNormals[a].vertexNormals,m,j;c=0;for(d=this.faces.length;c<d;c++){f=this.faces[c];m=new THREE.Vector3;j=f instanceof THREE.Face3?{a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3}:{a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3,d:new THREE.Vector3};g.push(m);l.push(j)}}g=this.morphNormals[a];e.vertices=this.morphTargets[a].vertices;e.computeFaceNormals();e.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++){f=this.faces[c];
-m=g.faceNormals[c];j=g.vertexNormals[c];m.copy(f.normal);if(f instanceof THREE.Face3){j.a.copy(f.vertexNormals[0]);j.b.copy(f.vertexNormals[1]);j.c.copy(f.vertexNormals[2])}else{j.a.copy(f.vertexNormals[0]);j.b.copy(f.vertexNormals[1]);j.c.copy(f.vertexNormals[2]);j.d.copy(f.vertexNormals[3])}}}c=0;for(d=this.faces.length;c<d;c++){f=this.faces[c];f.normal=f.__originalFaceNormal;f.vertexNormals=f.__originalVertexNormals}},computeTangents:function(){function a(a,b,c,d,e,f,t){l=a.vertices[b];m=a.vertices[c];
-j=a.vertices[d];h=g[e];n=g[f];k=g[t];o=m.x-l.x;q=j.x-l.x;i=m.y-l.y;p=j.y-l.y;r=m.z-l.z;u=j.z-l.z;v=n.u-h.u;B=k.u-h.u;x=n.v-h.v;A=k.v-h.v;y=1/(v*A-B*x);C.set((A*o-x*q)*y,(A*i-x*p)*y,(A*r-x*u)*y);K.set((v*q-B*o)*y,(v*p-B*i)*y,(v*u-B*r)*y);s[b].addSelf(C);s[c].addSelf(C);s[d].addSelf(C);w[b].addSelf(K);w[c].addSelf(K);w[d].addSelf(K)}var b,c,d,f,e,g,l,m,j,h,n,k,o,q,i,p,r,u,v,B,x,A,y,E,s=[],w=[],C=new THREE.Vector3,K=new THREE.Vector3,M=new THREE.Vector3,N=new THREE.Vector3,t=new THREE.Vector3;b=0;for(c=
-this.vertices.length;b<c;b++){s[b]=new THREE.Vector3;w[b]=new THREE.Vector3}b=0;for(c=this.faces.length;b<c;b++){e=this.faces[b];g=this.faceVertexUvs[0][b];if(e instanceof THREE.Face3)a(this,e.a,e.b,e.c,0,1,2);else if(e instanceof THREE.Face4){a(this,e.a,e.b,e.d,0,1,3);a(this,e.b,e.c,e.d,1,2,3)}}var G=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){e=this.faces[b];for(d=0;d<e.vertexNormals.length;d++){t.copy(e.vertexNormals[d]);f=e[G[d]];E=s[f];M.copy(E);M.subSelf(t.multiplyScalar(t.dot(E))).normalize();
-N.cross(e.vertexNormals[d],E);f=N.dot(w[f]);f=f<0?-1:1;e.vertexTangents[d]=new THREE.Vector4(M.x,M.y,M.z,f)}}this.hasTangents=true},computeBoundingBox:function(){if(!this.boundingBox)this.boundingBox={min:new THREE.Vector3,max:new THREE.Vector3};if(this.vertices.length>0){var a;a=this.vertices[0];this.boundingBox.min.copy(a);this.boundingBox.max.copy(a);for(var b=this.boundingBox.min,c=this.boundingBox.max,d=1,f=this.vertices.length;d<f;d++){a=this.vertices[d];if(a.x<b.x)b.x=a.x;else if(a.x>c.x)c.x=
-a.x;if(a.y<b.y)b.y=a.y;else if(a.y>c.y)c.y=a.y;if(a.z<b.z)b.z=a.z;else if(a.z>c.z)c.z=a.z}}else{this.boundingBox.min.set(0,0,0);this.boundingBox.max.set(0,0,0)}},computeBoundingSphere:function(){if(!this.boundingSphere)this.boundingSphere={radius:0};for(var a,b=0,c=0,d=this.vertices.length;c<d;c++){a=this.vertices[c].length();a>b&&(b=a)}this.boundingSphere.radius=b},mergeVertices:function(){var a={},b=[],c=[],d,f=Math.pow(10,4),e,g,l,m;e=0;for(g=this.vertices.length;e<g;e++){d=this.vertices[e];d=
-[Math.round(d.x*f),Math.round(d.y*f),Math.round(d.z*f)].join("_");if(a[d]===void 0){a[d]=e;b.push(this.vertices[e]);c[e]=b.length-1}else c[e]=c[a[d]]}e=0;for(g=this.faces.length;e<g;e++){a=this.faces[e];if(a instanceof THREE.Face3){a.a=c[a.a];a.b=c[a.b];a.c=c[a.c]}else if(a instanceof THREE.Face4){a.a=c[a.a];a.b=c[a.b];a.c=c[a.c];a.d=c[a.d];d=[a.a,a.b,a.c,a.d];for(f=3;f>0;f--)if(d.indexOf(a["abcd"[f]])!==f){d.splice(f,1);this.faces[e]=new THREE.Face3(d[0],d[1],d[2],a.normal,a.color,a.materialIndex);
-d=0;for(l=this.faceVertexUvs.length;d<l;d++)(m=this.faceVertexUvs[d][e])&&m.splice(f,1);this.faces[e].vertexColors=a.vertexColors;break}}}c=this.vertices.length-b.length;this.vertices=b;return c},clone:function(){}};THREE.GeometryCount=0;THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);
-THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,this.up);this.rotationAutoUpdate===true&&this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder)};THREE.OrthographicCamera=function(a,b,c,d,f,e){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=f!==void 0?f:0.1;this.far=e!==void 0?e:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);
-THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=a!==void 0?a:50;this.aspect=b!==void 0?b:1;this.near=c!==void 0?c:0.1;this.far=d!==void 0?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);
-THREE.PerspectiveCamera.prototype.setLens=function(a,b){this.fov=2*Math.atan((b!==void 0?b:24)/(a*2))*(180/Math.PI);this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,f,e){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=f;this.height=e;this.updateProjectionMatrix()};
-THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)};
-THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=Object.create(THREE.Object3D.prototype);THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype);
-THREE.DirectionalLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0;this.onlyShadow=this.castShadow=false;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=false;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;
-this.shadowCascade=false;this.shadowCascadeOffset=new THREE.Vector3(0,0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,0.99,0.998];this.shadowCascadeFarZ=[0.99,0.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype);
-THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,0,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.PointLight.prototype=Object.create(THREE.Light.prototype);THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
-THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:"anonymous",addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var b="Loaded ",b=a.total?b+((100*a.loaded/
-a.total).toFixed(0)+"%"):b+((a.loaded/1E3).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlBase:function(a){a=a.split("/");a.pop();return(a.length<1?".":a.join("/"))+"/"},initMaterials:function(a,b,c){a.materials=[];for(var d=0;d<b.length;++d)a.materials[d]=THREE.Loader.prototype.createMaterial(b[d],c)},hasNormals:function(a){var b,c,d=a.materials.length;for(c=0;c<d;c++){b=a.materials[c];if(b instanceof THREE.ShaderMaterial)return true}return false},createMaterial:function(a,b){function c(a){a=
-Math.log(a)/Math.LN2;return Math.floor(a)==a}function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function f(a,b){var e=new Image;e.onload=function(){if(!c(this.width)||!c(this.height)){var b=d(this.width),e=d(this.height);a.image.width=b;a.image.height=e;a.image.getContext("2d").drawImage(this,0,0,b,e)}else a.image=this;a.needsUpdate=true};e.crossOrigin=l.crossOrigin;e.src=b}function e(a,c,d,e,g,h){var l=document.createElement("canvas");a[c]=new THREE.Texture(l);a[c].sourceFile=
-d;if(e){a[c].repeat.set(e[0],e[1]);if(e[0]!=1)a[c].wrapS=THREE.RepeatWrapping;if(e[1]!=1)a[c].wrapT=THREE.RepeatWrapping}g&&a[c].offset.set(g[0],g[1]);if(h){e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(e[h[0]]!==void 0)a[c].wrapS=e[h[0]];if(e[h[1]]!==void 0)a[c].wrapT=e[h[1]]}f(a[c],b+"/"+d)}function g(a){return(a[0]*255<<16)+(a[1]*255<<8)+a[2]*255}var l=this,m="MeshLambertMaterial",j={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:false};if(a.shading){var h=
-a.shading.toLowerCase();h==="phong"?m="MeshPhongMaterial":h==="basic"&&(m="MeshBasicMaterial")}if(a.blending!==void 0&&THREE[a.blending]!==void 0)j.blending=THREE[a.blending];if(a.transparent!==void 0||a.opacity<1)j.transparent=a.transparent;if(a.depthTest!==void 0)j.depthTest=a.depthTest;if(a.depthWrite!==void 0)j.depthWrite=a.depthWrite;if(a.visible!==void 0)j.visible=a.visible;if(a.flipSided!==void 0)j.side=THREE.BackSide;if(a.doubleSided!==void 0)j.side=THREE.DoubleSide;if(a.wireframe!==void 0)j.wireframe=
-a.wireframe;if(a.vertexColors!==void 0)if(a.vertexColors=="face")j.vertexColors=THREE.FaceColors;else if(a.vertexColors)j.vertexColors=THREE.VertexColors;if(a.colorDiffuse)j.color=g(a.colorDiffuse);else if(a.DbgColor)j.color=a.DbgColor;if(a.colorSpecular)j.specular=g(a.colorSpecular);if(a.colorAmbient)j.ambient=g(a.colorAmbient);if(a.transparency)j.opacity=a.transparency;if(a.specularCoef)j.shininess=a.specularCoef;a.mapDiffuse&&b&&e(j,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap);
-a.mapLight&&b&&e(j,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap);a.mapNormal&&b&&e(j,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap);a.mapSpecular&&b&&e(j,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap);if(a.mapNormal){m=THREE.ShaderUtils.lib.normal;h=THREE.UniformsUtils.clone(m.uniforms);h.tNormal.texture=j.normalMap;if(a.mapNormalFactor)h.uNormalScale.value=a.mapNormalFactor;if(j.map){h.tDiffuse.texture=
-j.map;h.enableDiffuse.value=true}if(j.specularMap){h.tSpecular.texture=j.specularMap;h.enableSpecular.value=true}if(j.lightMap){h.tAO.texture=j.lightMap;h.enableAO.value=true}h.uDiffuseColor.value.setHex(j.color);h.uSpecularColor.value.setHex(j.specular);h.uAmbientColor.value.setHex(j.ambient);h.uShininess.value=j.shininess;if(j.opacity!==void 0)h.uOpacity.value=j.opacity;j=new THREE.ShaderMaterial({fragmentShader:m.fragmentShader,vertexShader:m.vertexShader,uniforms:h,lights:true,fog:true})}else j=
-new THREE[m](j);if(a.DbgName!==void 0)j.name=a.DbgName;return j}};THREE.BinaryLoader=function(a){THREE.Loader.call(this,a)};THREE.BinaryLoader.prototype=Object.create(THREE.Loader.prototype);THREE.BinaryLoader.prototype.load=function(a,b,c,d){var c=c?c:this.extractUrlBase(a),d=d?d:this.extractUrlBase(a),f=this.showProgress?THREE.Loader.prototype.updateProgress:null;this.onLoadStart();this.loadAjaxJSON(this,a,b,c,d,f)};
-THREE.BinaryLoader.prototype.loadAjaxJSON=function(a,b,c,d,f,e){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(g.readyState==4)if(g.status==200||g.status==0){var l=JSON.parse(g.responseText);a.loadAjaxBuffers(l,c,f,d,e)}else console.error("THREE.BinaryLoader: Couldn't load ["+b+"] ["+g.status+"]")};g.open("GET",b,true);g.overrideMimeType&&g.overrideMimeType("text/plain; charset=x-user-defined");g.setRequestHeader("Content-Type","text/plain");g.send(null)};
-THREE.BinaryLoader.prototype.loadAjaxBuffers=function(a,b,c,d,f){var e=new XMLHttpRequest,g=c+"/"+a.buffers,l=0;e.onreadystatechange=function(){if(e.readyState==4)if(e.status==200||e.status==0){var c=e.response;if(c===void 0)c=(new Uint8Array(e.responseBody)).buffer;THREE.BinaryLoader.prototype.createBinModel(c,b,d,a.materials)}else console.error("THREE.BinaryLoader: Couldn't load ["+g+"] ["+e.status+"]");else if(e.readyState==3){if(f){l==0&&(l=e.getResponseHeader("Content-Length"));f({total:l,loaded:e.responseText.length})}}else e.readyState==
-2&&(l=e.getResponseHeader("Content-Length"))};e.open("GET",g,true);e.responseType="arraybuffer";e.send(null)};
-THREE.BinaryLoader.prototype.createBinModel=function(a,b,c,d){var f=function(b){var c,f,m,j,h,n,k,o,q,i,p,r,u,v,B;function x(a){return a%4?4-a%4:0}function A(a,b){return(new Uint8Array(a,b,1))[0]}function y(a,b){return(new Uint32Array(a,b,1))[0]}function E(b,c){var d,e,g,f,h,l,j,i,m=new Uint32Array(a,c,3*b);for(d=0;d<b;d++){e=m[d*3];g=m[d*3+1];f=m[d*3+2];h=I[e*2];e=I[e*2+1];l=I[g*2];j=I[g*2+1];g=I[f*2];i=I[f*2+1];f=N.faceVertexUvs[0];var k=[];k.push(new THREE.UV(h,e));k.push(new THREE.UV(l,j));k.push(new THREE.UV(g,
-i));f.push(k)}}function s(b,c){var d,e,g,f,h,l,j,m,i,k,n=new Uint32Array(a,c,4*b);for(d=0;d<b;d++){e=n[d*4];g=n[d*4+1];f=n[d*4+2];h=n[d*4+3];l=I[e*2];e=I[e*2+1];j=I[g*2];i=I[g*2+1];m=I[f*2];k=I[f*2+1];f=I[h*2];g=I[h*2+1];h=N.faceVertexUvs[0];var o=[];o.push(new THREE.UV(l,e));o.push(new THREE.UV(j,i));o.push(new THREE.UV(m,k));o.push(new THREE.UV(f,g));h.push(o)}}function w(b,c,d){for(var e,g,f,h,c=new Uint32Array(a,c,3*b),l=new Uint16Array(a,d,b),d=0;d<b;d++){e=c[d*3];g=c[d*3+1];f=c[d*3+2];h=l[d];
-N.faces.push(new THREE.Face3(e,g,f,null,null,h))}}function C(b,c,d){for(var e,g,f,h,l,c=new Uint32Array(a,c,4*b),j=new Uint16Array(a,d,b),d=0;d<b;d++){e=c[d*4];g=c[d*4+1];f=c[d*4+2];h=c[d*4+3];l=j[d];N.faces.push(new THREE.Face4(e,g,f,h,null,null,l))}}function K(b,c,d,e){for(var g,f,h,l,j,m,i,c=new Uint32Array(a,c,3*b),d=new Uint32Array(a,d,3*b),k=new Uint16Array(a,e,b),e=0;e<b;e++){g=c[e*3];f=c[e*3+1];h=c[e*3+2];j=d[e*3];m=d[e*3+1];i=d[e*3+2];l=k[e];var n=G[m*3],o=G[m*3+1];m=G[m*3+2];var p=G[i*3],
-q=G[i*3+1];i=G[i*3+2];N.faces.push(new THREE.Face3(g,f,h,[new THREE.Vector3(G[j*3],G[j*3+1],G[j*3+2]),new THREE.Vector3(n,o,m),new THREE.Vector3(p,q,i)],null,l))}}function M(b,c,d,e){for(var g,f,h,l,j,m,i,k,n,c=new Uint32Array(a,c,4*b),d=new Uint32Array(a,d,4*b),o=new Uint16Array(a,e,b),e=0;e<b;e++){g=c[e*4];f=c[e*4+1];h=c[e*4+2];l=c[e*4+3];m=d[e*4];i=d[e*4+1];k=d[e*4+2];n=d[e*4+3];j=o[e];var p=G[i*3],q=G[i*3+1];i=G[i*3+2];var r=G[k*3],s=G[k*3+1];k=G[k*3+2];var t=G[n*3],w=G[n*3+1];n=G[n*3+2];N.faces.push(new THREE.Face4(g,
-f,h,l,[new THREE.Vector3(G[m*3],G[m*3+1],G[m*3+2]),new THREE.Vector3(p,q,i),new THREE.Vector3(r,s,k),new THREE.Vector3(t,w,n)],null,j))}}var N=this,t=0,G=[],I=[],O,P,R;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(N,d,b);(function(a,b,c){for(var a=new Uint8Array(a,b,c),d="",e=0;e<c;e++)d=d+String.fromCharCode(a[b+e]);return d})(a,t,12);c=A(a,t+12);A(a,t+13);A(a,t+14);A(a,t+15);f=A(a,t+16);m=A(a,t+17);j=A(a,t+18);h=A(a,t+19);n=y(a,t+20);k=y(a,t+20+4);o=y(a,t+20+8);b=y(a,t+20+12);q=
-y(a,t+20+16);i=y(a,t+20+20);p=y(a,t+20+24);r=y(a,t+20+28);u=y(a,t+20+32);v=y(a,t+20+36);B=y(a,t+20+40);t=t+c;c=f*3+h;R=f*4+h;O=b*c;P=q*(c+m*3);f=i*(c+j*3);h=p*(c+m*3+j*3);c=r*R;m=u*(R+m*4);j=v*(R+j*4);t=t+function(b){var b=new Float32Array(a,b,n*3),c,d,e,g;for(c=0;c<n;c++){d=b[c*3];e=b[c*3+1];g=b[c*3+2];N.vertices.push(new THREE.Vector3(d,e,g))}return n*3*Float32Array.BYTES_PER_ELEMENT}(t);t=t+function(b){if(k){var b=new Int8Array(a,b,k*3),c,d,e,g;for(c=0;c<k;c++){d=b[c*3];e=b[c*3+1];g=b[c*3+2];G.push(d/
-127,e/127,g/127)}}return k*3*Int8Array.BYTES_PER_ELEMENT}(t);t=t+x(k*3);t=t+function(b){if(o){var b=new Float32Array(a,b,o*2),c,d,e;for(c=0;c<o;c++){d=b[c*2];e=b[c*2+1];I.push(d,e)}}return o*2*Float32Array.BYTES_PER_ELEMENT}(t);O=t+O+x(b*2);P=O+P+x(q*2);f=P+f+x(i*2);h=f+h+x(p*2);c=h+c+x(r*2);m=c+m+x(u*2);j=m+j+x(v*2);(function(a){if(i){var b=a+i*Uint32Array.BYTES_PER_ELEMENT*3;w(i,a,b+i*Uint32Array.BYTES_PER_ELEMENT*3);E(i,b)}})(P);(function(a){if(p){var b=a+p*Uint32Array.BYTES_PER_ELEMENT*3,c=b+
-p*Uint32Array.BYTES_PER_ELEMENT*3;K(p,a,b,c+p*Uint32Array.BYTES_PER_ELEMENT*3);E(p,c)}})(f);(function(a){if(v){var b=a+v*Uint32Array.BYTES_PER_ELEMENT*4;C(v,a,b+v*Uint32Array.BYTES_PER_ELEMENT*4);s(v,b)}})(m);(function(a){if(B){var b=a+B*Uint32Array.BYTES_PER_ELEMENT*4,c=b+B*Uint32Array.BYTES_PER_ELEMENT*4;M(B,a,b,c+B*Uint32Array.BYTES_PER_ELEMENT*4);s(B,c)}})(j);b&&w(b,t,t+b*Uint32Array.BYTES_PER_ELEMENT*3);(function(a){if(q){var b=a+q*Uint32Array.BYTES_PER_ELEMENT*3;K(q,a,b,b+q*Uint32Array.BYTES_PER_ELEMENT*
-3)}})(O);r&&C(r,h,h+r*Uint32Array.BYTES_PER_ELEMENT*4);(function(a){if(u){var b=a+u*Uint32Array.BYTES_PER_ELEMENT*4;M(u,a,b,b+u*Uint32Array.BYTES_PER_ELEMENT*4)}})(c);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};f.prototype=Object.create(THREE.Geometry.prototype);b(new f(c))};THREE.ImageLoader=function(){THREE.EventTarget.call(this);this.crossOrigin=null};
-THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b){var c=this;b===void 0&&(b=new Image);b.addEventListener("load",function(){c.dispatchEvent({type:"load",content:b})},false);b.addEventListener("error",function(){c.dispatchEvent({type:"error",message:"Couldn't load URL ["+a+"]"})},false);if(c.crossOrigin)b.crossOrigin=c.crossOrigin;b.src=a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);
-THREE.JSONLoader.prototype.load=function(a,b,c){c=c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
-THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,f){var e=new XMLHttpRequest,g=0;e.onreadystatechange=function(){if(e.readyState===e.DONE)if(e.status===200||e.status===0){if(e.responseText){var l=JSON.parse(e.responseText);a.createModel(l,c,d)}else console.warn("THREE.JSONLoader: ["+b+"] seems to be unreachable or file there is empty");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load ["+b+"] ["+e.status+"]");else if(e.readyState===e.LOADING){if(f){g===0&&(g=e.getResponseHeader("Content-Length"));
-f({total:g,loaded:e.responseText.length})}}else e.readyState===e.HEADERS_RECEIVED&&(g=e.getResponseHeader("Content-Length"))};e.open("GET",b,true);e.overrideMimeType&&e.overrideMimeType("text/plain; charset=x-user-defined");e.setRequestHeader("Content-Type","text/plain");e.send(null)};
-THREE.JSONLoader.prototype.createModel=function(a,b,c){var d=new THREE.Geometry,f=a.scale!==void 0?1/a.scale:1;this.initMaterials(d,a.materials,c);(function(b){var c,f,m,j,h,n,k,o,q,i,p,r,u,v,B=a.faces;n=a.vertices;var x=a.normals,A=a.colors,y=0;for(c=0;c<a.uvs.length;c++)a.uvs[c].length&&y++;for(c=0;c<y;c++){d.faceUvs[c]=[];d.faceVertexUvs[c]=[]}j=0;for(h=n.length;j<h;){k=new THREE.Vector3;k.x=n[j++]*b;k.y=n[j++]*b;k.z=n[j++]*b;d.vertices.push(k)}j=0;for(h=B.length;j<h;){b=B[j++];n=b&1;m=b&2;c=b&
-4;f=b&8;o=b&16;k=b&32;i=b&64;b=b&128;if(n){p=new THREE.Face4;p.a=B[j++];p.b=B[j++];p.c=B[j++];p.d=B[j++];n=4}else{p=new THREE.Face3;p.a=B[j++];p.b=B[j++];p.c=B[j++];n=3}if(m){m=B[j++];p.materialIndex=m}m=d.faces.length;if(c)for(c=0;c<y;c++){r=a.uvs[c];q=B[j++];v=r[q*2];q=r[q*2+1];d.faceUvs[c][m]=new THREE.UV(v,q)}if(f)for(c=0;c<y;c++){r=a.uvs[c];u=[];for(f=0;f<n;f++){q=B[j++];v=r[q*2];q=r[q*2+1];u[f]=new THREE.UV(v,q)}d.faceVertexUvs[c][m]=u}if(o){o=B[j++]*3;f=new THREE.Vector3;f.x=x[o++];f.y=x[o++];
-f.z=x[o];p.normal=f}if(k)for(c=0;c<n;c++){o=B[j++]*3;f=new THREE.Vector3;f.x=x[o++];f.y=x[o++];f.z=x[o];p.vertexNormals.push(f)}if(i){k=B[j++];k=new THREE.Color(A[k]);p.color=k}if(b)for(c=0;c<n;c++){k=B[j++];k=new THREE.Color(A[k]);p.vertexColors.push(k)}d.faces.push(p)}})(f);(function(){var b,c,f,m;if(a.skinWeights){b=0;for(c=a.skinWeights.length;b<c;b=b+2){f=a.skinWeights[b];m=a.skinWeights[b+1];d.skinWeights.push(new THREE.Vector4(f,m,0,0))}}if(a.skinIndices){b=0;for(c=a.skinIndices.length;b<c;b=
-b+2){f=a.skinIndices[b];m=a.skinIndices[b+1];d.skinIndices.push(new THREE.Vector4(f,m,0,0))}}d.bones=a.bones;d.animation=a.animation})();(function(b){if(a.morphTargets!==void 0){var c,f,m,j,h,n;c=0;for(f=a.morphTargets.length;c<f;c++){d.morphTargets[c]={};d.morphTargets[c].name=a.morphTargets[c].name;d.morphTargets[c].vertices=[];h=d.morphTargets[c].vertices;n=a.morphTargets[c].vertices;m=0;for(j=n.length;m<j;m=m+3){var k=new THREE.Vector3;k.x=n[m]*b;k.y=n[m+1]*b;k.z=n[m+2]*b;h.push(k)}}}if(a.morphColors!==
-void 0){c=0;for(f=a.morphColors.length;c<f;c++){d.morphColors[c]={};d.morphColors[c].name=a.morphColors[c].name;d.morphColors[c].colors=[];j=d.morphColors[c].colors;h=a.morphColors[c].colors;b=0;for(m=h.length;b<m;b=b+3){n=new THREE.Color(16755200);n.setRGB(h[b],h[b+1],h[b+2]);j.push(n)}}}})(f);d.computeCentroids();d.computeFaceNormals();this.hasNormals(d)&&d.computeTangents();b(d)};THREE.GeometryLoader=function(){THREE.EventTarget.call(this);this.path=this.crossOrigin=null};
-THREE.GeometryLoader.prototype={constructor:THREE.GeometryLoader,load:function(a){var b=this,c=null;if(b.path===null){var d=a.split("/");d.pop();b.path=d.length<1?".":d.join("/")}d=new XMLHttpRequest;d.addEventListener("load",function(d){d.target.responseText?c=b.parse(JSON.parse(d.target.responseText),f):b.dispatchEvent({type:"error",message:"Invalid file ["+a+"]"})},false);d.addEventListener("error",function(){b.dispatchEvent({type:"error",message:"Couldn't load URL ["+a+"]"})},false);d.open("GET",
-a,true);d.send(null);var f=new THREE.LoadingMonitor;f.addEventListener("load",function(){b.dispatchEvent({type:"load",content:c})});f.add(d)},parse:function(a,b){var c=this,d=new THREE.Geometry,f=a.scale!==void 0?1/a.scale:1;if(a.materials){d.materials=[];for(var e=0;e<a.materials.length;++e){var g=a.materials[e],l=function(a){a=Math.log(a)/Math.LN2;return Math.floor(a)==a},m=function(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))},j=function(a,d,e,f,g,h){a[d]=new THREE.Texture;a[d].sourceFile=
-e;if(f){a[d].repeat.set(f[0],f[1]);if(f[0]!=1)a[d].wrapS=THREE.RepeatWrapping;if(f[1]!=1)a[d].wrapT=THREE.RepeatWrapping}g&&a[d].offset.set(g[0],g[1]);if(h){f={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(f[h[0]]!==void 0)a[d].wrapS=f[h[0]];if(f[h[1]]!==void 0)a[d].wrapT=f[h[1]]}var j=a[d],a=new THREE.ImageLoader;a.addEventListener("load",function(a){a=a.content;if(!l(a.width)||!l(a.height)){var b=m(a.width),c=m(a.height);j.image=document.createElement("canvas");j.image.width=
-b;j.image.height=c;j.image.getContext("2d").drawImage(a,0,0,b,c)}else j.image=a;j.needsUpdate=true});a.crossOrigin=c.crossOrigin;a.load(c.path+"/"+e);b&&b.add(a)},h=function(a){return(a[0]*255<<16)+(a[1]*255<<8)+a[2]*255},n="MeshLambertMaterial",k={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:false};if(g.shading){var o=g.shading.toLowerCase();o==="phong"?n="MeshPhongMaterial":o==="basic"&&(n="MeshBasicMaterial")}if(g.blending!==void 0&&THREE[g.blending]!==void 0)k.blending=
-THREE[g.blending];if(g.transparent!==void 0||g.opacity<1)k.transparent=g.transparent;if(g.depthTest!==void 0)k.depthTest=g.depthTest;if(g.depthWrite!==void 0)k.depthWrite=g.depthWrite;if(g.vertexColors!==void 0)if(g.vertexColors=="face")k.vertexColors=THREE.FaceColors;else if(g.vertexColors)k.vertexColors=THREE.VertexColors;if(g.colorDiffuse)k.color=h(g.colorDiffuse);else if(g.DbgColor)k.color=g.DbgColor;if(g.colorSpecular)k.specular=h(g.colorSpecular);if(g.colorAmbient)k.ambient=h(g.colorAmbient);
-if(g.transparency)k.opacity=g.transparency;if(g.specularCoef)k.shininess=g.specularCoef;if(g.visible!==void 0)k.visible=g.visible;if(g.flipSided!==void 0)k.side=THREE.BackSide;if(g.doubleSided!==void 0)k.side=THREE.DoubleSide;if(g.wireframe!==void 0)k.wireframe=g.wireframe;g.mapDiffuse&&j(k,"map",g.mapDiffuse,g.mapDiffuseRepeat,g.mapDiffuseOffset,g.mapDiffuseWrap);g.mapLight&&j(k,"lightMap",g.mapLight,g.mapLightRepeat,g.mapLightOffset,g.mapLightWrap);g.mapNormal&&j(k,"normalMap",g.mapNormal,g.mapNormalRepeat,
-g.mapNormalOffset,g.mapNormalWrap);g.mapSpecular&&j(k,"specularMap",g.mapSpecular,g.mapSpecularRepeat,g.mapSpecularOffset,g.mapSpecularWrap);if(g.mapNormal){j=THREE.ShaderUtils.lib.normal;h=THREE.UniformsUtils.clone(j.uniforms);h.tNormal.texture=k.normalMap;if(g.mapNormalFactor)h.uNormalScale.value=g.mapNormalFactor;if(k.map){h.tDiffuse.texture=k.map;h.enableDiffuse.value=true}if(k.specularMap){h.tSpecular.texture=k.specularMap;h.enableSpecular.value=true}if(k.lightMap){h.tAO.texture=k.lightMap;h.enableAO.value=
-true}h.uDiffuseColor.value.setHex(k.color);h.uSpecularColor.value.setHex(k.specular);h.uAmbientColor.value.setHex(k.ambient);h.uShininess.value=k.shininess;if(k.opacity!==void 0)h.uOpacity.value=k.opacity;k=new THREE.ShaderMaterial({fragmentShader:j.fragmentShader,vertexShader:j.vertexShader,uniforms:h,lights:true,fog:true})}else k=new THREE[n](k);if(g.DbgName!==void 0)k.name=g.DbgName;d.materials[e]=k}}var g=a.faces,q=a.vertices,k=a.normals,j=a.colors,h=0;if(a.uvs)for(e=0;e<a.uvs.length;e++)a.uvs[e].length&&
-h++;for(e=0;e<h;e++){d.faceUvs[e]=[];d.faceVertexUvs[e]=[]}n=0;for(o=q.length;n<o;){var i=new THREE.Vector3;i.x=q[n++]*f;i.y=q[n++]*f;i.z=q[n++]*f;d.vertices.push(i)}n=0;for(o=g.length;n<o;){var p=g[n++],r=p&2,e=p&4,u=p&8,v=p&16,q=p&32,B=p&64,i=p&128;if(p&1){p=new THREE.Face4;p.a=g[n++];p.b=g[n++];p.c=g[n++];p.d=g[n++];var x=4}else{p=new THREE.Face3;p.a=g[n++];p.b=g[n++];p.c=g[n++];x=3}if(r){r=g[n++];p.materialIndex=r}var A=d.faces.length;if(e)for(e=0;e<h;e++){var y=a.uvs[e],r=g[n++],E=y[r*2],r=y[r*
-2+1];d.faceUvs[e][A]=new THREE.UV(E,r)}if(u)for(e=0;e<h;e++){for(var y=a.uvs[e],u=[],s=0;s<x;s++){r=g[n++];E=y[r*2];r=y[r*2+1];u[s]=new THREE.UV(E,r)}d.faceVertexUvs[e][A]=u}if(v){v=g[n++]*3;r=new THREE.Vector3;r.x=k[v++];r.y=k[v++];r.z=k[v];p.normal=r}if(q)for(e=0;e<x;e++){v=g[n++]*3;r=new THREE.Vector3;r.x=k[v++];r.y=k[v++];r.z=k[v];p.vertexNormals.push(r)}if(B){q=g[n++];p.color=new THREE.Color(j[q])}if(i)for(e=0;e<x;e++){q=g[n++];p.vertexColors.push(new THREE.Color(j[q]))}d.faces.push(p)}if(a.skinWeights){e=
-0;for(g=a.skinWeights.length;e<g;e=e+2)d.skinWeights.push(new THREE.Vector4(a.skinWeights[e],a.skinWeights[e+1],0,0))}if(a.skinIndices){e=0;for(g=a.skinIndices.length;e<g;e=e+2){k=0;d.skinIndices.push(new THREE.Vector4(a.skinIndices[e],a.skinIndices[e+1],k,0))}}d.bones=a.bones;d.animation=a.animation;if(a.morphTargets){e=0;for(g=a.morphTargets.length;e<g;e++){d.morphTargets[e]={};d.morphTargets[e].name=a.morphTargets[e].name;d.morphTargets[e].vertices=[];k=d.morphTargets[e].vertices;j=a.morphTargets[e].vertices;
-r=0;for(h=j.length;r<h;r=r+3){i=new THREE.Vector3;i.x=j[r]*f;i.y=j[r+1]*f;i.z=j[r+2]*f;k.push(i)}}}if(a.morphColors){e=0;for(g=a.morphColors.length;e<g;e++){d.morphColors[e]={};d.morphColors[e].name=a.morphColors[e].name;d.morphColors[e].colors=[];f=d.morphColors[e].colors;j=a.morphColors[e].colors;k=0;for(h=j.length;k<h;k=k+3){n=new THREE.Color(16755200);n.setRGB(j[k],j[k+1],j[k+2]);f.push(n)}}}d.computeCentroids();d.computeFaceNormals();return d}};
-THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};THREE.SceneLoader.prototype.constructor=THREE.SceneLoader;
-THREE.SceneLoader.prototype.load=function(a,b){var c=this,d=new XMLHttpRequest;d.onreadystatechange=function(){if(d.readyState===4)if(d.status===200||d.status===0){var f=JSON.parse(d.responseText);c.createScene(f,b,a)}else console.error("THREE.SceneLoader: Couldn't load ["+a+"] ["+d.status+"]")};d.open("GET",a,true);d.overrideMimeType&&d.overrideMimeType("text/plain; charset=x-user-defined");d.setRequestHeader("Content-Type","text/plain");d.send(null)};
-THREE.SceneLoader.prototype.createScene=function(a,b,c){function d(a,b){return b=="relativeToHTML"?a:j+"/"+a}function f(a,b){var c;for(k in b)if(z.objects[k]===void 0){r=b[k];if(r.geometry!==void 0){if(C=z.geometries[r.geometry]){c=false;K=z.materials[r.materials[0]];(c=K instanceof THREE.ShaderMaterial)&&C.computeTangents();x=r.position;A=r.rotation;y=r.quaternion;E=r.scale;u=r.matrix;y=0;r.materials.length==0&&(K=new THREE.MeshFaceMaterial);r.materials.length>1&&(K=new THREE.MeshFaceMaterial);c=
-new THREE.Mesh(C,K);c.name=k;if(u){c.matrixAutoUpdate=false;c.matrix.set(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15])}else{c.position.set(x[0],x[1],x[2]);if(y){c.quaternion.set(y[0],y[1],y[2],y[3]);c.useQuaternion=true}else c.rotation.set(A[0],A[1],A[2]);c.scale.set(E[0],E[1],E[2])}c.visible=r.visible;c.castShadow=r.castShadow;c.receiveShadow=r.receiveShadow;a.add(c);z.objects[k]=c}}else{x=r.position;A=r.rotation;y=r.quaternion;E=r.scale;y=0;c=new THREE.Object3D;
-c.name=k;c.position.set(x[0],x[1],x[2]);if(y){c.quaternion.set(y[0],y[1],y[2],y[3]);c.useQuaternion=true}else c.rotation.set(A[0],A[1],A[2]);c.scale.set(E[0],E[1],E[2]);c.visible=r.visible!==void 0?r.visible:false;a.add(c);z.objects[k]=c;z.empties[k]=c}r.children!==void 0&&f(c,r.children)}}function e(a){return function(b){z.geometries[a]=b;f(z.scene,t.objects);I=I-1;m.onLoadComplete();l()}}function g(a){return function(b){z.geometries[a]=b}}function l(){m.callbackProgress({totalModels:P,totalTextures:R,
-loadedModels:P-I,loadedTextures:R-O},z);m.onLoadProgress();I===0&&O===0&&b(z)}var m=this,j=THREE.Loader.prototype.extractUrlBase(c),h,n,k,o,q,i,p,r,u,v,B,x,A,y,E,s,w,C,K,M,N,t,G,I,O,P,R,z;t=a;c=new THREE.BinaryLoader;G=new THREE.JSONLoader;O=I=0;z={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},empties:{}};if(t.transform){a=t.transform.position;v=t.transform.rotation;s=t.transform.scale;a&&z.scene.position.set(a[0],a[1],a[2]);v&&z.scene.rotation.set(v[0],
-v[1],v[2]);s&&z.scene.scale.set(s[0],s[1],s[2]);if(a||v||s){z.scene.updateMatrix();z.scene.updateMatrixWorld()}}a=function(a){return function(){O=O-a;l();m.onLoadComplete()}};for(q in t.cameras){s=t.cameras[q];s.type==="perspective"?M=new THREE.PerspectiveCamera(s.fov,s.aspect,s.near,s.far):s.type==="ortho"&&(M=new THREE.OrthographicCamera(s.left,s.right,s.top,s.bottom,s.near,s.far));x=s.position;v=s.target;s=s.up;M.position.set(x[0],x[1],x[2]);M.target=new THREE.Vector3(v[0],v[1],v[2]);s&&M.up.set(s[0],
-s[1],s[2]);z.cameras[q]=M}for(o in t.lights){v=t.lights[o];q=v.color!==void 0?v.color:16777215;M=v.intensity!==void 0?v.intensity:1;if(v.type==="directional"){x=v.direction;B=new THREE.DirectionalLight(q,M);B.position.set(x[0],x[1],x[2]);B.position.normalize()}else if(v.type==="point"){x=v.position;B=v.distance;B=new THREE.PointLight(q,M,B);B.position.set(x[0],x[1],x[2])}else v.type==="ambient"&&(B=new THREE.AmbientLight(q));z.scene.add(B);z.lights[o]=B}for(i in t.fogs){o=t.fogs[i];o.type==="linear"?
-N=new THREE.Fog(0,o.near,o.far):o.type==="exp2"&&(N=new THREE.FogExp2(0,o.density));s=o.color;N.color.setRGB(s[0],s[1],s[2]);z.fogs[i]=N}if(z.cameras&&t.defaults.camera)z.currentCamera=z.cameras[t.defaults.camera];if(z.fogs&&t.defaults.fog)z.scene.fog=z.fogs[t.defaults.fog];s=t.defaults.bgcolor;z.bgColor=new THREE.Color;z.bgColor.setRGB(s[0],s[1],s[2]);z.bgColorAlpha=t.defaults.bgalpha;for(h in t.geometries){i=t.geometries[h];if(i.type=="bin_mesh"||i.type=="ascii_mesh"){I=I+1;m.onLoadStart()}}P=I;
-for(h in t.geometries){i=t.geometries[h];if(i.type==="cube"){C=new THREE.CubeGeometry(i.width,i.height,i.depth,i.segmentsWidth,i.segmentsHeight,i.segmentsDepth,null,i.flipped,i.sides);z.geometries[h]=C}else if(i.type==="plane"){C=new THREE.PlaneGeometry(i.width,i.height,i.segmentsWidth,i.segmentsHeight);z.geometries[h]=C}else if(i.type==="sphere"){C=new THREE.SphereGeometry(i.radius,i.segmentsWidth,i.segmentsHeight);z.geometries[h]=C}else if(i.type==="cylinder"){C=new THREE.CylinderGeometry(i.topRad,
-i.botRad,i.height,i.radSegs,i.heightSegs);z.geometries[h]=C}else if(i.type==="torus"){C=new THREE.TorusGeometry(i.radius,i.tube,i.segmentsR,i.segmentsT);z.geometries[h]=C}else if(i.type==="icosahedron"){C=new THREE.IcosahedronGeometry(i.radius,i.subdivisions);z.geometries[h]=C}else if(i.type==="bin_mesh")c.load(d(i.url,t.urlBaseType),e(h));else if(i.type==="ascii_mesh")G.load(d(i.url,t.urlBaseType),e(h));else if(i.type==="embedded_mesh"){i=t.embeds[i.id];i.metadata=t.metadata;i&&G.createModel(i,g(h),
-"")}}for(p in t.textures){h=t.textures[p];if(h.url instanceof Array){O=O+h.url.length;for(i=0;i<h.url.length;i++)m.onLoadStart()}else{O=O+1;m.onLoadStart()}}R=O;for(p in t.textures){h=t.textures[p];if(h.mapping!==void 0&&THREE[h.mapping]!==void 0)h.mapping=new THREE[h.mapping];if(h.url instanceof Array){i=h.url.length;N=[];for(c=0;c<i;c++)N[c]=d(h.url[c],t.urlBaseType);i=THREE.ImageUtils.loadTextureCube(N,h.mapping,a(i))}else{i=THREE.ImageUtils.loadTexture(d(h.url,t.urlBaseType),h.mapping,a(1));if(THREE[h.minFilter]!==
-void 0)i.minFilter=THREE[h.minFilter];if(THREE[h.magFilter]!==void 0)i.magFilter=THREE[h.magFilter];if(h.repeat){i.repeat.set(h.repeat[0],h.repeat[1]);if(h.repeat[0]!==1)i.wrapS=THREE.RepeatWrapping;if(h.repeat[1]!==1)i.wrapT=THREE.RepeatWrapping}h.offset&&i.offset.set(h.offset[0],h.offset[1]);if(h.wrap){N={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(N[h.wrap[0]]!==void 0)i.wrapS=N[h.wrap[0]];if(N[h.wrap[1]]!==void 0)i.wrapT=N[h.wrap[1]]}}z.textures[p]=i}for(n in t.materials){u=
-t.materials[n];for(w in u.parameters)if(w==="envMap"||w==="map"||w==="lightMap")u.parameters[w]=z.textures[u.parameters[w]];else if(w==="shading")u.parameters[w]=u.parameters[w]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(w==="blending")u.parameters[w]=u.parameters[w]in THREE?THREE[u.parameters[w]]:THREE.NormalBlending;else if(w==="combine")u.parameters[w]=u.parameters[w]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(w==="vertexColors")if(u.parameters[w]=="face")u.parameters[w]=
-THREE.FaceColors;else if(u.parameters[w])u.parameters[w]=THREE.VertexColors;if(u.parameters.opacity!==void 0&&u.parameters.opacity<1)u.parameters.transparent=true;if(u.parameters.normalMap){p=THREE.ShaderUtils.lib.normal;a=THREE.UniformsUtils.clone(p.uniforms);h=u.parameters.color;i=u.parameters.specular;N=u.parameters.ambient;c=u.parameters.shininess;a.tNormal.texture=z.textures[u.parameters.normalMap];if(u.parameters.normalMapFactor)a.uNormalScale.value=u.parameters.normalMapFactor;if(u.parameters.map){a.tDiffuse.texture=
-u.parameters.map;a.enableDiffuse.value=true}if(u.parameters.lightMap){a.tAO.texture=u.parameters.lightMap;a.enableAO.value=true}if(u.parameters.specularMap){a.tSpecular.texture=z.textures[u.parameters.specularMap];a.enableSpecular.value=true}a.uDiffuseColor.value.setHex(h);a.uSpecularColor.value.setHex(i);a.uAmbientColor.value.setHex(N);a.uShininess.value=c;if(u.parameters.opacity)a.uOpacity.value=u.parameters.opacity;K=new THREE.ShaderMaterial({fragmentShader:p.fragmentShader,vertexShader:p.vertexShader,
-uniforms:a,lights:true,fog:true})}else K=new THREE[u.type](u.parameters);z.materials[n]=K}f(z.scene,t.objects);m.callbackSync(z);l()};THREE.TextureLoader=function(){THREE.EventTarget.call(this);this.crossOrigin=null};
-THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a){var b=this,c=new Image;c.addEventListener("load",function(){var a=new THREE.Texture(c);a.needsUpdate=true;b.dispatchEvent({type:"load",content:a})},false);c.addEventListener("error",function(){b.dispatchEvent({type:"error",message:"Couldn't load URL ["+a+"]"})},false);if(b.crossOrigin)c.crossOrigin=b.crossOrigin;c.src=a}};
-THREE.Material=function(){this.id=THREE.MaterialCount++;this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=false;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=true;this.polygonOffset=false;this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.overdraw=false;this.needsUpdate=this.visible=true};
-THREE.Material.prototype.setValues=function(a){if(a!==void 0)for(var b in a){var c=a[b];if(c===void 0)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color&&c instanceof THREE.Color?d.copy(c):d instanceof THREE.Color&&typeof c==="number"?d.setHex(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]=c}}};
-THREE.Material.prototype.clone=function(a){a===void 0&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;a.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor=this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;
-a.visible=this.visible;return a};THREE.MaterialCount=0;THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=false;this.fog=true;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);
-THREE.LineBasicMaterial.prototype.clone=function(){var a=new THREE.LineBasicMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.linewidth=this.linewidth;a.linecap=this.linecap;a.linejoin=this.linejoin;a.vertexColors=this.vertexColors;a.fog=this.fog;return a};
-THREE.MeshBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphTargets=this.skinning=false;this.setValues(a)};THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype);
-THREE.MeshBasicMaterial.prototype.clone=function(){var a=new THREE.MeshBasicMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.lightMap=this.lightMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap;a.wireframeLinejoin=this.wireframeLinejoin;
-a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;return a};
-THREE.MeshLambertMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.wrapAround=false;this.wrapRGB=new THREE.Vector3(1,1,1);this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";
-this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setValues(a)};THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype);
-THREE.MeshLambertMaterial.prototype.clone=function(){var a=new THREE.MeshLambertMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.ambient.copy(this.ambient);a.emissive.copy(this.emissive);a.wrapAround=this.wrapAround;a.wrapRGB.copy(this.wrapRGB);a.map=this.map;a.lightMap=this.lightMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=
-this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap;a.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;a.morphNormals=this.morphNormals;return a};
-THREE.MeshPhongMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.specular=new THREE.Color(1118481);this.shininess=30;this.wrapAround=this.perPixel=this.metal=false;this.wrapRGB=new THREE.Vector3(1,1,1);this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;
-this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setValues(a)};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype);
-THREE.MeshPhongMaterial.prototype.clone=function(){var a=new THREE.MeshPhongMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.ambient.copy(this.ambient);a.emissive.copy(this.emissive);a.specular.copy(this.specular);a.shininess=this.shininess;a.metal=this.metal;a.perPixel=this.perPixel;a.wrapAround=this.wrapAround;a.wrapRGB.copy(this.wrapRGB);a.map=this.map;a.lightMap=this.lightMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=
-this.refractionRatio;a.fog=this.fog;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap;a.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;a.morphNormals=this.morphNormals;return a};THREE.MeshDepthMaterial=function(a){THREE.Material.call(this);this.wireframe=false;this.wireframeLinewidth=1;this.setValues(a)};
-THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial.prototype.clone=function(){var a=new THREE.LineBasicMaterial;THREE.Material.prototype.clone.call(this,a);a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;return a};THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);this.shading=THREE.FlatShading;this.wireframe=false;this.wireframeLinewidth=1;this.setValues(a)};THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype);
-THREE.MeshNormalMaterial.prototype.clone=function(){var a=new THREE.MeshNormalMaterial;THREE.Material.prototype.clone.call(this,a);a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;return a};THREE.MeshFaceMaterial=function(){};THREE.MeshFaceMaterial.prototype.clone=function(){return new THREE.MeshFaceMaterial};
-THREE.ParticleBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.map=null;this.size=1;this.sizeAttenuation=true;this.vertexColors=false;this.fog=true;this.setValues(a)};THREE.ParticleBasicMaterial.prototype=Object.create(THREE.Material.prototype);
-THREE.ParticleBasicMaterial.prototype.clone=function(){var a=new THREE.ParticleBasicMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.size=this.size;a.sizeAttenuation=this.sizeAttenuation;a.vertexColors=this.vertexColors;a.fog=this.fog;return a};THREE.ParticleCanvasMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.program=function(){};this.setValues(a)};THREE.ParticleCanvasMaterial.prototype=Object.create(THREE.Material.prototype);
-THREE.ParticleCanvasMaterial.prototype.clone=function(){var a=new THREE.ParticleCanvasMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.program=this.program;return a};
-THREE.Texture=function(a,b,c,d,f,e,g,l,m){this.id=THREE.TextureCount++;this.image=a;this.mapping=b!==void 0?b:new THREE.UVMapping;this.wrapS=c!==void 0?c:THREE.ClampToEdgeWrapping;this.wrapT=d!==void 0?d:THREE.ClampToEdgeWrapping;this.magFilter=f!==void 0?f:THREE.LinearFilter;this.minFilter=e!==void 0?e:THREE.LinearMipMapLinearFilter;this.anisotropy=m!==void 0?m:1;this.format=g!==void 0?g:THREE.RGBAFormat;this.type=l!==void 0?l:THREE.UnsignedByteType;this.offset=new THREE.Vector2(0,0);this.repeat=
-new THREE.Vector2(1,1);this.generateMipmaps=true;this.premultiplyAlpha=false;this.flipY=true;this.needsUpdate=false;this.onUpdate=null};THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var a=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter,this.format,this.type,this.anisotropy);a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.generateMipmaps=this.generateMipmaps;a.premultiplyAlpha=this.premultiplyAlpha;a.flipY=this.flipY;return a}};
-THREE.TextureCount=0;THREE.DataTexture=function(a,b,c,d,f,e,g,l,m,j){THREE.Texture.call(this,null,e,g,l,m,j,d,f);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture(this.image.data,this.image.width,this.image.height,this.format,this.type,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a};
-THREE.Particle=function(a){THREE.Object3D.call(this);this.material=a};THREE.Particle.prototype=Object.create(THREE.Object3D.prototype);THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.LineBasicMaterial({color:Math.random()*16777215});this.type=c!==void 0?c:THREE.LineStrip;this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere())};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=Object.create(THREE.Object3D.prototype);
-THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.MeshBasicMaterial({color:Math.random()*16777215,wireframe:true});if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius;if(this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++){this.morphTargetInfluences.push(0);
-this.morphTargetDictionary[this.geometry.morphTargets[c].name]=c}}}};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==void 0)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
-THREE.Bone.prototype.update=function(a,b){this.matrixAutoUpdate&&(b=b|this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix);this.matrixWorldNeedsUpdate=false;b=true}var c,d=this.children.length;for(c=0;c<d;c++)this.children[c].update(this.skinMatrix,b)};
-THREE.Sprite=function(a){THREE.Object3D.call(this);this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:new THREE.Texture;this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.blendSrc=a.blendSrc!==void 0?a.blendSrc:THREE.SrcAlphaFactor;this.blendDst=a.blendDst!==void 0?a.blendDst:THREE.OneMinusSrcAlphaFactor;this.blendEquation=a.blendEquation!==void 0?a.blendEquation:THREE.AddEquation;this.useScreenCoordinates=a.useScreenCoordinates!==
-void 0?a.useScreenCoordinates:true;this.mergeWith3D=a.mergeWith3D!==void 0?a.mergeWith3D:!this.useScreenCoordinates;this.affectedByDistance=a.affectedByDistance!==void 0?a.affectedByDistance:!this.useScreenCoordinates;this.scaleByViewport=a.scaleByViewport!==void 0?a.scaleByViewport:!this.affectedByDistance;this.alignment=a.alignment instanceof THREE.Vector2?a.alignment:THREE.SpriteAlignment.center;this.rotation3d=this.rotation;this.rotation=0;this.opacity=1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=
-new THREE.Vector2(1,1)};THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype);THREE.Sprite.prototype.updateMatrix=function(){this.matrix.setPosition(this.position);this.rotation3d.set(0,0,this.rotation);this.matrix.setRotationFromEuler(this.rotation3d);if(this.scale.x!==1||this.scale.y!==1){this.matrix.scale(this.scale);this.boundRadiusScale=Math.max(this.scale.x,this.scale.y)}this.matrixWorldNeedsUpdate=true};THREE.SpriteAlignment={};THREE.SpriteAlignment.topLeft=new THREE.Vector2(1,-1);
-THREE.SpriteAlignment.topCenter=new THREE.Vector2(0,-1);THREE.SpriteAlignment.topRight=new THREE.Vector2(-1,-1);THREE.SpriteAlignment.centerLeft=new THREE.Vector2(1,0);THREE.SpriteAlignment.center=new THREE.Vector2(0,0);THREE.SpriteAlignment.centerRight=new THREE.Vector2(-1,0);THREE.SpriteAlignment.bottomLeft=new THREE.Vector2(1,1);THREE.SpriteAlignment.bottomCenter=new THREE.Vector2(0,1);THREE.SpriteAlignment.bottomRight=new THREE.Vector2(-1,1);
-THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.matrixAutoUpdate=false;this.__objects=[];this.__lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype);
-THREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light){this.__lights.indexOf(a)===-1&&this.__lights.push(a);a.target&&a.target.parent===void 0&&this.add(a.target)}else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.__objects.indexOf(a)===-1){this.__objects.push(a);this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);b!==-1&&this.__objectsRemoved.splice(b,1)}for(b=0;b<a.children.length;b++)this.__addObject(a.children[b])};
-THREE.Scene.prototype.__removeObject=function(a){if(a instanceof THREE.Light){var b=this.__lights.indexOf(a);b!==-1&&this.__lights.splice(b,1)}else if(!(a instanceof THREE.Camera)){b=this.__objects.indexOf(a);if(b!==-1){this.__objects.splice(b,1);this.__objectsRemoved.push(a);b=this.__objectsAdded.indexOf(a);b!==-1&&this.__objectsAdded.splice(b,1)}}for(b=0;b<a.children.length;b++)this.__removeObject(a.children[b])};
-THREE.CanvasRenderer=function(a){function b(a){if(u!==a)u=i.globalAlpha=a}function c(a){if(v!==a){if(a===THREE.NormalBlending)i.globalCompositeOperation="source-over";else if(a===THREE.AdditiveBlending)i.globalCompositeOperation="lighter";else if(a===THREE.SubtractiveBlending)i.globalCompositeOperation="darker";v=a}}function d(a){if(B!==a)B=i.strokeStyle=a}function f(a){if(x!==a)x=i.fillStyle=a}console.log("THREE.CanvasRenderer",THREE.REVISION);var a=a||{},e=this,g,l,m,j=new THREE.Projector,h=a.canvas!==
-void 0?a.canvas:document.createElement("canvas"),n,k,o,q,i=h.getContext("2d"),p=new THREE.Color(0),r=0,u=1,v=0,B=null,x=null,A=null,y=null,E=null,s,w,C,K,M=new THREE.RenderableVertex,N=new THREE.RenderableVertex,t,G,I,O,P,R,z,$,aa,J,S,W,D=new THREE.Color,F=new THREE.Color,H=new THREE.Color,L=new THREE.Color,Q=new THREE.Color,la=[],T=[],ca,U,da,fa,za,Aa,Ba,Ca,Da,Ea,ia=new THREE.Rectangle,ba=new THREE.Rectangle,X=new THREE.Rectangle,ua=false,Z=new THREE.Color,ma=new THREE.Color,na=new THREE.Color,V=
-new THREE.Vector3,ra,sa,ya,ea,ta,va,a=16;ra=document.createElement("canvas");ra.width=ra.height=2;sa=ra.getContext("2d");sa.fillStyle="rgba(0,0,0,1)";sa.fillRect(0,0,2,2);ya=sa.getImageData(0,0,2,2);ea=ya.data;ta=document.createElement("canvas");ta.width=ta.height=a;va=ta.getContext("2d");va.translate(-a/2,-a/2);va.scale(a,a);a--;this.domElement=h;this.sortElements=this.sortObjects=this.autoClear=true;this.info={render:{vertices:0,faces:0}};this.setSize=function(a,b){n=a;k=b;o=Math.floor(n/2);q=Math.floor(k/
-2);h.width=n;h.height=k;ia.set(-o,-q,o,q);ba.set(-o,-q,o,q);u=1;v=0;E=y=A=x=B=null};this.setClearColor=function(a,b){p.copy(a);r=b!==void 0?b:1;ba.set(-o,-q,o,q)};this.setClearColorHex=function(a,b){p.setHex(a);r=b!==void 0?b:1;ba.set(-o,-q,o,q)};this.clear=function(){i.setTransform(1,0,0,-1,o,q);if(ba.isEmpty()===false){ba.minSelf(ia);ba.inflate(2);r<1&&i.clearRect(Math.floor(ba.getX()),Math.floor(ba.getY()),Math.floor(ba.getWidth()),Math.floor(ba.getHeight()));if(r>0){c(THREE.NormalBlending);b(1);
-f("rgba("+Math.floor(p.r*255)+","+Math.floor(p.g*255)+","+Math.floor(p.b*255)+","+r+")");i.fillRect(Math.floor(ba.getX()),Math.floor(ba.getY()),Math.floor(ba.getWidth()),Math.floor(ba.getHeight()))}ba.empty()}};this.render=function(a,h){function k(a){var b,c,d,e;Z.setRGB(0,0,0);ma.setRGB(0,0,0);na.setRGB(0,0,0);b=0;for(c=a.length;b<c;b++){d=a[b];e=d.color;if(d instanceof THREE.AmbientLight){Z.r=Z.r+e.r;Z.g=Z.g+e.g;Z.b=Z.b+e.b}else if(d instanceof THREE.DirectionalLight){ma.r=ma.r+e.r;ma.g=ma.g+e.g;
-ma.b=ma.b+e.b}else if(d instanceof THREE.PointLight){na.r=na.r+e.r;na.g=na.g+e.g;na.b=na.b+e.b}}}function n(a,b,c,d){var e,f,g,h,j,l;e=0;for(f=a.length;e<f;e++){g=a[e];h=g.color;if(g instanceof THREE.DirectionalLight){j=g.matrixWorld.getPosition().normalize();l=c.dot(j);if(!(l<=0)){l=l*g.intensity;d.r=d.r+h.r*l;d.g=d.g+h.g*l;d.b=d.b+h.b*l}}else if(g instanceof THREE.PointLight){j=g.matrixWorld.getPosition();l=c.dot(V.sub(j,b).normalize());if(!(l<=0)){l=l*(g.distance==0?1:1-Math.min(b.distanceTo(j)/
-g.distance,1));if(l!=0){l=l*g.intensity;d.r=d.r+h.r*l;d.g=d.g+h.g*l;d.b=d.b+h.b*l}}}}}function p(a,e,g){b(g.opacity);c(g.blending);var h,j,l,m,k,n;if(g instanceof THREE.ParticleBasicMaterial){if(g.map===null){l=e.object.scale.x;m=e.object.scale.y;l=l*e.scale.x*o;m=m*e.scale.y*q;X.set(a.x-l,a.y-m,a.x+l,a.y+m);if(ia.intersects(X)===false)return;f(g.color.getContextStyle());i.save();i.translate(a.x,a.y);i.rotate(-e.rotation);i.scale(l,m);i.fillRect(-1,-1,2,2)}else{g=g.map.image;k=g.width>>1;n=g.height>>
-1;l=e.scale.x*o;m=e.scale.y*q;h=l*k;j=m*n;X.set(a.x-h,a.y-j,a.x+h,a.y+j);if(ia.intersects(X)===false)return;i.save();i.translate(a.x,a.y);i.rotate(-e.rotation);i.scale(l,-m);i.translate(-k,-n);i.drawImage(g,0,0)}i.restore()}else if(g instanceof THREE.ParticleCanvasMaterial){h=e.scale.x*o;j=e.scale.y*q;X.set(a.x-h,a.y-j,a.x+h,a.y+j);if(ia.intersects(X)!==false){d(g.color.getContextStyle());f(g.color.getContextStyle());i.save();i.translate(a.x,a.y);i.rotate(-e.rotation);i.scale(h,j);g.program(i);i.restore()}}}
-function r(a,e,f,g){b(g.opacity);c(g.blending);i.beginPath();i.moveTo(a.positionScreen.x,a.positionScreen.y);i.lineTo(e.positionScreen.x,e.positionScreen.y);i.closePath();if(g instanceof THREE.LineBasicMaterial){a=g.linewidth;if(A!==a)A=i.lineWidth=a;a=g.linecap;if(y!==a)y=i.lineCap=a;a=g.linejoin;if(E!==a)E=i.lineJoin=a;d(g.color.getContextStyle());i.stroke();X.inflate(g.linewidth*2)}}function u(a,d,f,g,l,j,i,k){e.info.render.vertices=e.info.render.vertices+3;e.info.render.faces++;b(k.opacity);c(k.blending);
-t=a.positionScreen.x;G=a.positionScreen.y;I=d.positionScreen.x;O=d.positionScreen.y;P=f.positionScreen.x;R=f.positionScreen.y;x(t,G,I,O,P,R);if(k instanceof THREE.MeshBasicMaterial)if(k.map!==null){if(k.map.mapping instanceof THREE.UVMapping){fa=i.uvs[0];Fa(t,G,I,O,P,R,fa[g].u,fa[g].v,fa[l].u,fa[l].v,fa[j].u,fa[j].v,k.map)}}else if(k.envMap!==null){if(k.envMap.mapping instanceof THREE.SphericalReflectionMapping){a=h.matrixWorldInverse;V.copy(i.vertexNormalsWorld[g]);za=(V.x*a.elements[0]+V.y*a.elements[4]+
-V.z*a.elements[8])*0.5+0.5;Aa=(V.x*a.elements[1]+V.y*a.elements[5]+V.z*a.elements[9])*0.5+0.5;V.copy(i.vertexNormalsWorld[l]);Ba=(V.x*a.elements[0]+V.y*a.elements[4]+V.z*a.elements[8])*0.5+0.5;Ca=(V.x*a.elements[1]+V.y*a.elements[5]+V.z*a.elements[9])*0.5+0.5;V.copy(i.vertexNormalsWorld[j]);Da=(V.x*a.elements[0]+V.y*a.elements[4]+V.z*a.elements[8])*0.5+0.5;Ea=(V.x*a.elements[1]+V.y*a.elements[5]+V.z*a.elements[9])*0.5+0.5;Fa(t,G,I,O,P,R,za,Aa,Ba,Ca,Da,Ea,k.envMap)}}else k.wireframe===true?ja(k.color,
-k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ga(k.color);else if(k instanceof THREE.MeshLambertMaterial)if(ua===true)if(k.wireframe===false&&k.shading==THREE.SmoothShading&&i.vertexNormalsWorld.length==3){F.r=H.r=L.r=Z.r;F.g=H.g=L.g=Z.g;F.b=H.b=L.b=Z.b;n(m,i.v1.positionWorld,i.vertexNormalsWorld[0],F);n(m,i.v2.positionWorld,i.vertexNormalsWorld[1],H);n(m,i.v3.positionWorld,i.vertexNormalsWorld[2],L);F.r=Math.max(0,Math.min(k.color.r*F.r,1));F.g=Math.max(0,Math.min(k.color.g*F.g,1));
-F.b=Math.max(0,Math.min(k.color.b*F.b,1));H.r=Math.max(0,Math.min(k.color.r*H.r,1));H.g=Math.max(0,Math.min(k.color.g*H.g,1));H.b=Math.max(0,Math.min(k.color.b*H.b,1));L.r=Math.max(0,Math.min(k.color.r*L.r,1));L.g=Math.max(0,Math.min(k.color.g*L.g,1));L.b=Math.max(0,Math.min(k.color.b*L.b,1));Q.r=(H.r+L.r)*0.5;Q.g=(H.g+L.g)*0.5;Q.b=(H.b+L.b)*0.5;da=wa(F,H,L,Q);pa(t,G,I,O,P,R,0,0,1,0,0,1,da)}else{D.r=Z.r;D.g=Z.g;D.b=Z.b;n(m,i.centroidWorld,i.normalWorld,D);D.r=Math.max(0,Math.min(k.color.r*D.r,1));
-D.g=Math.max(0,Math.min(k.color.g*D.g,1));D.b=Math.max(0,Math.min(k.color.b*D.b,1));k.wireframe===true?ja(D,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ga(D)}else k.wireframe===true?ja(k.color,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ga(k.color);else if(k instanceof THREE.MeshDepthMaterial){ca=h.near;U=h.far;F.r=F.g=F.b=1-oa(a.positionScreen.z,ca,U);H.r=H.g=H.b=1-oa(d.positionScreen.z,ca,U);L.r=L.g=L.b=1-oa(f.positionScreen.z,ca,U);Q.r=(H.r+L.r)*0.5;Q.g=(H.g+L.g)*
-0.5;Q.b=(H.b+L.b)*0.5;da=wa(F,H,L,Q);pa(t,G,I,O,P,R,0,0,1,0,0,1,da)}else if(k instanceof THREE.MeshNormalMaterial){D.r=qa(i.normalWorld.x);D.g=qa(i.normalWorld.y);D.b=qa(i.normalWorld.z);k.wireframe===true?ja(D,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ga(D)}}function v(a,d,f,g,l,j,k,i,o){e.info.render.vertices=e.info.render.vertices+4;e.info.render.faces++;b(i.opacity);c(i.blending);if(i.map!==void 0&&i.map!==null||i.envMap!==void 0&&i.envMap!==null){u(a,d,g,0,1,3,k,i,o);u(l,f,
-j,1,2,3,k,i,o)}else{t=a.positionScreen.x;G=a.positionScreen.y;I=d.positionScreen.x;O=d.positionScreen.y;P=f.positionScreen.x;R=f.positionScreen.y;z=g.positionScreen.x;$=g.positionScreen.y;aa=l.positionScreen.x;J=l.positionScreen.y;S=j.positionScreen.x;W=j.positionScreen.y;if(i instanceof THREE.MeshBasicMaterial){B(t,G,I,O,P,R,z,$);i.wireframe===true?ja(i.color,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):ga(i.color)}else if(i instanceof THREE.MeshLambertMaterial)if(ua===true)if(!i.wireframe&&
-i.shading==THREE.SmoothShading&&k.vertexNormalsWorld.length==4){F.r=H.r=L.r=Q.r=Z.r;F.g=H.g=L.g=Q.g=Z.g;F.b=H.b=L.b=Q.b=Z.b;n(m,k.v1.positionWorld,k.vertexNormalsWorld[0],F);n(m,k.v2.positionWorld,k.vertexNormalsWorld[1],H);n(m,k.v4.positionWorld,k.vertexNormalsWorld[3],L);n(m,k.v3.positionWorld,k.vertexNormalsWorld[2],Q);F.r=Math.max(0,Math.min(i.color.r*F.r,1));F.g=Math.max(0,Math.min(i.color.g*F.g,1));F.b=Math.max(0,Math.min(i.color.b*F.b,1));H.r=Math.max(0,Math.min(i.color.r*H.r,1));H.g=Math.max(0,
-Math.min(i.color.g*H.g,1));H.b=Math.max(0,Math.min(i.color.b*H.b,1));L.r=Math.max(0,Math.min(i.color.r*L.r,1));L.g=Math.max(0,Math.min(i.color.g*L.g,1));L.b=Math.max(0,Math.min(i.color.b*L.b,1));Q.r=Math.max(0,Math.min(i.color.r*Q.r,1));Q.g=Math.max(0,Math.min(i.color.g*Q.g,1));Q.b=Math.max(0,Math.min(i.color.b*Q.b,1));da=wa(F,H,L,Q);x(t,G,I,O,z,$);pa(t,G,I,O,z,$,0,0,1,0,0,1,da);x(aa,J,P,R,S,W);pa(aa,J,P,R,S,W,1,0,1,1,0,1,da)}else{D.r=Z.r;D.g=Z.g;D.b=Z.b;n(m,k.centroidWorld,k.normalWorld,D);D.r=Math.max(0,
-Math.min(i.color.r*D.r,1));D.g=Math.max(0,Math.min(i.color.g*D.g,1));D.b=Math.max(0,Math.min(i.color.b*D.b,1));B(t,G,I,O,P,R,z,$);i.wireframe===true?ja(D,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):ga(D)}else{B(t,G,I,O,P,R,z,$);i.wireframe===true?ja(i.color,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):ga(i.color)}else if(i instanceof THREE.MeshNormalMaterial){D.r=qa(k.normalWorld.x);D.g=qa(k.normalWorld.y);D.b=qa(k.normalWorld.z);B(t,G,I,O,P,R,z,$);i.wireframe===true?
-ja(D,i.wireframeLinewidth,i.wireframeLinecap,i.wireframeLinejoin):ga(D)}else if(i instanceof THREE.MeshDepthMaterial){ca=h.near;U=h.far;F.r=F.g=F.b=1-oa(a.positionScreen.z,ca,U);H.r=H.g=H.b=1-oa(d.positionScreen.z,ca,U);L.r=L.g=L.b=1-oa(g.positionScreen.z,ca,U);Q.r=Q.g=Q.b=1-oa(f.positionScreen.z,ca,U);da=wa(F,H,L,Q);x(t,G,I,O,z,$);pa(t,G,I,O,z,$,0,0,1,0,0,1,da);x(aa,J,P,R,S,W);pa(aa,J,P,R,S,W,1,0,1,1,0,1,da)}}}function x(a,b,c,d,e,f){i.beginPath();i.moveTo(a,b);i.lineTo(c,d);i.lineTo(e,f);i.lineTo(a,
-b)}function B(a,b,c,d,e,f,g,h){i.beginPath();i.moveTo(a,b);i.lineTo(c,d);i.lineTo(e,f);i.lineTo(g,h);i.lineTo(a,b)}function ja(a,b,c,e){if(A!==b)A=i.lineWidth=b;if(y!==c)y=i.lineCap=c;if(E!==e)E=i.lineJoin=e;d(a.getContextStyle());i.stroke();X.inflate(b*2)}function ga(a){f(a.getContextStyle());i.fill()}function Fa(a,b,c,d,e,g,h,k,l,j,m,n,o){if(!(o.image===void 0||o.image.width===0)){if(o.needsUpdate===true||la[o.id]===void 0){var p=o.wrapS==THREE.RepeatWrapping,q=o.wrapT==THREE.RepeatWrapping;la[o.id]=
-i.createPattern(o.image,p===true&&q===true?"repeat":p===true&&q===false?"repeat-x":p===false&&q===true?"repeat-y":"no-repeat");o.needsUpdate=false}f(la[o.id]);var p=o.offset.x/o.repeat.x,q=o.offset.y/o.repeat.y,r=o.image.width*o.repeat.x,s=o.image.height*o.repeat.y,h=(h+p)*r,k=(1-k+q)*s,c=c-a,d=d-b,e=e-a,g=g-b,l=(l+p)*r-h,j=(1-j+q)*s-k,m=(m+p)*r-h,n=(1-n+q)*s-k,p=l*n-m*j;if(p===0){if(T[o.id]===void 0){b=document.createElement("canvas");b.width=o.image.width;b.height=o.image.height;b=b.getContext("2d");
-b.drawImage(o.image,0,0);T[o.id]=b.getImageData(0,0,o.image.width,o.image.height).data}b=T[o.id];h=(Math.floor(h)+Math.floor(k)*o.image.width)*4;D.setRGB(b[h]/255,b[h+1]/255,b[h+2]/255);ga(D)}else{p=1/p;o=(n*c-j*e)*p;j=(n*d-j*g)*p;c=(l*e-m*c)*p;d=(l*g-m*d)*p;a=a-o*h-c*k;h=b-j*h-d*k;i.save();i.transform(o,j,c,d,a,h);i.fill();i.restore()}}}function pa(a,b,c,d,e,f,g,h,k,j,l,m,n){var o,p;o=n.width-1;p=n.height-1;g=g*o;h=h*p;c=c-a;d=d-b;e=e-a;f=f-b;k=k*o-g;j=j*p-h;l=l*o-g;m=m*p-h;p=1/(k*m-l*j);o=(m*c-
-j*e)*p;j=(m*d-j*f)*p;c=(k*e-l*c)*p;d=(k*f-l*d)*p;a=a-o*g-c*h;b=b-j*g-d*h;i.save();i.transform(o,j,c,d,a,b);i.clip();i.drawImage(n,0,0);i.restore()}function wa(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),i=~~(c.r*255),j=~~(c.g*255),c=~~(c.b*255),k=~~(d.r*255),l=~~(d.g*255),d=~~(d.b*255);ea[0]=e<0?0:e>255?255:e;ea[1]=f<0?0:f>255?255:f;ea[2]=a<0?0:a>255?255:a;ea[4]=g<0?0:g>255?255:g;ea[5]=h<0?0:h>255?255:h;ea[6]=b<0?0:b>255?255:b;ea[8]=i<0?0:i>255?
-255:i;ea[9]=j<0?0:j>255?255:j;ea[10]=c<0?0:c>255?255:c;ea[12]=k<0?0:k>255?255:k;ea[13]=l<0?0:l>255?255:l;ea[14]=d<0?0:d>255?255:d;sa.putImageData(ya,0,0);va.drawImage(ra,0,0);return ta}function oa(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function qa(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function ka(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!==0){e=1/Math.sqrt(e);c=c*e;d=d*e;b.x=b.x+c;b.y=b.y+d;a.x=a.x-c;a.y=a.y-d}}if(h instanceof THREE.Camera===false)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");
-else{var xa,Ga,Y,ha;this.autoClear===true?this.clear():i.setTransform(1,0,0,-1,o,q);e.info.render.vertices=0;e.info.render.faces=0;g=j.projectScene(a,h,this.sortElements);l=g.elements;m=g.lights;ua=m.length>0;ua===true&&k(m);xa=0;for(Ga=l.length;xa<Ga;xa++){Y=l[xa];ha=Y.material;if(!(ha===void 0||ha.visible===false)){X.empty();if(Y instanceof THREE.RenderableParticle){s=Y;s.x=s.x*o;s.y=s.y*q;p(s,Y,ha,a)}else if(Y instanceof THREE.RenderableLine){s=Y.v1;w=Y.v2;s.positionScreen.x=s.positionScreen.x*
-o;s.positionScreen.y=s.positionScreen.y*q;w.positionScreen.x=w.positionScreen.x*o;w.positionScreen.y=w.positionScreen.y*q;X.addPoint(s.positionScreen.x,s.positionScreen.y);X.addPoint(w.positionScreen.x,w.positionScreen.y);ia.intersects(X)===true&&r(s,w,Y,ha,a)}else if(Y instanceof THREE.RenderableFace3){s=Y.v1;w=Y.v2;C=Y.v3;s.positionScreen.x=s.positionScreen.x*o;s.positionScreen.y=s.positionScreen.y*q;w.positionScreen.x=w.positionScreen.x*o;w.positionScreen.y=w.positionScreen.y*q;C.positionScreen.x=
-C.positionScreen.x*o;C.positionScreen.y=C.positionScreen.y*q;if(ha.overdraw===true){ka(s.positionScreen,w.positionScreen);ka(w.positionScreen,C.positionScreen);ka(C.positionScreen,s.positionScreen)}X.add3Points(s.positionScreen.x,s.positionScreen.y,w.positionScreen.x,w.positionScreen.y,C.positionScreen.x,C.positionScreen.y);ia.intersects(X)===true&&u(s,w,C,0,1,2,Y,ha,a)}else if(Y instanceof THREE.RenderableFace4){s=Y.v1;w=Y.v2;C=Y.v3;K=Y.v4;s.positionScreen.x=s.positionScreen.x*o;s.positionScreen.y=
-s.positionScreen.y*q;w.positionScreen.x=w.positionScreen.x*o;w.positionScreen.y=w.positionScreen.y*q;C.positionScreen.x=C.positionScreen.x*o;C.positionScreen.y=C.positionScreen.y*q;K.positionScreen.x=K.positionScreen.x*o;K.positionScreen.y=K.positionScreen.y*q;M.positionScreen.copy(w.positionScreen);N.positionScreen.copy(K.positionScreen);if(ha.overdraw===true){ka(s.positionScreen,w.positionScreen);ka(w.positionScreen,K.positionScreen);ka(K.positionScreen,s.positionScreen);ka(C.positionScreen,M.positionScreen);
-ka(C.positionScreen,N.positionScreen)}X.addPoint(s.positionScreen.x,s.positionScreen.y);X.addPoint(w.positionScreen.x,w.positionScreen.y);X.addPoint(C.positionScreen.x,C.positionScreen.y);X.addPoint(K.positionScreen.x,K.positionScreen.y);ia.intersects(X)===true&&v(s,w,C,K,M,N,Y,ha,a)}ba.addRectangle(X)}}i.setTransform(1,0,0,1,0,0)}}};THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=true};
-THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};
-THREE.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.material=null;this.uvs=[[]];this.z=null};
-THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.material=null;this.uvs=[[]];this.z=null};THREE.RenderableObject=function(){this.z=this.object=null};
-THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=this.object=null;this.scale=new THREE.Vector2;this.material=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.material=null};

File diff suppressed because it is too large
+ 0 - 39
build/custom/ThreeExtras.js


File diff suppressed because it is too large
+ 0 - 244
build/custom/ThreeWebGL.js


+ 0 - 0
build/Three.js → build/three.js


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


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

@@ -16,7 +16,9 @@
 
 		<h2>Example</h2>
 
-		<code>var face = new THREE.Face3( 0, 1, 2, new THREE.Vector3( 0, 1, 0 ), new THREE.Color( 0xffaa00 ), 0 );</code>
+		<code>var normal = new THREE.Vector3( 0, 1, 0 );
+		var color = new THREE.Color( 0xffaa00 );
+		var face = new THREE.Face3( 0, 1, 2, normal, color, 0 );</code>
 
 
 		<h2>Constructor</h2>

+ 3 - 1
docs/api/core/Face4.html

@@ -16,7 +16,9 @@
 
 		<h2>Example</h2>
 
-		<code>var face = new THREE.Face4( 0, 1, 2, 3, new THREE.Vector3( 0, 1, 0 ), new THREE.Color( 0xffaa00 ), 0 );</code>
+		<code>var normal = new THREE.Vector3( 0, 1, 0 );
+		var color = new THREE.Color( 0xffaa00 );
+		var face = new THREE.Face4( 0, 1, 2, 3, normal, color, 0 );</code>
 
 
 		<h2>Constructor</h2>

+ 8 - 0
docs/api/core/Object3D.html

@@ -170,6 +170,14 @@
 		<div>
 		Gets first child with name matching the argument. Searches whole subgraph recursively if *recursive* is true.
 		</div>
+		
+		<h3>.getDescendants( [page:Array array] )</h3>
+		<div>
+		array - optional argument that returns the the array with descendants.<br />
+		</div>
+		<div>
+		Searches whole subgraph recursively to add all objects in the array.
+		</div>
 
 		<h3>.updateMatrix()</h3>
 		<div>

+ 3 - 3
docs/api/core/Vector3.html

@@ -125,12 +125,12 @@
 		Normalizes this vector.
 		</div>
 
-		<h3>.distanceTo( [page:Vector3 v] ) [page:Vector3]</h3>
+		<h3>.distanceTo( [page:Vector3 v] ) [page:Float]</h3>
 		<div>
 		Computes distance of this vector to *v*.
 		</div>
 
-		<h3>.distanceToSquared( [page:Vector3 v] ) [page:Vector3]</h3>
+		<h3>.distanceToSquared( [page:Vector3 v] ) [page:Float]</h3>
 		<div>
 		Computes squared distance of this vector to *v*.
 		</div>
@@ -177,7 +177,7 @@
 
 		<h3>.isZero() [page:Boolean]</h3>
 		<div>
-		Checks if length of this vector is within small epsilon (*0.0001*).
+		Checks if length of this vector is within small epsilon (*0.01*).
 		</div>
 
 		<h3>.clone() [page:Vector3]</h3>

+ 9 - 15
docs/api/materials/Material.html

@@ -23,12 +23,12 @@
 		<div>
 		Unique number of this material instance.
 		</div>
-		
+
 		<h3>.[page:String name]</h3>
 		<div>
 		Material name. Default is an empty string.
 		</div>
-		
+
 		<h3>.[page:Number opacity]</h3>
 		<div>
 		Opacity. Default is *1*.
@@ -49,12 +49,12 @@
 		<div>
 		Blending source. It's one of the blending mode constants defined in [page:Three Three.js]. Default is *SrcAlphaFactor*.
 		</div>
-		
+
 		<h3>.[page:Integer blendDst]</h3>
 		<div>
 		Blending destination. It's one of the blending mode constants defined in [page:Three Three.js]. Default is *OneMinusSrcAlphaFactor*.
 		</div>
-		
+
 		<h3>.[page:Integer blendEquation]</h3>
 		<div>
 		Blending equation to use when applying blending. It's one of the constants defined in [page:Three Three.js]. Default is *AddEquation*.
@@ -82,7 +82,7 @@
 		<div>
 		Sets the polygon offset factor. Default is *0*.
 		</div>
-		
+
 		<h3>.[page:Integer polygonOffsetUnits]</h3>
 		<div>
 		Sets the polygon offset units. Default is *0*.
@@ -100,21 +100,15 @@
 
 		<h3>.[page:Boolean visible]</h3>
 		<div>
-		Define whether this material is visible. Default is *true*.
+		Defines whether this material is visible. Default is *true*.
 		</div>
 
-		<h3>.[page:Boolean doubleSided]</h3>
-		<div>
-		Defines whether this both sides of faces will be visible. Default is *false*.
-		</div>
-		
+		<h3>.[page:Enum side]</h3>
 		<div>
-		The normals in each face will be used in order to determine which side is visible; positive normals are the front face and thus visible, whereas negative normals correspond to the back faces and are normally not rendered, which can cause a 'disappearing' effect if an object is rotated and its backfaces are looking at the camera.
+		Defines which of the face sides will be rendered - front, back or both.
 		</div>
-
-		<h3>.[page:Boolean flipSided]</h3>
 		<div>
-		Defines if the object's faces are flipsided. If enabled, faces with negative normals will be visible (which is the opposite of the default behaviour). Default is *false*.
+		Default is *THREE.FrontSide*. Other options are *THREE.BackSide* and *THREE.DoubleSide*.
 		</div>
 
 		<h3>.[page:Boolean needsUpdate]</h3>

+ 2 - 2
docs/index.html

@@ -84,7 +84,7 @@
 
 		<script src="list.js"></script>
 		<script>
-			var REVISION = '49';
+			var REVISION = '51dev';
 
 			var panel = document.getElementById( 'panel' );
 			var viewer = document.getElementById( 'viewer' );
@@ -127,7 +127,7 @@
 				goTo( window.location.hash.substring( 1 ) );
 
 			}
-			
+
 			window.addEventListener( 'hashchange', goToHash, false );
 
 			if ( window.location.hash.length > 0 ) goToHash();

+ 33 - 1
docs/page.js

@@ -11,7 +11,7 @@ var onDocumentLoad = function ( event ) {
 	text = text.replace(/\[page:(\w+) ([\w|\.]+)\]/gi, "<a href=\"javascript:window.parent.goTo('$1')\" title=\"$1\">$2</a>" ); // [page:name title]
 	text = text.replace(/\[link:([\w|\:|\/|\.|\-|\_]+)\]/gi, "[link:$1 $1]" ); // [link:url] to [link:url title]
 	text = text.replace(/\[link:([\w|\:|\/|\.|\-|\_]+) ([\w|\:|\/|\.|\-|\_]+)\]/gi, "<a href=\"$1\"  target=\"_blank\">$2</a>" ); // [link:url title]
-	text = text.replace(/\*([\w|\ |\-|\/|\+|\-|\(|\)|\=|\,|\.\"]+)\*/gi, "<strong>$1</strong>" ); // *
+	text = text.replace(/\*([\w|\d|\"|\-|\(][\w|\d|\ |\-|\/|\+|\-|\(|\)|\=|\,|\.\"]*[\w|\d|\"|\)]|\w)\*/gi, "<strong>$1</strong>" ); // *
 
 	document.body.innerHTML = text;
 
@@ -29,6 +29,38 @@ var onDocumentLoad = function ( event ) {
 
 	document.body.appendChild( button );
 
+	// Syntax highlighting
+
+	var styleBase = document.createElement( 'link' );
+	styleBase.href = '../../prettify/prettify.css';
+	styleBase.rel = 'stylesheet';
+
+	var styleCustom = document.createElement( 'link' );
+	styleCustom.href = '../../prettify/threejs.css';
+	styleCustom.rel = 'stylesheet';
+
+	document.head.appendChild( styleBase );
+	document.head.appendChild( styleCustom );
+
+	var prettify = document.createElement( 'script' );
+	prettify.src = '../../prettify/prettify.js';
+
+	prettify.onload = function () {
+
+		var elements = document.getElementsByTagName( 'code' );
+
+		for ( var i = 0; i < elements.length; i ++ ) {
+
+			var e = elements[ i ];
+			e.className += ' prettyprint';
+
+		}
+
+		prettyPrint();
+
+	}
+
+	document.head.appendChild( prettify );
 
 };
 

+ 1 - 0
docs/prettify/prettify.css

@@ -0,0 +1 @@
+.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

+ 28 - 0
docs/prettify/prettify.js

@@ -0,0 +1,28 @@
+var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
+(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
+[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
+f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
+(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
+{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
+t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
+"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
+l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
+q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
+q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
+"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
+a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
+for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
+m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
+a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
+j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
+"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
+H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
+J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
+I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
+["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
+/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
+["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
+hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
+!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
+250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
+PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();

+ 5 - 0
docs/prettify/readme.txt

@@ -0,0 +1,5 @@
+Prettify syntax highlighter:
+http://code.google.com/p/google-code-prettify/
+
+Code license - Apache License 2.0
+http://www.apache.org/licenses/LICENSE-2.0

+ 15 - 0
docs/prettify/threejs.css

@@ -0,0 +1,15 @@
+pre .str, code .str { color: #8000ff; } /* string */
+pre .kwd, code .kwd { color: #30b030; } /* keyword */
+pre .com, code .com { color: #999999; } /* comment */
+pre .typ, code .typ { color: #2194ce; } /* type */
+pre .lit, code .lit { color: #ff0080; } /* literal */
+pre .pun, code .pun { color: #888888; } /* punctuation */
+pre .pln, code .pln { color: #444444; } /* plaintext */
+pre .dec, code .dec { color: #22c0c4; } /* decimal */
+
+
+
+pre.prettyprint, code.prettyprint {
+	background-color: #f9f9f9;
+	font-family: 'inconsolata';
+}

+ 1 - 1
examples/canvas_ascii_effect.html

@@ -16,7 +16,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 		<script src="js/effects/AsciiEffect.js"></script>
 		<script src="js/Stats.js"></script>
 

+ 14 - 12
examples/canvas_camera_orthographic.html

@@ -15,8 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/custom/ThreeCanvas.js"></script>
-		<script src="../build/custom/ThreeExtras.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 
@@ -50,23 +49,26 @@
 
 				// Grid
 
+				var size = 500, step = 50;
+
 				var geometry = new THREE.Geometry();
-				geometry.vertices.push( new THREE.Vector3( - 500, 0, 0 ) );
-				geometry.vertices.push( new THREE.Vector3( 500, 0, 0 ) );
 
-				for ( var i = 0; i <= 20; i ++ ) {
+				for ( var i = - size; i <= size; i += step ) {
 
-					var line = new THREE.Line( geometry, new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } ) );
-					line.position.z = ( i * 50 ) - 500;
-					scene.add( line );
+					geometry.vertices.push( new THREE.Vector3( - size, 0, i ) );
+					geometry.vertices.push( new THREE.Vector3(   size, 0, i ) );
 
-					var line = new THREE.Line( geometry, new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } ) );
-					line.position.x = ( i * 50 ) - 500;
-					line.rotation.y = 90 * Math.PI / 180;
-					scene.add( line );
+					geometry.vertices.push( new THREE.Vector3( i, 0, - size ) );
+					geometry.vertices.push( new THREE.Vector3( i, 0,   size ) );
 
 				}
 
+				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } );
+
+				var line = new THREE.Line( geometry, material );
+				line.type = THREE.LinePieces;
+				scene.add( line );
+
 				// Cubes
 
 				var geometry = new THREE.CubeGeometry( 50, 50, 50 );

+ 14 - 11
examples/canvas_camera_orthographic2.html

@@ -20,7 +20,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 		<script src="../src/extras/cameras/CombinedCamera.js"></script>
 
 		<script src="js/Stats.js"></script>
@@ -116,23 +116,26 @@
 
 				// Grid
 
+				var size = 500, step = 50;
+
 				var geometry = new THREE.Geometry();
-				geometry.vertices.push( new THREE.Vector3( - 500, 0, 0 ) );
-				geometry.vertices.push( new THREE.Vector3( 500, 0, 0 ) );
 
-				for ( var i = 0; i <= 20; i ++ ) {
+				for ( var i = - size; i <= size; i += step ) {
 
-					var line = new THREE.Line( geometry, new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } ) );
-					line.position.z = ( i * 50 ) - 500;
-					scene.add( line );
+					geometry.vertices.push( new THREE.Vector3( - size, 0, i ) );
+					geometry.vertices.push( new THREE.Vector3(   size, 0, i ) );
 
-					var line = new THREE.Line( geometry, new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } ) );
-					line.position.x = ( i * 50 ) - 500;
-					line.rotation.y = 90 * Math.PI / 180;
-					scene.add( line );
+					geometry.vertices.push( new THREE.Vector3( i, 0, - size ) );
+					geometry.vertices.push( new THREE.Vector3( i, 0,   size ) );
 
 				}
 
+				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } );
+
+				var line = new THREE.Line( geometry, material );
+				line.type = THREE.LinePieces;
+				scene.add( line );
+
 				// Cubes
 
 				var geometry = new THREE.CubeGeometry( 50, 50, 50 );

+ 1 - 1
examples/canvas_geometry_birds.html

@@ -28,7 +28,7 @@
 		<div id="container"></div>
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - birds demo</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 		<script src="obj/Bird.js"></script>
 
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/canvas_geometry_cube.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 1 - 1
examples/canvas_geometry_earth.html

@@ -34,7 +34,7 @@
 		<div id="container"></div>
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - earth demo</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 		<script src="js/Stats.js"></script>
 
 		<script>

+ 1 - 1
examples/canvas_geometry_hierarchy.html

@@ -16,7 +16,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 1 - 1
examples/canvas_geometry_panorama.html

@@ -32,7 +32,7 @@
 		<div id="container"></div>
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - panorama demo. cubemap by <a href="http://www.zfight.com/" target="_blank">Jochum Skoglund</a>.</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script>
 

+ 1 - 1
examples/canvas_geometry_panorama_fisheye.html

@@ -32,7 +32,7 @@
 		<div id="container"></div>
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - panorama fisheye demo. cubemap by <a href="http://www.zfight.com/" target="_blank">Jochum Skoglund</a>. (mousewheel: change fov)</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script>
 

+ 1 - 1
examples/canvas_geometry_terrain.html

@@ -34,7 +34,7 @@
 		<div id="container"><br /><br /><br /><br /><br />Generating...</div>
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - terrain demo. <a href="canvas_geometry_terrain.html">generate another</a></div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/ImprovedNoise.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/canvas_geometry_text.html

@@ -16,7 +16,7 @@
 	<body>
 
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 1 - 1
examples/canvas_interactive_cubes.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 1 - 1
examples/canvas_interactive_cubes_tween.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Tween.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/canvas_interactive_particles.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 22 - 36
examples/canvas_interactive_voxelpainter.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 
@@ -25,7 +25,7 @@
 			var camera, scene, renderer;
 			var projector, plane;
 			var mouse2D, mouse3D, ray,
-			rollOveredFace, isShiftDown = false,
+			isShiftDown = false,
 			theta = 45, isCtrlDown = false,
 			target = new THREE.Vector3( 0, 200, 0 );
 
@@ -52,29 +52,33 @@
 
 				// Grid
 
-				var geometry = new THREE.Geometry();
-				geometry.vertices.push( new THREE.Vector3( - 500, 0, 0 ) );
-				geometry.vertices.push( new THREE.Vector3( 500, 0, 0 ) );
+				var size = 500, step = 50;
 
-				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } );
+				var geometry = new THREE.Geometry();
 
-				for ( var i = 0; i <= 20; i ++ ) {
+				for ( var i = - size; i <= size; i += step ) {
 
-					var line = new THREE.Line( geometry, material );
-					line.position.z = ( i * 50 ) - 500;
-					scene.add( line );
+					geometry.vertices.push( new THREE.Vector3( - size, 0, i ) );
+					geometry.vertices.push( new THREE.Vector3(   size, 0, i ) );
 
-					var line = new THREE.Line( geometry, material );
-					line.position.x = ( i * 50 ) - 500;
-					line.rotation.y = 90 * Math.PI / 180;
-					scene.add( line );
+					geometry.vertices.push( new THREE.Vector3( i, 0, - size ) );
+					geometry.vertices.push( new THREE.Vector3( i, 0,   size ) );
 
 				}
 
+				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } );
+
+				var line = new THREE.Line( geometry, material );
+				line.type = THREE.LinePieces;
+				scene.add( line );
+
+				//
+
 				projector = new THREE.Projector();
 
-				plane = new THREE.Mesh( new THREE.PlaneGeometry( 1000, 1000 ), new THREE.MeshFaceMaterial() );
+				plane = new THREE.Mesh( new THREE.PlaneGeometry( 1000, 1000 ), new THREE.MeshBasicMaterial() );
 				plane.rotation.x = - Math.PI / 2;
+				plane.visible = false;
 				scene.add( plane );
 
 				mouse2D = new THREE.Vector3( 0, 10000, 0.5 );
@@ -142,6 +146,9 @@
 
 				event.preventDefault();
 
+				mouse3D = projector.unprojectVector( mouse2D.clone(), camera );
+				ray.direction = mouse3D.subSelf( camera.position ).normalize();
+
 				var intersects = ray.intersectObjects( scene.children );
 
 				if ( intersects.length > 0 ) {
@@ -221,27 +228,6 @@
 				camera.position.z = 1400 * Math.cos( theta * Math.PI / 360 );
 				camera.lookAt( target );
 
-				mouse3D = projector.unprojectVector( mouse2D.clone(), camera );
-				ray.direction = mouse3D.subSelf( camera.position ).normalize();
-
-				var intersects = ray.intersectObjects( scene.children );
-
-				if ( intersects.length > 0 ) {
-
-					if ( intersects[ 0 ].face != rollOveredFace ) {
-
-						if ( rollOveredFace ) rollOveredFace.materials = [];
-						rollOveredFace = intersects[ 0 ].face;
-						rollOveredFace.materials = [ new THREE.MeshBasicMaterial( { color: 0xff0000, opacity: 0.5 } ) ];
-					}
-
-				} else if ( rollOveredFace ) {
-
-					rollOveredFace.materials = [];
-					rollOveredFace = null;
-
-				}
-
 				renderer.render( scene, camera );
 
 			}

+ 1 - 1
examples/canvas_lights_pointlights.html

@@ -39,7 +39,7 @@
 			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank">David OReilly</a>
 		</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script>
 

+ 1 - 1
examples/canvas_lights_pointlights_smooth.html

@@ -39,7 +39,7 @@
 			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank">David OReilly</a>
 		</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script>
 

+ 1 - 1
examples/canvas_lines.html

@@ -18,7 +18,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script>
 

+ 1 - 1
examples/canvas_lines_sphere.html

@@ -18,7 +18,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script>
 

+ 14 - 15
examples/canvas_materials.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 
@@ -41,27 +41,26 @@
 
 				// Grid
 
-				var geometry = new THREE.Geometry();
-				geometry.vertices.push( new THREE.Vector3( - 500, 0, 0 ) );
-				geometry.vertices.push( new THREE.Vector3( 500, 0, 0 ) );
+				var size = 500, step = 100;
 
-				var material = new THREE.LineBasicMaterial( { color: 0xffffff, opacity: 0.2 } );
+				var geometry = new THREE.Geometry();
 
-				for ( var i = 0; i <= 10; i ++ ) {
+				for ( var i = - size; i <= size; i += step ) {
 
-					var line = new THREE.Line( geometry, material );
-					line.position.y = - 120;
-					line.position.z = ( i * 100 ) - 500;
-					scene.add( line );
+					geometry.vertices.push( new THREE.Vector3( - size, - 120, i ) );
+					geometry.vertices.push( new THREE.Vector3(   size, - 120, i ) );
 
-					var line = new THREE.Line( geometry, material );
-					line.position.x = ( i * 100 ) - 500;
-					line.position.y = - 120;
-					line.rotation.y = 90 * Math.PI / 180;
-					scene.add( line );
+					geometry.vertices.push( new THREE.Vector3( i, - 120, - size ) );
+					geometry.vertices.push( new THREE.Vector3( i, - 120,   size ) );
 
 				}
 
+				var material = new THREE.LineBasicMaterial( { color: 0xffffff, opacity: 0.2 } );
+
+				var line = new THREE.Line( geometry, material );
+				line.type = THREE.LinePieces;
+				scene.add( line );
+
 				// Spheres
 
 				var geometry = new THREE.SphereGeometry( 100, 14, 7, false );

+ 1 - 1
examples/canvas_materials_depth.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 1 - 1
examples/canvas_materials_normal.html

@@ -39,7 +39,7 @@
 			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank">David OReilly</a>
 		</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script>
 

+ 1 - 1
examples/canvas_materials_reflection.html

@@ -38,7 +38,7 @@
 			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank">David OReilly</a>. Reflection texture by <a href="http://kewlers.scene.org/" target="_blank">Kewlers</a>.
 		</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script>
 

+ 1 - 1
examples/canvas_materials_video.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 1 - 1
examples/canvas_particles_floor.html

@@ -18,7 +18,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 1 - 1
examples/canvas_particles_random.html

@@ -18,7 +18,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 1 - 1
examples/canvas_particles_shapes.html

@@ -16,7 +16,7 @@
 	<body>
 
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 		<script src="js/Tween.js"></script>

+ 1 - 1
examples/canvas_particles_sprites.html

@@ -18,7 +18,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 		<script src="js/Tween.js"></script>

+ 1 - 1
examples/canvas_particles_waves.html

@@ -17,7 +17,7 @@
 		</style>
 	</head>
 	<body>
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 14 - 13
examples/canvas_performance.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 
@@ -42,25 +42,26 @@
 
 				// Grid
 
-				var geometry = new THREE.Geometry();
-				geometry.vertices.push( new THREE.Vector3( - 500, 0, 0 ) );
-				geometry.vertices.push( new THREE.Vector3( 500, 0, 0 ) );
+				var size = 500, step = 100;
 
-				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.5 } );
+				var geometry = new THREE.Geometry();
 
-				for ( var i = 0; i <= 10; i ++ ) {
+				for ( var i = - size; i <= size; i += step ) {
 
-					var line = new THREE.Line( geometry, material );
-					line.position.z = ( i * 100 ) - 500;
-					scene.add( line );
+					geometry.vertices.push( new THREE.Vector3( - size, 0, i ) );
+					geometry.vertices.push( new THREE.Vector3(   size, 0, i ) );
 
-					var line = new THREE.Line( geometry, material );
-					line.position.x = ( i * 100 ) - 500;
-					line.rotation.y = 90 * Math.PI / 180;
-					scene.add( line );
+					geometry.vertices.push( new THREE.Vector3( i, 0, - size ) );
+					geometry.vertices.push( new THREE.Vector3( i, 0,   size ) );
 
 				}
 
+				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.5 } );
+
+				var line = new THREE.Line( geometry, material );
+				line.type = THREE.LinePieces;
+				scene.add( line );
+
 				// Spheres
 
 				geometry = new THREE.SphereGeometry( 100, 26, 18 );

+ 14 - 13
examples/canvas_sandbox.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 
@@ -66,25 +66,26 @@
 
 				// Grid
 
-				var geometry = new THREE.Geometry();
-				geometry.vertices.push( new THREE.Vector3( - 500, 0, 0 ) );
-				geometry.vertices.push( new THREE.Vector3( 500, 0, 0 ) );
+				var size = 500, step = 100;
 
-				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.5 } );
+				var geometry = new THREE.Geometry();
 
-				for ( var i = 0; i <= 10; i ++ ) {
+				for ( var i = - size; i <= size; i += step ) {
 
-					var line = new THREE.Line( geometry, material );
-					line.position.z = ( i * 100 ) - 500;
-					scene.add( line );
+					geometry.vertices.push( new THREE.Vector3( - size, 0, i ) );
+					geometry.vertices.push( new THREE.Vector3(   size, 0, i ) );
 
-					var line = new THREE.Line( geometry, material );
-					line.position.x = ( i * 100 ) - 500;
-					line.rotation.y = 90 * Math.PI / 180;
-					scene.add( line );
+					geometry.vertices.push( new THREE.Vector3( i, 0, - size ) );
+					geometry.vertices.push( new THREE.Vector3( i, 0,   size ) );
 
 				}
 
+				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.5 } );
+
+				var line = new THREE.Line( geometry, material );
+				line.type = THREE.LinePieces;
+				scene.add( line );
+
 				// Spheres
 
 				objects = [];

+ 45 - 3
examples/js/ShaderSkin.js

@@ -12,6 +12,8 @@ THREE.ShaderSkin = {
 	//		- physically based specular term (Kelemen/Szirmay-Kalos specular reflectance)
 	//
 	//		- diffuse map
+	//		- bump map
+	//		- specular map
 	//		- point and directional lights (use with "lights: true" material option)
 	//		- fog (use with "fog: true" material option)
 	//		- shadow maps
@@ -28,6 +30,9 @@ THREE.ShaderSkin = {
 
 			{
 
+			"enableBump"	: { type: "i", value: 0 },
+			"enableSpecular": { type: "i", value: 0 },
+
 			"tDiffuse"	: { type: "t", value: 0, texture: null },
 			"tBeckmann"	: { type: "t", value: 1, texture: null },
 
@@ -39,6 +44,13 @@ THREE.ShaderSkin = {
 			"uRoughness": 	  		{ type: "f", value: 0.15 },
 			"uSpecularBrightness": 	{ type: "f", value: 0.75 },
 
+			"bumpMap"	: { type: "t", value: 2, texture: null },
+			"bumpScale" : { type: "f", value: 1 },
+
+			"specularMap" : { type: "t", value: 3, texture: null },
+
+			"offsetRepeat" : { type: "v4", value: new THREE.Vector4( 0, 0, 1, 1 ) },
+
 			"uWrapRGB":	{ type: "v3", value: new THREE.Vector3( 0.75, 0.375, 0.1875 ) }
 
 			}
@@ -47,6 +59,12 @@ THREE.ShaderSkin = {
 
 		fragmentShader: [
 
+			"#define USE_BUMPMAP",
+			"#extension GL_OES_standard_derivatives : enable",
+
+			"uniform bool enableBump;",
+			"uniform bool enableSpecular;",
+
 			"uniform vec3 uAmbientColor;",
 			"uniform vec3 uDiffuseColor;",
 			"uniform vec3 uSpecularColor;",
@@ -60,6 +78,8 @@ THREE.ShaderSkin = {
 			"uniform sampler2D tDiffuse;",
 			"uniform sampler2D tBeckmann;",
 
+			"uniform sampler2D specularMap;",
+
 			"varying vec3 vNormal;",
 			"varying vec2 vUv;",
 
@@ -84,6 +104,7 @@ THREE.ShaderSkin = {
 
 			THREE.ShaderChunk[ "shadowmap_pars_fragment" ],
 			THREE.ShaderChunk[ "fog_pars_fragment" ],
+			THREE.ShaderChunk[ "bumpmap_pars_fragment" ],
 
 			// Fresnel term
 
@@ -140,6 +161,25 @@ THREE.ShaderSkin = {
 				"vec3 normal = normalize( vNormal );",
 				"vec3 viewPosition = normalize( vViewPosition );",
 
+				"float specularStrength;",
+
+				"if ( enableSpecular ) {",
+
+					"vec4 texelSpecular = texture2D( specularMap, vUv );",
+					"specularStrength = texelSpecular.r;",
+
+				"} else {",
+
+					"specularStrength = 1.0;",
+
+				"}",
+
+				"#ifdef USE_BUMPMAP",
+
+					"if ( enableBump ) normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );",
+
+				"#endif",
+
 				// point lights
 
 				"vec3 specularTotal = vec3( 0.0 );",
@@ -168,7 +208,7 @@ THREE.ShaderSkin = {
 						"float pointSpecularWeight = KS_Skin_Specular( normal, lVector, viewPosition, uRoughness, uSpecularBrightness );",
 
 						"pointTotal    += lDistance * uDiffuseColor * pointLightColor[ i ] * pointDiffuseWeight;",
-						"specularTotal += lDistance * uSpecularColor * pointLightColor[ i ] * pointSpecularWeight;",
+						"specularTotal += lDistance * uSpecularColor * pointLightColor[ i ] * pointSpecularWeight * specularStrength;",
 
 					"}",
 
@@ -193,7 +233,7 @@ THREE.ShaderSkin = {
 						"float dirSpecularWeight =  KS_Skin_Specular( normal, dirVector, viewPosition, uRoughness, uSpecularBrightness );",
 
 						"dirTotal 	   += uDiffuseColor * directionalLightColor[ i ] * dirDiffuseWeight;",
-						"specularTotal += uSpecularColor * directionalLightColor[ i ] * dirSpecularWeight;",
+						"specularTotal += uSpecularColor * directionalLightColor[ i ] * dirSpecularWeight * specularStrength;",
 
 					"}",
 
@@ -223,6 +263,8 @@ THREE.ShaderSkin = {
 
 		vertexShader: [
 
+			"uniform vec4 offsetRepeat;",
+
 			"varying vec3 vNormal;",
 			"varying vec2 vUv;",
 
@@ -237,7 +279,7 @@ THREE.ShaderSkin = {
 
 				"vNormal = normalMatrix * normal;",
 
-				"vUv = uv;",
+				"vUv = uv * offsetRepeat.zw + offsetRepeat.xy;",
 
 				"gl_Position = projectionMatrix * mvPosition;",
 

+ 101 - 0
examples/js/loaders/STLLoader.js

@@ -0,0 +1,101 @@
+/**
+ * @author aleeper / http://adamleeper.com/
+ * @author mrdoob / http://mrdoob.com/
+ *
+ * Description: A THREE loader for STL ASCII files, as created by Solidworks and other CAD programs.
+ *
+ * Limitations: Currently supports ASCII format only
+ *
+ * Usage:
+ * 	var loader = new THREE.STLLoader();
+ * 	loader.addEventListener( 'load', function ( event ) {
+ *
+ * 		var geometry = event.content;
+ * 		scene.add( new THREE.Mesh( geometry ) );
+ *
+ * 	} );
+ * 	loader.load( './models/stl/slotted_disk.stl' );
+ */
+
+
+THREE.STLLoader = function () {
+
+	THREE.EventTarget.call( this );
+
+};
+
+THREE.STLLoader.prototype = {
+
+	constructor: THREE.STLLoader,
+
+	load: function ( url ) {
+
+		var scope = this;
+		var xhr = new XMLHttpRequest();
+
+		xhr.addEventListener( 'load', function ( event ) {
+
+			scope.dispatchEvent( { type: 'load', content: scope.parse( event.target.responseText ) } );
+
+		}, false );
+
+		xhr.addEventListener( 'progress', function ( event ) {
+
+			scope.dispatchEvent( { type: 'progress', loaded: event.loaded, total: event.total } );
+
+		}, false );
+
+		xhr.addEventListener( 'error', function () {
+
+			scope.dispatchEvent( { type: 'error', message: 'Couldn\'t load URL [' + url + ']' } );
+
+		}, false );
+
+		xhr.open( 'GET', url, true );
+		xhr.send( null );
+
+	},
+
+	parse: function ( data ) {
+
+		var geometry = new THREE.Geometry();
+
+		var patternFace = /facet([\s\S]*?)endfacet/g;
+		var result;
+
+		while ( ( result = patternFace.exec( data ) ) != null ) {
+
+			var text = result[ 0 ];
+
+			// Normal
+			var patternNormal = /normal[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g;
+
+			while( ( result = patternNormal.exec( text ) ) != null ) {
+
+				var normal = new THREE.Vector3( result[ 1 ], result[ 3 ], result[ 5 ] );
+
+			}
+
+			// Vertex
+			var patternVertex = /vertex[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g;
+
+			while( ( result = patternVertex.exec( text ) ) != null ) {
+
+				geometry.vertices.push(
+					new THREE.Vector3( result[ 1 ], result[ 3 ], result[ 5 ] )
+				);
+
+			}
+
+			var len = geometry.vertices.length;
+			geometry.faces.push( new THREE.Face3( len - 3, len - 2, len - 1, normal ) );
+
+		}
+
+		geometry.computeCentroids();
+
+		return geometry;
+
+	}
+
+};

+ 1 - 1
examples/misc_camera_fly.html

@@ -33,7 +33,7 @@
 			b { color:orange }
 		</style>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/ShaderExtras.js"></script>
 

+ 1 - 1
examples/misc_camera_orbit.html

@@ -37,7 +37,7 @@
 			<a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - orbit camera example
 		</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/misc_camera_path.html

@@ -37,7 +37,7 @@
 			mouse look around
 		</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/misc_camera_roll.html

@@ -37,7 +37,7 @@
 			WASD move, RF up/down, QE roll,	mouse look around
 		</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/misc_camera_trackball.html

@@ -38,7 +38,7 @@
 			MOVE mouse &amp; press LEFT/A: rotate, MIDDLE/S: zoom, RIGHT/D: pan
 		</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/misc_lights_test.html

@@ -35,7 +35,7 @@
 			<p>Canvas renderer is very slow on anything other than Chrome.
 		</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 1 - 1
examples/misc_lookat.html

@@ -31,7 +31,7 @@
 	<body>
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - Object3D::lookAt() demo</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 1 - 1
examples/misc_software.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 		<script src="js/renderers/SoftwareRenderer.js"></script>
 		<script src="js/renderers/SoftwareRenderer2.js"></script>
 		<script src="js/renderers/SoftwareRenderer3.js"></script>

+ 1 - 1
examples/misc_sound.html

@@ -42,7 +42,7 @@
 
 		<div id="container"></div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 

+ 1 - 1
examples/misc_ubiquity_test.html

@@ -14,7 +14,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/renderers/SVGRenderer.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/misc_uv_tests.html

@@ -7,7 +7,7 @@
   article, aside, figure, footer, header, hgroup, 
   menu, nav, section { display: block; }
 </style>
-  <script src="../build/Three.js"></script>
+  <script src="../build/three.min.js"></script>
   <script src="js/UVsUtils.js"></script>
 
 </head>

File diff suppressed because it is too large
+ 35 - 0
examples/models/skinned/knight.js


+ 2018 - 0
examples/models/stl/slotted_disk.stl

@@ -0,0 +1,2018 @@
+solid DiskBase
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -2.506665e-002 1.984229e-001 -8.000000e-002
+         vertex 0.000000e+000 5.000000e-001 -8.000000e-002
+         vertex 2.506665e-002 1.984229e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 2.506665e-002 1.984229e-001 -8.000000e-002
+         vertex 0.000000e+000 5.000000e-001 -8.000000e-002
+         vertex 8.020564e-002 4.935251e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 2.506665e-002 1.984229e-001 -8.000000e-002
+         vertex 8.020564e-002 4.935251e-001 -8.000000e-002
+         vertex 7.362491e-002 1.859553e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.175570e-001 1.618034e-001 -8.000000e-002
+         vertex -2.323616e-001 4.427280e-001 -8.000000e-002
+         vertex -7.362491e-002 1.859553e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -7.362491e-002 1.859553e-001 -8.000000e-002
+         vertex -2.323616e-001 4.427280e-001 -8.000000e-002
+         vertex -1.583340e-001 4.742682e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -7.362491e-002 1.859553e-001 -8.000000e-002
+         vertex -1.583340e-001 4.742682e-001 -8.000000e-002
+         vertex -2.506665e-002 1.984229e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -2.506665e-002 1.984229e-001 -8.000000e-002
+         vertex -1.583340e-001 4.742682e-001 -8.000000e-002
+         vertex -8.020564e-002 4.935251e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -2.506665e-002 1.984229e-001 -8.000000e-002
+         vertex -8.020564e-002 4.935251e-001 -8.000000e-002
+         vertex 0.000000e+000 5.000000e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.688656e-001 -1.071654e-001 -8.000000e-002
+         vertex 3.873025e-001 -3.162227e-001 -8.000000e-002
+         vertex 1.369094e-001 -1.457937e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.369094e-001 -1.457937e-001 -8.000000e-002
+         vertex 3.873025e-001 -3.162227e-001 -8.000000e-002
+         vertex 3.315613e-001 -3.742554e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.369094e-001 -1.457937e-001 -8.000000e-002
+         vertex 3.315613e-001 -3.742554e-001 -8.000000e-002
+         vertex 9.635074e-002 -1.752613e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.996053e-001 -1.255810e-002 -8.000000e-002
+         vertex 4.898953e-001 -1.000128e-001 -8.000000e-002
+         vertex 1.902113e-001 -6.180340e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.902113e-001 -6.180340e-002 -8.000000e-002
+         vertex 4.898953e-001 -1.000128e-001 -8.000000e-002
+         vertex 4.675081e-001 -1.773024e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.902113e-001 -6.180340e-002 -8.000000e-002
+         vertex 4.675081e-001 -1.773024e-001 -8.000000e-002
+         vertex 1.688656e-001 -1.071654e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.688656e-001 -1.071654e-001 -8.000000e-002
+         vertex 4.675081e-001 -1.773024e-001 -8.000000e-002
+         vertex 4.330127e-001 -2.500000e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.688656e-001 -1.071654e-001 -8.000000e-002
+         vertex 4.330127e-001 -2.500000e-001 -8.000000e-002
+         vertex 3.873025e-001 -3.162227e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.809654e-001 8.515586e-002 -8.000000e-002
+         vertex 4.802591e-001 1.391087e-001 -8.000000e-002
+         vertex 1.964574e-001 3.747626e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.964574e-001 3.747626e-002 -8.000000e-002
+         vertex 4.802591e-001 1.391087e-001 -8.000000e-002
+         vertex 4.963544e-001 6.026834e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.964574e-001 3.747626e-002 -8.000000e-002
+         vertex 4.963544e-001 6.026834e-002 -8.000000e-002
+         vertex 1.996053e-001 -1.255810e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.996053e-001 -1.255810e-002 -8.000000e-002
+         vertex 4.963544e-001 6.026834e-002 -8.000000e-002
+         vertex 4.995945e-001 -2.013297e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.996053e-001 -1.255810e-002 -8.000000e-002
+         vertex 4.995945e-001 -2.013297e-002 -8.000000e-002
+         vertex 4.898953e-001 -1.000128e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.809654e-001 8.515586e-002 -8.000000e-002
+         vertex -4.114919e-001 2.840324e-001 -8.000000e-002
+         vertex -1.541027e-001 1.274848e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.541027e-001 1.274848e-001 -8.000000e-002
+         vertex -4.114919e-001 2.840324e-001 -8.000000e-002
+         vertex -3.606012e-001 3.463622e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.541027e-001 1.274848e-001 -8.000000e-002
+         vertex -3.606012e-001 3.463622e-001 -8.000000e-002
+         vertex -1.175570e-001 1.618034e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.175570e-001 1.618034e-001 -8.000000e-002
+         vertex -3.606012e-001 3.463622e-001 -8.000000e-002
+         vertex -3.003711e-001 3.997214e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.175570e-001 1.618034e-001 -8.000000e-002
+         vertex -3.003711e-001 3.997214e-001 -8.000000e-002
+         vertex -2.323616e-001 4.427280e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.541027e-001 1.274848e-001 -8.000000e-002
+         vertex 4.114919e-001 2.840324e-001 -8.000000e-002
+         vertex 1.809654e-001 8.515586e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.809654e-001 8.515586e-002 -8.000000e-002
+         vertex 4.114919e-001 2.840324e-001 -8.000000e-002
+         vertex 4.517252e-001 2.143463e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.809654e-001 8.515586e-002 -8.000000e-002
+         vertex 4.517252e-001 2.143463e-001 -8.000000e-002
+         vertex 4.802591e-001 1.391087e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 8.020564e-002 4.935251e-001 -8.000000e-002
+         vertex 1.583340e-001 4.742682e-001 -8.000000e-002
+         vertex 7.362491e-002 1.859553e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 7.362491e-002 1.859553e-001 -8.000000e-002
+         vertex 1.583340e-001 4.742682e-001 -8.000000e-002
+         vertex 2.323616e-001 4.427280e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 7.362491e-002 1.859553e-001 -8.000000e-002
+         vertex 2.323616e-001 4.427280e-001 -8.000000e-002
+         vertex 1.175570e-001 1.618034e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.175570e-001 1.618034e-001 -8.000000e-002
+         vertex 2.323616e-001 4.427280e-001 -8.000000e-002
+         vertex 3.003711e-001 3.997214e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.175570e-001 1.618034e-001 -8.000000e-002
+         vertex 3.003711e-001 3.997214e-001 -8.000000e-002
+         vertex 1.541027e-001 1.274848e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.541027e-001 1.274848e-001 -8.000000e-002
+         vertex 3.003711e-001 3.997214e-001 -8.000000e-002
+         vertex 3.606012e-001 3.463622e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.541027e-001 1.274848e-001 -8.000000e-002
+         vertex 3.606012e-001 3.463622e-001 -8.000000e-002
+         vertex 4.114919e-001 2.840324e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.964574e-001 3.747626e-002 -8.000000e-002
+         vertex -4.802591e-001 1.391087e-001 -8.000000e-002
+         vertex -1.809654e-001 8.515586e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.809654e-001 8.515586e-002 -8.000000e-002
+         vertex -4.802591e-001 1.391087e-001 -8.000000e-002
+         vertex -4.517252e-001 2.143463e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.809654e-001 8.515586e-002 -8.000000e-002
+         vertex -4.517252e-001 2.143463e-001 -8.000000e-002
+         vertex -4.114919e-001 2.840324e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.902113e-001 -6.180340e-002 -8.000000e-002
+         vertex -4.898953e-001 -1.000128e-001 -8.000000e-002
+         vertex -1.996053e-001 -1.255810e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.996053e-001 -1.255810e-002 -8.000000e-002
+         vertex -4.898953e-001 -1.000128e-001 -8.000000e-002
+         vertex -4.995945e-001 -2.013297e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.996053e-001 -1.255810e-002 -8.000000e-002
+         vertex -4.995945e-001 -2.013297e-002 -8.000000e-002
+         vertex -1.964574e-001 3.747626e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.964574e-001 3.747626e-002 -8.000000e-002
+         vertex -4.995945e-001 -2.013297e-002 -8.000000e-002
+         vertex -4.963544e-001 6.026834e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.964574e-001 3.747626e-002 -8.000000e-002
+         vertex -4.963544e-001 6.026834e-002 -8.000000e-002
+         vertex -4.802591e-001 1.391087e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.369094e-001 -1.457937e-001 -8.000000e-002
+         vertex -3.873025e-001 -3.162227e-001 -8.000000e-002
+         vertex -1.688656e-001 -1.071654e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.688656e-001 -1.071654e-001 -8.000000e-002
+         vertex -3.873025e-001 -3.162227e-001 -8.000000e-002
+         vertex -4.330127e-001 -2.500000e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.688656e-001 -1.071654e-001 -8.000000e-002
+         vertex -4.330127e-001 -2.500000e-001 -8.000000e-002
+         vertex -1.902113e-001 -6.180340e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.902113e-001 -6.180340e-002 -8.000000e-002
+         vertex -4.330127e-001 -2.500000e-001 -8.000000e-002
+         vertex -4.675081e-001 -1.773024e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.902113e-001 -6.180340e-002 -8.000000e-002
+         vertex -4.675081e-001 -1.773024e-001 -8.000000e-002
+         vertex -4.898953e-001 -1.000128e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -4.973798e-002 -1.937166e-001 -8.000000e-002
+         vertex -1.959833e-001 -4.599897e-001 -8.000000e-002
+         vertex -9.635074e-002 -1.752613e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -9.635074e-002 -1.752613e-001 -8.000000e-002
+         vertex -1.959833e-001 -4.599897e-001 -8.000000e-002
+         vertex -2.672329e-001 -4.225951e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -9.635074e-002 -1.752613e-001 -8.000000e-002
+         vertex -2.672329e-001 -4.225951e-001 -8.000000e-002
+         vertex -1.369094e-001 -1.457937e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.369094e-001 -1.457937e-001 -8.000000e-002
+         vertex -2.672329e-001 -4.225951e-001 -8.000000e-002
+         vertex -3.315613e-001 -3.742554e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.369094e-001 -1.457937e-001 -8.000000e-002
+         vertex -3.315613e-001 -3.742554e-001 -8.000000e-002
+         vertex -3.873025e-001 -3.162227e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -4.898587e-017 -2.000000e-001 -8.000000e-002
+         vertex -4.023328e-002 -4.983787e-001 -8.000000e-002
+         vertex -4.973798e-002 -1.937166e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -4.973798e-002 -1.937166e-001 -8.000000e-002
+         vertex -4.023328e-002 -4.983787e-001 -8.000000e-002
+         vertex -1.196578e-001 -4.854709e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -4.973798e-002 -1.937166e-001 -8.000000e-002
+         vertex -1.196578e-001 -4.854709e-001 -8.000000e-002
+         vertex -1.959833e-001 -4.599897e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 4.973798e-002 -1.937166e-001 -8.000000e-002
+         vertex 4.023328e-002 -4.983787e-001 -8.000000e-002
+         vertex -4.898587e-017 -2.000000e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -4.898587e-017 -2.000000e-001 -8.000000e-002
+         vertex 4.023328e-002 -4.983787e-001 -8.000000e-002
+         vertex 1.836970e-016 -5.000000e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -4.898587e-017 -2.000000e-001 -8.000000e-002
+         vertex 1.836970e-016 -5.000000e-001 -8.000000e-002
+         vertex -4.023328e-002 -4.983787e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 3.315613e-001 -3.742554e-001 -8.000000e-002
+         vertex 2.672329e-001 -4.225951e-001 -8.000000e-002
+         vertex 9.635074e-002 -1.752613e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 9.635074e-002 -1.752613e-001 -8.000000e-002
+         vertex 2.672329e-001 -4.225951e-001 -8.000000e-002
+         vertex 1.959833e-001 -4.599897e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 9.635074e-002 -1.752613e-001 -8.000000e-002
+         vertex 1.959833e-001 -4.599897e-001 -8.000000e-002
+         vertex 4.973798e-002 -1.937166e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 4.973798e-002 -1.937166e-001 -8.000000e-002
+         vertex 1.959833e-001 -4.599897e-001 -8.000000e-002
+         vertex 1.196578e-001 -4.854709e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 4.973798e-002 -1.937166e-001 -8.000000e-002
+         vertex 1.196578e-001 -4.854709e-001 -8.000000e-002
+         vertex 4.023328e-002 -4.983787e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 4.963869e-001 -6.000000e-002 4.000000e-002
+         vertex -4.963869e-001 -6.000000e-002 4.000000e-002
+         vertex -4.898953e-001 -1.000128e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 4.963869e-001 -6.000000e-002 4.000000e-002
+         vertex -4.898953e-001 -1.000128e-001 4.000000e-002
+         vertex 4.898953e-001 -1.000128e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 4.898953e-001 -1.000128e-001 4.000000e-002
+         vertex -4.898953e-001 -1.000128e-001 4.000000e-002
+         vertex -4.675081e-001 -1.773024e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 4.898953e-001 -1.000128e-001 4.000000e-002
+         vertex -4.675081e-001 -1.773024e-001 4.000000e-002
+         vertex 4.675081e-001 -1.773024e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 4.675081e-001 -1.773024e-001 4.000000e-002
+         vertex -4.675081e-001 -1.773024e-001 4.000000e-002
+         vertex -4.330127e-001 -2.500000e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 4.675081e-001 -1.773024e-001 4.000000e-002
+         vertex -4.330127e-001 -2.500000e-001 4.000000e-002
+         vertex 4.330127e-001 -2.500000e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 4.330127e-001 -2.500000e-001 4.000000e-002
+         vertex -4.330127e-001 -2.500000e-001 4.000000e-002
+         vertex -3.873025e-001 -3.162227e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 4.330127e-001 -2.500000e-001 4.000000e-002
+         vertex -3.873025e-001 -3.162227e-001 4.000000e-002
+         vertex 3.873025e-001 -3.162227e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 3.873025e-001 -3.162227e-001 4.000000e-002
+         vertex -3.873025e-001 -3.162227e-001 4.000000e-002
+         vertex -3.315613e-001 -3.742554e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 3.873025e-001 -3.162227e-001 4.000000e-002
+         vertex -3.315613e-001 -3.742554e-001 4.000000e-002
+         vertex 3.315613e-001 -3.742554e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 3.315613e-001 -3.742554e-001 4.000000e-002
+         vertex -3.315613e-001 -3.742554e-001 4.000000e-002
+         vertex -2.672329e-001 -4.225951e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 3.315613e-001 -3.742554e-001 4.000000e-002
+         vertex -2.672329e-001 -4.225951e-001 4.000000e-002
+         vertex 2.672329e-001 -4.225951e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 2.672329e-001 -4.225951e-001 4.000000e-002
+         vertex -2.672329e-001 -4.225951e-001 4.000000e-002
+         vertex -1.959833e-001 -4.599897e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 2.672329e-001 -4.225951e-001 4.000000e-002
+         vertex -1.959833e-001 -4.599897e-001 4.000000e-002
+         vertex 1.959833e-001 -4.599897e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 1.959833e-001 -4.599897e-001 4.000000e-002
+         vertex -1.959833e-001 -4.599897e-001 4.000000e-002
+         vertex -1.196578e-001 -4.854709e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 1.959833e-001 -4.599897e-001 4.000000e-002
+         vertex -1.196578e-001 -4.854709e-001 4.000000e-002
+         vertex 1.196578e-001 -4.854709e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 1.196578e-001 -4.854709e-001 4.000000e-002
+         vertex -1.196578e-001 -4.854709e-001 4.000000e-002
+         vertex -4.023328e-002 -4.983787e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 1.196578e-001 -4.854709e-001 4.000000e-002
+         vertex -4.023328e-002 -4.983787e-001 4.000000e-002
+         vertex 4.023328e-002 -4.983787e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -9.977564e-001 6.694921e-002 0.000000e+000
+      outer loop
+         vertex -4.963869e-001 6.000000e-002 -4.000000e-002
+         vertex -4.963544e-001 6.026834e-002 -8.000000e-002
+         vertex -4.995945e-001 -2.013297e-002 -4.000000e-002
+      endloop
+   endfacet
+   facet normal -9.999106e-001 1.337347e-002 0.000000e+000
+      outer loop
+         vertex -4.995945e-001 -2.013297e-002 -4.000000e-002
+         vertex -4.963544e-001 6.026834e-002 -8.000000e-002
+         vertex -4.995945e-001 -2.013297e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -9.977602e-001 -6.689154e-002 0.000000e+000
+      outer loop
+         vertex -4.995945e-001 -2.013297e-002 -4.000000e-002
+         vertex -4.995945e-001 -2.013297e-002 -8.000000e-002
+         vertex -4.963869e-001 -6.000000e-002 -4.000000e-002
+      endloop
+   endfacet
+   facet normal -9.927306e-001 -1.203574e-001 0.000000e+000
+      outer loop
+         vertex -4.963869e-001 -6.000000e-002 -4.000000e-002
+         vertex -4.995945e-001 -2.013297e-002 -8.000000e-002
+         vertex -4.898953e-001 -1.000128e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -9.891688e-001 -1.467825e-001 0.000000e+000
+      outer loop
+         vertex -4.963869e-001 -6.000000e-002 -4.000000e-002
+         vertex -4.898953e-001 -1.000128e-001 -8.000000e-002
+         vertex -4.963869e-001 -6.000000e-002 4.000000e-002
+      endloop
+   endfacet
+   facet normal 9.927306e-001 -1.203574e-001 0.000000e+000
+      outer loop
+         vertex 4.963869e-001 -6.000000e-002 -4.000000e-002
+         vertex 4.898953e-001 -1.000128e-001 -8.000000e-002
+         vertex 4.995945e-001 -2.013297e-002 -4.000000e-002
+      endloop
+   endfacet
+   facet normal 9.955921e-001 -9.378949e-002 0.000000e+000
+      outer loop
+         vertex 4.995945e-001 -2.013297e-002 -4.000000e-002
+         vertex 4.898953e-001 -1.000128e-001 -8.000000e-002
+         vertex 4.995945e-001 -2.013297e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 9.999130e-001 1.319381e-002 0.000000e+000
+      outer loop
+         vertex 4.995945e-001 -2.013297e-002 -4.000000e-002
+         vertex 4.995945e-001 -2.013297e-002 -8.000000e-002
+         vertex 4.963869e-001 6.000000e-002 -4.000000e-002
+      endloop
+   endfacet
+   facet normal 9.977564e-001 6.694920e-002 0.000000e+000
+      outer loop
+         vertex 4.963869e-001 6.000000e-002 -4.000000e-002
+         vertex 4.995945e-001 -2.013297e-002 -8.000000e-002
+         vertex 4.963544e-001 6.026834e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 9.927523e-001 1.201789e-001 0.000000e+000
+      outer loop
+         vertex 4.963869e-001 6.000000e-002 -4.000000e-002
+         vertex 4.963544e-001 6.026834e-002 -8.000000e-002
+         vertex 4.963869e-001 6.000000e-002 4.000000e-002
+      endloop
+   endfacet
+   facet normal -9.848379e-001 -1.734772e-001 0.000000e+000
+      outer loop
+         vertex -4.963869e-001 -6.000000e-002 4.000000e-002
+         vertex -4.898953e-001 -1.000128e-001 -8.000000e-002
+         vertex -4.898953e-001 -1.000128e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -9.676545e-001 -2.522791e-001 0.000000e+000
+      outer loop
+         vertex -4.898953e-001 -1.000128e-001 4.000000e-002
+         vertex -4.898953e-001 -1.000128e-001 -8.000000e-002
+         vertex -4.675081e-001 -1.773024e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -9.526865e-001 -3.039545e-001 0.000000e+000
+      outer loop
+         vertex -4.898953e-001 -1.000128e-001 4.000000e-002
+         vertex -4.675081e-001 -1.773024e-001 -8.000000e-002
+         vertex -4.675081e-001 -1.773024e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -9.146552e-001 -4.042349e-001 0.000000e+000
+      outer loop
+         vertex -4.675081e-001 -1.773024e-001 4.000000e-002
+         vertex -4.675081e-001 -1.773024e-001 -8.000000e-002
+         vertex -4.330127e-001 -2.500000e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -8.915918e-001 -4.528400e-001 0.000000e+000
+      outer loop
+         vertex -4.675081e-001 -1.773024e-001 4.000000e-002
+         vertex -4.330127e-001 -2.500000e-001 -8.000000e-002
+         vertex -4.330127e-001 -2.500000e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -8.379669e-001 -5.457212e-001 0.000000e+000
+      outer loop
+         vertex -4.330127e-001 -2.500000e-001 4.000000e-002
+         vertex -4.330127e-001 -2.500000e-001 -8.000000e-002
+         vertex -3.873025e-001 -3.162227e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -8.074053e-001 -5.899972e-001 0.000000e+000
+      outer loop
+         vertex -4.330127e-001 -2.500000e-001 4.000000e-002
+         vertex -3.873025e-001 -3.162227e-001 -8.000000e-002
+         vertex -3.873025e-001 -3.162227e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -7.395756e-001 -6.730735e-001 0.000000e+000
+      outer loop
+         vertex -3.873025e-001 -3.162227e-001 4.000000e-002
+         vertex -3.873025e-001 -3.162227e-001 -8.000000e-002
+         vertex -3.315613e-001 -3.742554e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -7.023074e-001 -7.118738e-001 0.000000e+000
+      outer loop
+         vertex -3.873025e-001 -3.162227e-001 4.000000e-002
+         vertex -3.315613e-001 -3.742554e-001 -8.000000e-002
+         vertex -3.315613e-001 -3.742554e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -6.220297e-001 -7.829937e-001 0.000000e+000
+      outer loop
+         vertex -3.315613e-001 -3.742554e-001 4.000000e-002
+         vertex -3.315613e-001 -3.742554e-001 -8.000000e-002
+         vertex -2.672329e-001 -4.225951e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -5.790201e-001 -8.153133e-001 0.000000e+000
+      outer loop
+         vertex -3.315613e-001 -3.742554e-001 4.000000e-002
+         vertex -2.672329e-001 -4.225951e-001 -8.000000e-002
+         vertex -2.672329e-001 -4.225951e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -4.883735e-001 -8.726347e-001 0.000000e+000
+      outer loop
+         vertex -2.672329e-001 -4.225951e-001 4.000000e-002
+         vertex -2.672329e-001 -4.225951e-001 -8.000000e-002
+         vertex -1.959833e-001 -4.599897e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -4.407364e-001 -8.976365e-001 0.000000e+000
+      outer loop
+         vertex -2.672329e-001 -4.225951e-001 4.000000e-002
+         vertex -1.959833e-001 -4.599897e-001 -8.000000e-002
+         vertex -1.959833e-001 -4.599897e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -3.420688e-001 -9.396749e-001 0.000000e+000
+      outer loop
+         vertex -1.959833e-001 -4.599897e-001 4.000000e-002
+         vertex -1.959833e-001 -4.599897e-001 -8.000000e-002
+         vertex -1.196578e-001 -4.854709e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -2.910380e-001 -9.567115e-001 0.000000e+000
+      outer loop
+         vertex -1.959833e-001 -4.599897e-001 4.000000e-002
+         vertex -1.196578e-001 -4.854709e-001 -8.000000e-002
+         vertex -1.196578e-001 -4.854709e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -1.869046e-001 -9.823781e-001 0.000000e+000
+      outer loop
+         vertex -1.196578e-001 -4.854709e-001 4.000000e-002
+         vertex -1.196578e-001 -4.854709e-001 -8.000000e-002
+         vertex -4.023328e-002 -4.983787e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -1.338019e-001 -9.910081e-001 0.000000e+000
+      outer loop
+         vertex -1.196578e-001 -4.854709e-001 4.000000e-002
+         vertex -4.023328e-002 -4.983787e-001 -8.000000e-002
+         vertex -4.023328e-002 -4.983787e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -5.368308e-002 -9.985580e-001 0.000000e+000
+      outer loop
+         vertex -4.023328e-002 -4.983787e-001 4.000000e-002
+         vertex -4.023328e-002 -4.983787e-001 -8.000000e-002
+         vertex 6.123234e-017 -5.000000e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 -1.000000e+000 0.000000e+000
+      outer loop
+         vertex -4.023328e-002 -4.983787e-001 4.000000e-002
+         vertex 6.123234e-017 -5.000000e-001 -8.000000e-002
+         vertex 4.023328e-002 -4.983787e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 5.368308e-002 -9.985580e-001 0.000000e+000
+      outer loop
+         vertex 6.123234e-017 -5.000000e-001 -8.000000e-002
+         vertex 4.023328e-002 -4.983787e-001 -8.000000e-002
+         vertex 4.023328e-002 -4.983787e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 1.338019e-001 -9.910081e-001 0.000000e+000
+      outer loop
+         vertex 4.023328e-002 -4.983787e-001 4.000000e-002
+         vertex 4.023328e-002 -4.983787e-001 -8.000000e-002
+         vertex 1.196578e-001 -4.854709e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 1.869046e-001 -9.823781e-001 0.000000e+000
+      outer loop
+         vertex 4.023328e-002 -4.983787e-001 4.000000e-002
+         vertex 1.196578e-001 -4.854709e-001 -8.000000e-002
+         vertex 1.196578e-001 -4.854709e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 2.910380e-001 -9.567115e-001 0.000000e+000
+      outer loop
+         vertex 1.196578e-001 -4.854709e-001 4.000000e-002
+         vertex 1.196578e-001 -4.854709e-001 -8.000000e-002
+         vertex 1.959833e-001 -4.599897e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 3.420688e-001 -9.396749e-001 0.000000e+000
+      outer loop
+         vertex 1.196578e-001 -4.854709e-001 4.000000e-002
+         vertex 1.959833e-001 -4.599897e-001 -8.000000e-002
+         vertex 1.959833e-001 -4.599897e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 4.407365e-001 -8.976365e-001 0.000000e+000
+      outer loop
+         vertex 1.959833e-001 -4.599897e-001 4.000000e-002
+         vertex 1.959833e-001 -4.599897e-001 -8.000000e-002
+         vertex 2.672329e-001 -4.225951e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 4.883735e-001 -8.726346e-001 0.000000e+000
+      outer loop
+         vertex 1.959833e-001 -4.599897e-001 4.000000e-002
+         vertex 2.672329e-001 -4.225951e-001 -8.000000e-002
+         vertex 2.672329e-001 -4.225951e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 5.790201e-001 -8.153133e-001 0.000000e+000
+      outer loop
+         vertex 2.672329e-001 -4.225951e-001 4.000000e-002
+         vertex 2.672329e-001 -4.225951e-001 -8.000000e-002
+         vertex 3.315613e-001 -3.742554e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 6.220297e-001 -7.829937e-001 0.000000e+000
+      outer loop
+         vertex 2.672329e-001 -4.225951e-001 4.000000e-002
+         vertex 3.315613e-001 -3.742554e-001 -8.000000e-002
+         vertex 3.315613e-001 -3.742554e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 7.023074e-001 -7.118738e-001 0.000000e+000
+      outer loop
+         vertex 3.315613e-001 -3.742554e-001 4.000000e-002
+         vertex 3.315613e-001 -3.742554e-001 -8.000000e-002
+         vertex 3.873025e-001 -3.162227e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 7.395756e-001 -6.730735e-001 0.000000e+000
+      outer loop
+         vertex 3.315613e-001 -3.742554e-001 4.000000e-002
+         vertex 3.873025e-001 -3.162227e-001 -8.000000e-002
+         vertex 3.873025e-001 -3.162227e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 8.074053e-001 -5.899972e-001 0.000000e+000
+      outer loop
+         vertex 3.873025e-001 -3.162227e-001 4.000000e-002
+         vertex 3.873025e-001 -3.162227e-001 -8.000000e-002
+         vertex 4.330127e-001 -2.500000e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 8.379669e-001 -5.457212e-001 0.000000e+000
+      outer loop
+         vertex 3.873025e-001 -3.162227e-001 4.000000e-002
+         vertex 4.330127e-001 -2.500000e-001 -8.000000e-002
+         vertex 4.330127e-001 -2.500000e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 8.915918e-001 -4.528400e-001 0.000000e+000
+      outer loop
+         vertex 4.330127e-001 -2.500000e-001 4.000000e-002
+         vertex 4.330127e-001 -2.500000e-001 -8.000000e-002
+         vertex 4.675081e-001 -1.773024e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 9.146552e-001 -4.042349e-001 0.000000e+000
+      outer loop
+         vertex 4.330127e-001 -2.500000e-001 4.000000e-002
+         vertex 4.675081e-001 -1.773024e-001 -8.000000e-002
+         vertex 4.675081e-001 -1.773024e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 9.526865e-001 -3.039545e-001 0.000000e+000
+      outer loop
+         vertex 4.675081e-001 -1.773024e-001 4.000000e-002
+         vertex 4.675081e-001 -1.773024e-001 -8.000000e-002
+         vertex 4.898953e-001 -1.000128e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 9.676545e-001 -2.522791e-001 0.000000e+000
+      outer loop
+         vertex 4.675081e-001 -1.773024e-001 4.000000e-002
+         vertex 4.898953e-001 -1.000128e-001 -8.000000e-002
+         vertex 4.898953e-001 -1.000128e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 9.848379e-001 -1.734772e-001 0.000000e+000
+      outer loop
+         vertex 4.898953e-001 -1.000128e-001 4.000000e-002
+         vertex 4.898953e-001 -1.000128e-001 -8.000000e-002
+         vertex 4.963869e-001 -6.000000e-002 -4.000000e-002
+      endloop
+   endfacet
+   facet normal 9.891688e-001 -1.467825e-001 0.000000e+000
+      outer loop
+         vertex 4.898953e-001 -1.000128e-001 4.000000e-002
+         vertex 4.963869e-001 -6.000000e-002 -4.000000e-002
+         vertex 4.963869e-001 -6.000000e-002 4.000000e-002
+      endloop
+   endfacet
+   facet normal 9.927306e-001 1.203578e-001 0.000000e+000
+      outer loop
+         vertex 4.963869e-001 6.000000e-002 4.000000e-002
+         vertex 4.963544e-001 6.026834e-002 -8.000000e-002
+         vertex 4.963544e-001 6.026834e-002 4.000000e-002
+      endloop
+   endfacet
+   facet normal 9.848167e-001 1.735972e-001 0.000000e+000
+      outer loop
+         vertex 4.963544e-001 6.026834e-002 4.000000e-002
+         vertex 4.963544e-001 6.026834e-002 -8.000000e-002
+         vertex 4.802591e-001 1.391087e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 9.740555e-001 2.263094e-001 0.000000e+000
+      outer loop
+         vertex 4.963544e-001 6.026834e-002 4.000000e-002
+         vertex 4.802591e-001 1.391087e-001 -8.000000e-002
+         vertex 4.802591e-001 1.391087e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 9.442167e-001 3.293249e-001 0.000000e+000
+      outer loop
+         vertex 4.802591e-001 1.391087e-001 4.000000e-002
+         vertex 4.802591e-001 1.391087e-001 -8.000000e-002
+         vertex 4.517252e-001 2.143463e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 9.251391e-001 3.796282e-001 0.000000e+000
+      outer loop
+         vertex 4.802591e-001 1.391087e-001 4.000000e-002
+         vertex 4.517252e-001 2.143463e-001 -8.000000e-002
+         vertex 4.517252e-001 2.143463e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 8.791618e-001 4.765233e-001 0.000000e+000
+      outer loop
+         vertex 4.517252e-001 2.143463e-001 4.000000e-002
+         vertex 4.517252e-001 2.143463e-001 -8.000000e-002
+         vertex 4.114919e-001 2.840324e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 8.522621e-001 5.231149e-001 0.000000e+000
+      outer loop
+         vertex 4.517252e-001 2.143463e-001 4.000000e-002
+         vertex 4.114919e-001 2.840324e-001 -8.000000e-002
+         vertex 4.114919e-001 2.840324e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 7.913373e-001 6.113799e-001 0.000000e+000
+      outer loop
+         vertex 4.114919e-001 2.840324e-001 4.000000e-002
+         vertex 4.114919e-001 2.840324e-001 -8.000000e-002
+         vertex 3.606012e-001 3.463622e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 7.573121e-001 6.530532e-001 0.000000e+000
+      outer loop
+         vertex 4.114919e-001 2.840324e-001 4.000000e-002
+         vertex 3.606012e-001 3.463622e-001 -8.000000e-002
+         vertex 3.606012e-001 3.463622e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 6.830174e-001 7.304021e-001 0.000000e+000
+      outer loop
+         vertex 3.606012e-001 3.463622e-001 4.000000e-002
+         vertex 3.606012e-001 3.463622e-001 -8.000000e-002
+         vertex 3.003711e-001 3.997214e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 6.427480e-001 7.660777e-001 0.000000e+000
+      outer loop
+         vertex 3.606012e-001 3.463622e-001 4.000000e-002
+         vertex 3.003711e-001 3.997214e-001 -8.000000e-002
+         vertex 3.003711e-001 3.997214e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 5.570078e-001 8.305073e-001 0.000000e+000
+      outer loop
+         vertex 3.003711e-001 3.997214e-001 4.000000e-002
+         vertex 3.003711e-001 3.997214e-001 -8.000000e-002
+         vertex 2.323616e-001 4.427280e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 5.115370e-001 8.592612e-001 0.000000e+000
+      outer loop
+         vertex 3.003711e-001 3.997214e-001 4.000000e-002
+         vertex 2.323616e-001 4.427280e-001 -8.000000e-002
+         vertex 2.323616e-001 4.427280e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 4.165719e-001 9.091027e-001 0.000000e+000
+      outer loop
+         vertex 2.323616e-001 4.427280e-001 4.000000e-002
+         vertex 2.323616e-001 4.427280e-001 -8.000000e-002
+         vertex 1.583340e-001 4.742682e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 3.670776e-001 9.301903e-001 0.000000e+000
+      outer loop
+         vertex 2.323616e-001 4.427280e-001 4.000000e-002
+         vertex 1.583340e-001 4.742682e-001 -8.000000e-002
+         vertex 1.583340e-001 4.742682e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 2.653471e-001 9.641529e-001 0.000000e+000
+      outer loop
+         vertex 1.583340e-001 4.742682e-001 4.000000e-002
+         vertex 1.583340e-001 4.742682e-001 -8.000000e-002
+         vertex 8.020564e-002 4.935251e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 2.131110e-001 9.770280e-001 0.000000e+000
+      outer loop
+         vertex 1.583340e-001 4.742682e-001 4.000000e-002
+         vertex 8.020564e-002 4.935251e-001 -8.000000e-002
+         vertex 8.020564e-002 4.935251e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 1.072499e-001 9.942321e-001 0.000000e+000
+      outer loop
+         vertex 8.020564e-002 4.935251e-001 4.000000e-002
+         vertex 8.020564e-002 4.935251e-001 -8.000000e-002
+         vertex 0.000000e+000 5.000000e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 5.362497e-002 9.985611e-001 0.000000e+000
+      outer loop
+         vertex 8.020564e-002 4.935251e-001 4.000000e-002
+         vertex 0.000000e+000 5.000000e-001 -8.000000e-002
+         vertex 0.000000e+000 5.000000e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -5.362497e-002 9.985611e-001 0.000000e+000
+      outer loop
+         vertex 0.000000e+000 5.000000e-001 4.000000e-002
+         vertex 0.000000e+000 5.000000e-001 -8.000000e-002
+         vertex -8.020564e-002 4.935251e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -1.072499e-001 9.942321e-001 0.000000e+000
+      outer loop
+         vertex 0.000000e+000 5.000000e-001 4.000000e-002
+         vertex -8.020564e-002 4.935251e-001 -8.000000e-002
+         vertex -8.020564e-002 4.935251e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -2.131110e-001 9.770280e-001 0.000000e+000
+      outer loop
+         vertex -8.020564e-002 4.935251e-001 4.000000e-002
+         vertex -8.020564e-002 4.935251e-001 -8.000000e-002
+         vertex -1.583340e-001 4.742682e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -2.653471e-001 9.641529e-001 0.000000e+000
+      outer loop
+         vertex -8.020564e-002 4.935251e-001 4.000000e-002
+         vertex -1.583340e-001 4.742682e-001 -8.000000e-002
+         vertex -1.583340e-001 4.742682e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -3.670776e-001 9.301903e-001 0.000000e+000
+      outer loop
+         vertex -1.583340e-001 4.742682e-001 4.000000e-002
+         vertex -1.583340e-001 4.742682e-001 -8.000000e-002
+         vertex -2.323616e-001 4.427280e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -4.165719e-001 9.091027e-001 0.000000e+000
+      outer loop
+         vertex -1.583340e-001 4.742682e-001 4.000000e-002
+         vertex -2.323616e-001 4.427280e-001 -8.000000e-002
+         vertex -2.323616e-001 4.427280e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -5.115370e-001 8.592612e-001 0.000000e+000
+      outer loop
+         vertex -2.323616e-001 4.427280e-001 4.000000e-002
+         vertex -2.323616e-001 4.427280e-001 -8.000000e-002
+         vertex -3.003711e-001 3.997214e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -5.570078e-001 8.305073e-001 0.000000e+000
+      outer loop
+         vertex -2.323616e-001 4.427280e-001 4.000000e-002
+         vertex -3.003711e-001 3.997214e-001 -8.000000e-002
+         vertex -3.003711e-001 3.997214e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -6.427480e-001 7.660777e-001 0.000000e+000
+      outer loop
+         vertex -3.003711e-001 3.997214e-001 4.000000e-002
+         vertex -3.003711e-001 3.997214e-001 -8.000000e-002
+         vertex -3.606012e-001 3.463622e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -6.830174e-001 7.304021e-001 0.000000e+000
+      outer loop
+         vertex -3.003711e-001 3.997214e-001 4.000000e-002
+         vertex -3.606012e-001 3.463622e-001 -8.000000e-002
+         vertex -3.606012e-001 3.463622e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -7.573121e-001 6.530532e-001 0.000000e+000
+      outer loop
+         vertex -3.606012e-001 3.463622e-001 4.000000e-002
+         vertex -3.606012e-001 3.463622e-001 -8.000000e-002
+         vertex -4.114919e-001 2.840324e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -7.913373e-001 6.113799e-001 0.000000e+000
+      outer loop
+         vertex -3.606012e-001 3.463622e-001 4.000000e-002
+         vertex -4.114919e-001 2.840324e-001 -8.000000e-002
+         vertex -4.114919e-001 2.840324e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -8.522621e-001 5.231149e-001 0.000000e+000
+      outer loop
+         vertex -4.114919e-001 2.840324e-001 4.000000e-002
+         vertex -4.114919e-001 2.840324e-001 -8.000000e-002
+         vertex -4.517252e-001 2.143463e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -8.791618e-001 4.765233e-001 0.000000e+000
+      outer loop
+         vertex -4.114919e-001 2.840324e-001 4.000000e-002
+         vertex -4.517252e-001 2.143463e-001 -8.000000e-002
+         vertex -4.517252e-001 2.143463e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -9.251391e-001 3.796283e-001 0.000000e+000
+      outer loop
+         vertex -4.517252e-001 2.143463e-001 4.000000e-002
+         vertex -4.517252e-001 2.143463e-001 -8.000000e-002
+         vertex -4.802591e-001 1.391087e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -9.442167e-001 3.293249e-001 0.000000e+000
+      outer loop
+         vertex -4.517252e-001 2.143463e-001 4.000000e-002
+         vertex -4.802591e-001 1.391087e-001 -8.000000e-002
+         vertex -4.802591e-001 1.391087e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -9.740555e-001 2.263094e-001 0.000000e+000
+      outer loop
+         vertex -4.802591e-001 1.391087e-001 4.000000e-002
+         vertex -4.802591e-001 1.391087e-001 -8.000000e-002
+         vertex -4.963544e-001 6.026834e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -9.848167e-001 1.735972e-001 0.000000e+000
+      outer loop
+         vertex -4.802591e-001 1.391087e-001 4.000000e-002
+         vertex -4.963544e-001 6.026834e-002 -8.000000e-002
+         vertex -4.963544e-001 6.026834e-002 4.000000e-002
+      endloop
+   endfacet
+   facet normal -9.927306e-001 1.203578e-001 0.000000e+000
+      outer loop
+         vertex -4.963544e-001 6.026834e-002 4.000000e-002
+         vertex -4.963544e-001 6.026834e-002 -8.000000e-002
+         vertex -4.963869e-001 6.000000e-002 -4.000000e-002
+      endloop
+   endfacet
+   facet normal -9.927523e-001 1.201789e-001 0.000000e+000
+      outer loop
+         vertex -4.963544e-001 6.026834e-002 4.000000e-002
+         vertex -4.963869e-001 6.000000e-002 -4.000000e-002
+         vertex -4.963869e-001 6.000000e-002 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex -4.963869e-001 6.000000e-002 4.000000e-002
+         vertex 2.450000e-001 6.000000e-002 4.000000e-002
+         vertex -4.963544e-001 6.026834e-002 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex -4.963544e-001 6.026834e-002 4.000000e-002
+         vertex 2.450000e-001 6.000000e-002 4.000000e-002
+         vertex 2.450000e-001 1.600000e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex -4.963544e-001 6.026834e-002 4.000000e-002
+         vertex 2.450000e-001 1.600000e-001 4.000000e-002
+         vertex -4.802591e-001 1.391087e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex -3.003711e-001 3.997214e-001 4.000000e-002
+         vertex -3.606012e-001 3.463622e-001 4.000000e-002
+         vertex -2.323616e-001 4.427280e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex -2.323616e-001 4.427280e-001 4.000000e-002
+         vertex -3.606012e-001 3.463622e-001 4.000000e-002
+         vertex -4.114919e-001 2.840324e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex -2.323616e-001 4.427280e-001 4.000000e-002
+         vertex -4.114919e-001 2.840324e-001 4.000000e-002
+         vertex -1.583340e-001 4.742682e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex -1.583340e-001 4.742682e-001 4.000000e-002
+         vertex -4.114919e-001 2.840324e-001 4.000000e-002
+         vertex -4.517252e-001 2.143463e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex -1.583340e-001 4.742682e-001 4.000000e-002
+         vertex -4.517252e-001 2.143463e-001 4.000000e-002
+         vertex -8.020564e-002 4.935251e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 8.020564e-002 4.935251e-001 4.000000e-002
+         vertex 0.000000e+000 5.000000e-001 4.000000e-002
+         vertex -8.020564e-002 4.935251e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 2.550000e-001 6.000000e-002 4.000000e-002
+         vertex 4.963869e-001 6.000000e-002 4.000000e-002
+         vertex 4.963544e-001 6.026834e-002 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 2.550000e-001 1.600000e-001 4.000000e-002
+         vertex 3.606012e-001 3.463622e-001 4.000000e-002
+         vertex 2.450000e-001 1.600000e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 2.450000e-001 1.600000e-001 4.000000e-002
+         vertex 3.606012e-001 3.463622e-001 4.000000e-002
+         vertex 3.003711e-001 3.997214e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 2.450000e-001 1.600000e-001 4.000000e-002
+         vertex 3.003711e-001 3.997214e-001 4.000000e-002
+         vertex 2.323616e-001 4.427280e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 4.963544e-001 6.026834e-002 4.000000e-002
+         vertex 4.802591e-001 1.391087e-001 4.000000e-002
+         vertex 2.550000e-001 6.000000e-002 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 2.550000e-001 6.000000e-002 4.000000e-002
+         vertex 4.802591e-001 1.391087e-001 4.000000e-002
+         vertex 4.517252e-001 2.143463e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 2.550000e-001 6.000000e-002 4.000000e-002
+         vertex 4.517252e-001 2.143463e-001 4.000000e-002
+         vertex 2.550000e-001 1.600000e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 2.550000e-001 1.600000e-001 4.000000e-002
+         vertex 4.517252e-001 2.143463e-001 4.000000e-002
+         vertex 4.114919e-001 2.840324e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 2.550000e-001 1.600000e-001 4.000000e-002
+         vertex 4.114919e-001 2.840324e-001 4.000000e-002
+         vertex 3.606012e-001 3.463622e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex -4.517252e-001 2.143463e-001 4.000000e-002
+         vertex -4.802591e-001 1.391087e-001 4.000000e-002
+         vertex -8.020564e-002 4.935251e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex -8.020564e-002 4.935251e-001 4.000000e-002
+         vertex -4.802591e-001 1.391087e-001 4.000000e-002
+         vertex 2.450000e-001 1.600000e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex -8.020564e-002 4.935251e-001 4.000000e-002
+         vertex 2.450000e-001 1.600000e-001 4.000000e-002
+         vertex 8.020564e-002 4.935251e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 8.020564e-002 4.935251e-001 4.000000e-002
+         vertex 2.450000e-001 1.600000e-001 4.000000e-002
+         vertex 2.323616e-001 4.427280e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 8.020564e-002 4.935251e-001 4.000000e-002
+         vertex 2.323616e-001 4.427280e-001 4.000000e-002
+         vertex 1.583340e-001 4.742682e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex -4.963869e-001 -6.000000e-002 -4.000000e-002
+         vertex 4.963869e-001 -6.000000e-002 -4.000000e-002
+         vertex -4.995945e-001 -2.013297e-002 -4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex -4.995945e-001 -2.013297e-002 -4.000000e-002
+         vertex 4.963869e-001 -6.000000e-002 -4.000000e-002
+         vertex 4.995945e-001 -2.013297e-002 -4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex -4.995945e-001 -2.013297e-002 -4.000000e-002
+         vertex 4.995945e-001 -2.013297e-002 -4.000000e-002
+         vertex -4.963869e-001 6.000000e-002 -4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex -4.963869e-001 6.000000e-002 -4.000000e-002
+         vertex 4.995945e-001 -2.013297e-002 -4.000000e-002
+         vertex 4.963869e-001 6.000000e-002 -4.000000e-002
+      endloop
+   endfacet
+   facet normal -1.293022e-016 1.000000e+000 0.000000e+000
+      outer loop
+         vertex 4.963869e-001 -6.000000e-002 -4.000000e-002
+         vertex -4.963869e-001 -6.000000e-002 -4.000000e-002
+         vertex 4.963869e-001 -6.000000e-002 4.000000e-002
+      endloop
+   endfacet
+   facet normal -1.293022e-016 1.000000e+000 0.000000e+000
+      outer loop
+         vertex 4.963869e-001 -6.000000e-002 4.000000e-002
+         vertex -4.963869e-001 -6.000000e-002 -4.000000e-002
+         vertex -4.963869e-001 -6.000000e-002 4.000000e-002
+      endloop
+   endfacet
+   facet normal 1.293022e-016 -1.000000e+000 0.000000e+000
+      outer loop
+         vertex 2.450000e-001 6.000000e-002 4.000000e-002
+         vertex -4.963869e-001 6.000000e-002 4.000000e-002
+         vertex 2.450000e-001 6.000000e-002 2.000000e-002
+      endloop
+   endfacet
+   facet normal 1.293022e-016 -1.000000e+000 0.000000e+000
+      outer loop
+         vertex 2.450000e-001 6.000000e-002 2.000000e-002
+         vertex -4.963869e-001 6.000000e-002 4.000000e-002
+         vertex -4.963869e-001 6.000000e-002 -4.000000e-002
+      endloop
+   endfacet
+   facet normal 1.293022e-016 -1.000000e+000 0.000000e+000
+      outer loop
+         vertex 2.450000e-001 6.000000e-002 2.000000e-002
+         vertex -4.963869e-001 6.000000e-002 -4.000000e-002
+         vertex 2.550000e-001 6.000000e-002 2.000000e-002
+      endloop
+   endfacet
+   facet normal 1.293022e-016 -1.000000e+000 0.000000e+000
+      outer loop
+         vertex 2.550000e-001 6.000000e-002 2.000000e-002
+         vertex -4.963869e-001 6.000000e-002 -4.000000e-002
+         vertex 4.963869e-001 6.000000e-002 -4.000000e-002
+      endloop
+   endfacet
+   facet normal 1.293022e-016 -1.000000e+000 0.000000e+000
+      outer loop
+         vertex 2.550000e-001 6.000000e-002 2.000000e-002
+         vertex 4.963869e-001 6.000000e-002 -4.000000e-002
+         vertex 2.550000e-001 6.000000e-002 4.000000e-002
+      endloop
+   endfacet
+   facet normal 1.293022e-016 -1.000000e+000 0.000000e+000
+      outer loop
+         vertex 2.550000e-001 6.000000e-002 4.000000e-002
+         vertex 4.963869e-001 6.000000e-002 -4.000000e-002
+         vertex 4.963869e-001 6.000000e-002 4.000000e-002
+      endloop
+   endfacet
+   facet normal -8.370229e-002 9.964908e-001 0.000000e+000
+      outer loop
+         vertex 7.347881e-017 2.000000e-001 -1.800000e-001
+         vertex -2.506665e-002 1.984229e-001 -1.800000e-001
+         vertex -2.506665e-002 1.984229e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -2.077190e-001 9.781886e-001 0.000000e+000
+      outer loop
+         vertex -2.506665e-002 1.984229e-001 -8.000000e-002
+         vertex -2.506665e-002 1.984229e-001 -1.800000e-001
+         vertex -7.362491e-002 1.859553e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal -2.892204e-001 9.572625e-001 0.000000e+000
+      outer loop
+         vertex -2.506665e-002 1.984229e-001 -8.000000e-002
+         vertex -7.362491e-002 1.859553e-001 -1.800000e-001
+         vertex -7.362491e-002 1.859553e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -4.444587e-001 8.957993e-001 0.000000e+000
+      outer loop
+         vertex -7.362491e-002 1.859553e-001 -8.000000e-002
+         vertex -7.362491e-002 1.859553e-001 -1.800000e-001
+         vertex -1.175570e-001 1.618034e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal -5.181955e-001 8.552622e-001 0.000000e+000
+      outer loop
+         vertex -7.362491e-002 1.859553e-001 -8.000000e-002
+         vertex -1.175570e-001 1.618034e-001 -1.800000e-001
+         vertex -1.175570e-001 1.618034e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -6.532714e-001 7.571238e-001 0.000000e+000
+      outer loop
+         vertex -1.175570e-001 1.618034e-001 -8.000000e-002
+         vertex -1.175570e-001 1.618034e-001 -1.800000e-001
+         vertex -1.541027e-001 1.274848e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal -7.146106e-001 6.995225e-001 0.000000e+000
+      outer loop
+         vertex -1.175570e-001 1.618034e-001 -8.000000e-002
+         vertex -1.541027e-001 1.274848e-001 -1.800000e-001
+         vertex -1.541027e-001 1.274848e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -8.210368e-001 5.708753e-001 0.000000e+000
+      outer loop
+         vertex -1.541027e-001 1.274848e-001 -8.000000e-002
+         vertex -1.541027e-001 1.274848e-001 -1.800000e-001
+         vertex -1.809654e-001 8.515586e-002 -1.800000e-001
+      endloop
+   endfacet
+   facet normal -8.661239e-001 4.998294e-001 0.000000e+000
+      outer loop
+         vertex -1.541027e-001 1.274848e-001 -8.000000e-002
+         vertex -1.809654e-001 8.515586e-002 -1.800000e-001
+         vertex -1.809654e-001 8.515586e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -9.372133e-001 3.487567e-001 0.000000e+000
+      outer loop
+         vertex -1.809654e-001 8.515586e-002 -8.000000e-002
+         vertex -1.809654e-001 8.515586e-002 -1.800000e-001
+         vertex -1.964574e-001 3.747626e-002 -1.800000e-001
+      endloop
+   endfacet
+   facet normal -9.632155e-001 2.687301e-001 0.000000e+000
+      outer loop
+         vertex -1.809654e-001 8.515586e-002 -8.000000e-002
+         vertex -1.964574e-001 3.747626e-002 -1.800000e-001
+         vertex -1.964574e-001 3.747626e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -9.945013e-001 1.047244e-001 0.000000e+000
+      outer loop
+         vertex -1.964574e-001 3.747626e-002 -8.000000e-002
+         vertex -1.964574e-001 3.747626e-002 -1.800000e-001
+         vertex -1.996053e-001 -1.255810e-002 -1.800000e-001
+      endloop
+   endfacet
+   facet normal -9.997848e-001 2.074543e-002 0.000000e+000
+      outer loop
+         vertex -1.964574e-001 3.747626e-002 -8.000000e-002
+         vertex -1.996053e-001 -1.255810e-002 -1.800000e-001
+         vertex -1.996053e-001 -1.255810e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -9.893011e-001 -1.458881e-001 0.000000e+000
+      outer loop
+         vertex -1.996053e-001 -1.255810e-002 -8.000000e-002
+         vertex -1.996053e-001 -1.255810e-002 -1.800000e-001
+         vertex -1.902113e-001 -6.180340e-002 -1.800000e-001
+      endloop
+   endfacet
+   facet normal -9.735339e-001 -2.285427e-001 0.000000e+000
+      outer loop
+         vertex -1.996053e-001 -1.255810e-002 -8.000000e-002
+         vertex -1.902113e-001 -6.180340e-002 -1.800000e-001
+         vertex -1.902113e-001 -6.180340e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -9.219395e-001 -3.873340e-001 0.000000e+000
+      outer loop
+         vertex -1.902113e-001 -6.180340e-002 -8.000000e-002
+         vertex -1.902113e-001 -6.180340e-002 -1.800000e-001
+         vertex -1.688656e-001 -1.071654e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal -8.861123e-001 -4.634706e-001 0.000000e+000
+      outer loop
+         vertex -1.902113e-001 -6.180340e-002 -8.000000e-002
+         vertex -1.688656e-001 -1.071654e-001 -1.800000e-001
+         vertex -1.688656e-001 -1.071654e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -7.966490e-001 -6.044421e-001 0.000000e+000
+      outer loop
+         vertex -1.688656e-001 -1.071654e-001 -8.000000e-002
+         vertex -1.688656e-001 -1.071654e-001 -1.800000e-001
+         vertex -1.369094e-001 -1.457937e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal -7.430130e-001 -6.692770e-001 0.000000e+000
+      outer loop
+         vertex -1.688656e-001 -1.071654e-001 -8.000000e-002
+         vertex -1.369094e-001 -1.457937e-001 -1.800000e-001
+         vertex -1.369094e-001 -1.457937e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -6.213022e-001 -7.835710e-001 0.000000e+000
+      outer loop
+         vertex -1.369094e-001 -1.457937e-001 -8.000000e-002
+         vertex -1.369094e-001 -1.457937e-001 -1.800000e-001
+         vertex -9.635074e-002 -1.752613e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal -5.532274e-001 -8.330302e-001 0.000000e+000
+      outer loop
+         vertex -1.369094e-001 -1.457937e-001 -8.000000e-002
+         vertex -9.635074e-002 -1.752613e-001 -1.800000e-001
+         vertex -9.635074e-002 -1.752613e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -4.069166e-001 -9.134653e-001 0.000000e+000
+      outer loop
+         vertex -9.635074e-002 -1.752613e-001 -8.000000e-002
+         vertex -9.635074e-002 -1.752613e-001 -1.800000e-001
+         vertex -4.973798e-002 -1.937166e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal -3.286806e-001 -9.444411e-001 0.000000e+000
+      outer loop
+         vertex -9.635074e-002 -1.752613e-001 -8.000000e-002
+         vertex -4.973798e-002 -1.937166e-001 -1.800000e-001
+         vertex -4.973798e-002 -1.937166e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal -1.669630e-001 -9.859632e-001 0.000000e+000
+      outer loop
+         vertex -4.973798e-002 -1.937166e-001 -8.000000e-002
+         vertex -4.973798e-002 -1.937166e-001 -1.800000e-001
+         vertex 0.000000e+000 -2.000000e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal -8.348151e-002 -9.965093e-001 0.000000e+000
+      outer loop
+         vertex -4.973798e-002 -1.937166e-001 -8.000000e-002
+         vertex 0.000000e+000 -2.000000e-001 -1.800000e-001
+         vertex 0.000000e+000 -2.000000e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 8.348151e-002 -9.965093e-001 0.000000e+000
+      outer loop
+         vertex 0.000000e+000 -2.000000e-001 -8.000000e-002
+         vertex 0.000000e+000 -2.000000e-001 -1.800000e-001
+         vertex 4.973798e-002 -1.937166e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 1.669630e-001 -9.859632e-001 0.000000e+000
+      outer loop
+         vertex 0.000000e+000 -2.000000e-001 -8.000000e-002
+         vertex 4.973798e-002 -1.937166e-001 -1.800000e-001
+         vertex 4.973798e-002 -1.937166e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 3.286806e-001 -9.444411e-001 0.000000e+000
+      outer loop
+         vertex 4.973798e-002 -1.937166e-001 -8.000000e-002
+         vertex 4.973798e-002 -1.937166e-001 -1.800000e-001
+         vertex 9.635074e-002 -1.752613e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 4.069166e-001 -9.134653e-001 0.000000e+000
+      outer loop
+         vertex 4.973798e-002 -1.937166e-001 -8.000000e-002
+         vertex 9.635074e-002 -1.752613e-001 -1.800000e-001
+         vertex 9.635074e-002 -1.752613e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 5.532274e-001 -8.330302e-001 0.000000e+000
+      outer loop
+         vertex 9.635074e-002 -1.752613e-001 -8.000000e-002
+         vertex 9.635074e-002 -1.752613e-001 -1.800000e-001
+         vertex 1.369094e-001 -1.457937e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 6.213022e-001 -7.835710e-001 0.000000e+000
+      outer loop
+         vertex 9.635074e-002 -1.752613e-001 -8.000000e-002
+         vertex 1.369094e-001 -1.457937e-001 -1.800000e-001
+         vertex 1.369094e-001 -1.457937e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 7.430130e-001 -6.692770e-001 0.000000e+000
+      outer loop
+         vertex 1.369094e-001 -1.457937e-001 -8.000000e-002
+         vertex 1.369094e-001 -1.457937e-001 -1.800000e-001
+         vertex 1.688656e-001 -1.071654e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 7.966490e-001 -6.044421e-001 0.000000e+000
+      outer loop
+         vertex 1.369094e-001 -1.457937e-001 -8.000000e-002
+         vertex 1.688656e-001 -1.071654e-001 -1.800000e-001
+         vertex 1.688656e-001 -1.071654e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 8.861123e-001 -4.634706e-001 0.000000e+000
+      outer loop
+         vertex 1.688656e-001 -1.071654e-001 -8.000000e-002
+         vertex 1.688656e-001 -1.071654e-001 -1.800000e-001
+         vertex 1.902113e-001 -6.180340e-002 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 9.219395e-001 -3.873340e-001 0.000000e+000
+      outer loop
+         vertex 1.688656e-001 -1.071654e-001 -8.000000e-002
+         vertex 1.902113e-001 -6.180340e-002 -1.800000e-001
+         vertex 1.902113e-001 -6.180340e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 9.735339e-001 -2.285427e-001 0.000000e+000
+      outer loop
+         vertex 1.902113e-001 -6.180340e-002 -8.000000e-002
+         vertex 1.902113e-001 -6.180340e-002 -1.800000e-001
+         vertex 1.996053e-001 -1.255810e-002 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 9.893011e-001 -1.458881e-001 0.000000e+000
+      outer loop
+         vertex 1.902113e-001 -6.180340e-002 -8.000000e-002
+         vertex 1.996053e-001 -1.255810e-002 -1.800000e-001
+         vertex 1.996053e-001 -1.255810e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 9.997848e-001 2.074543e-002 0.000000e+000
+      outer loop
+         vertex 1.996053e-001 -1.255810e-002 -8.000000e-002
+         vertex 1.996053e-001 -1.255810e-002 -1.800000e-001
+         vertex 1.964574e-001 3.747626e-002 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 9.945013e-001 1.047244e-001 0.000000e+000
+      outer loop
+         vertex 1.996053e-001 -1.255810e-002 -8.000000e-002
+         vertex 1.964574e-001 3.747626e-002 -1.800000e-001
+         vertex 1.964574e-001 3.747626e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 9.632155e-001 2.687300e-001 0.000000e+000
+      outer loop
+         vertex 1.964574e-001 3.747626e-002 -8.000000e-002
+         vertex 1.964574e-001 3.747626e-002 -1.800000e-001
+         vertex 1.809654e-001 8.515586e-002 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 9.372133e-001 3.487567e-001 0.000000e+000
+      outer loop
+         vertex 1.964574e-001 3.747626e-002 -8.000000e-002
+         vertex 1.809654e-001 8.515586e-002 -1.800000e-001
+         vertex 1.809654e-001 8.515586e-002 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 8.661239e-001 4.998294e-001 0.000000e+000
+      outer loop
+         vertex 1.809654e-001 8.515586e-002 -8.000000e-002
+         vertex 1.809654e-001 8.515586e-002 -1.800000e-001
+         vertex 1.541027e-001 1.274848e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 8.210368e-001 5.708753e-001 0.000000e+000
+      outer loop
+         vertex 1.809654e-001 8.515586e-002 -8.000000e-002
+         vertex 1.541027e-001 1.274848e-001 -1.800000e-001
+         vertex 1.541027e-001 1.274848e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 7.146106e-001 6.995225e-001 0.000000e+000
+      outer loop
+         vertex 1.541027e-001 1.274848e-001 -8.000000e-002
+         vertex 1.541027e-001 1.274848e-001 -1.800000e-001
+         vertex 1.175570e-001 1.618034e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 6.532714e-001 7.571238e-001 0.000000e+000
+      outer loop
+         vertex 1.541027e-001 1.274848e-001 -8.000000e-002
+         vertex 1.175570e-001 1.618034e-001 -1.800000e-001
+         vertex 1.175570e-001 1.618034e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 5.181955e-001 8.552622e-001 0.000000e+000
+      outer loop
+         vertex 1.175570e-001 1.618034e-001 -8.000000e-002
+         vertex 1.175570e-001 1.618034e-001 -1.800000e-001
+         vertex 7.362491e-002 1.859553e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 4.444587e-001 8.957993e-001 0.000000e+000
+      outer loop
+         vertex 1.175570e-001 1.618034e-001 -8.000000e-002
+         vertex 7.362491e-002 1.859553e-001 -1.800000e-001
+         vertex 7.362491e-002 1.859553e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 2.892204e-001 9.572625e-001 0.000000e+000
+      outer loop
+         vertex 7.362491e-002 1.859553e-001 -8.000000e-002
+         vertex 7.362491e-002 1.859553e-001 -1.800000e-001
+         vertex 2.506665e-002 1.984229e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 2.077190e-001 9.781886e-001 0.000000e+000
+      outer loop
+         vertex 7.362491e-002 1.859553e-001 -8.000000e-002
+         vertex 2.506665e-002 1.984229e-001 -1.800000e-001
+         vertex 2.506665e-002 1.984229e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 8.370229e-002 9.964908e-001 0.000000e+000
+      outer loop
+         vertex 2.506665e-002 1.984229e-001 -8.000000e-002
+         vertex 2.506665e-002 1.984229e-001 -1.800000e-001
+         vertex 7.347881e-017 2.000000e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 1.000000e+000 0.000000e+000
+      outer loop
+         vertex 2.506665e-002 1.984229e-001 -8.000000e-002
+         vertex 7.347881e-017 2.000000e-001 -1.800000e-001
+         vertex -2.506665e-002 1.984229e-001 -8.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.996053e-001 -1.255810e-002 -1.800000e-001
+         vertex -1.964574e-001 3.747626e-002 -1.800000e-001
+         vertex -1.902113e-001 -6.180340e-002 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.902113e-001 -6.180340e-002 -1.800000e-001
+         vertex -1.964574e-001 3.747626e-002 -1.800000e-001
+         vertex -1.809654e-001 8.515586e-002 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.902113e-001 -6.180340e-002 -1.800000e-001
+         vertex -1.809654e-001 8.515586e-002 -1.800000e-001
+         vertex -1.688656e-001 -1.071654e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.688656e-001 -1.071654e-001 -1.800000e-001
+         vertex -1.809654e-001 8.515586e-002 -1.800000e-001
+         vertex -1.541027e-001 1.274848e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.688656e-001 -1.071654e-001 -1.800000e-001
+         vertex -1.541027e-001 1.274848e-001 -1.800000e-001
+         vertex -1.369094e-001 -1.457937e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.369094e-001 -1.457937e-001 -1.800000e-001
+         vertex -1.541027e-001 1.274848e-001 -1.800000e-001
+         vertex -1.175570e-001 1.618034e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -1.369094e-001 -1.457937e-001 -1.800000e-001
+         vertex -1.175570e-001 1.618034e-001 -1.800000e-001
+         vertex -9.635074e-002 -1.752613e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -9.635074e-002 -1.752613e-001 -1.800000e-001
+         vertex -1.175570e-001 1.618034e-001 -1.800000e-001
+         vertex -7.362491e-002 1.859553e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -9.635074e-002 -1.752613e-001 -1.800000e-001
+         vertex -7.362491e-002 1.859553e-001 -1.800000e-001
+         vertex -4.973798e-002 -1.937166e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -4.973798e-002 -1.937166e-001 -1.800000e-001
+         vertex -7.362491e-002 1.859553e-001 -1.800000e-001
+         vertex -2.506665e-002 1.984229e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -4.973798e-002 -1.937166e-001 -1.800000e-001
+         vertex -2.506665e-002 1.984229e-001 -1.800000e-001
+         vertex 0.000000e+000 -2.000000e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex -2.506665e-002 1.984229e-001 -1.800000e-001
+         vertex 2.449294e-017 2.000000e-001 -1.800000e-001
+         vertex 0.000000e+000 -2.000000e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 0.000000e+000 -2.000000e-001 -1.800000e-001
+         vertex 2.449294e-017 2.000000e-001 -1.800000e-001
+         vertex 2.506665e-002 1.984229e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 0.000000e+000 -2.000000e-001 -1.800000e-001
+         vertex 2.506665e-002 1.984229e-001 -1.800000e-001
+         vertex 4.973798e-002 -1.937166e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 4.973798e-002 -1.937166e-001 -1.800000e-001
+         vertex 2.506665e-002 1.984229e-001 -1.800000e-001
+         vertex 7.362491e-002 1.859553e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 4.973798e-002 -1.937166e-001 -1.800000e-001
+         vertex 7.362491e-002 1.859553e-001 -1.800000e-001
+         vertex 9.635074e-002 -1.752613e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 9.635074e-002 -1.752613e-001 -1.800000e-001
+         vertex 7.362491e-002 1.859553e-001 -1.800000e-001
+         vertex 1.175570e-001 1.618034e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 9.635074e-002 -1.752613e-001 -1.800000e-001
+         vertex 1.175570e-001 1.618034e-001 -1.800000e-001
+         vertex 1.369094e-001 -1.457937e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.369094e-001 -1.457937e-001 -1.800000e-001
+         vertex 1.175570e-001 1.618034e-001 -1.800000e-001
+         vertex 1.541027e-001 1.274848e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.369094e-001 -1.457937e-001 -1.800000e-001
+         vertex 1.541027e-001 1.274848e-001 -1.800000e-001
+         vertex 1.688656e-001 -1.071654e-001 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.688656e-001 -1.071654e-001 -1.800000e-001
+         vertex 1.541027e-001 1.274848e-001 -1.800000e-001
+         vertex 1.809654e-001 8.515586e-002 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.688656e-001 -1.071654e-001 -1.800000e-001
+         vertex 1.809654e-001 8.515586e-002 -1.800000e-001
+         vertex 1.902113e-001 -6.180340e-002 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.902113e-001 -6.180340e-002 -1.800000e-001
+         vertex 1.809654e-001 8.515586e-002 -1.800000e-001
+         vertex 1.964574e-001 3.747626e-002 -1.800000e-001
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
+      outer loop
+         vertex 1.902113e-001 -6.180340e-002 -1.800000e-001
+         vertex 1.964574e-001 3.747626e-002 -1.800000e-001
+         vertex 1.996053e-001 -1.255810e-002 -1.800000e-001
+      endloop
+   endfacet
+   facet normal -1.000000e+000 0.000000e+000 0.000000e+000
+      outer loop
+         vertex 2.550000e-001 1.600000e-001 2.000000e-002
+         vertex 2.550000e-001 6.000000e-002 2.000000e-002
+         vertex 2.550000e-001 1.600000e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -1.000000e+000 0.000000e+000 0.000000e+000
+      outer loop
+         vertex 2.550000e-001 1.600000e-001 4.000000e-002
+         vertex 2.550000e-001 6.000000e-002 2.000000e-002
+         vertex 2.550000e-001 6.000000e-002 4.000000e-002
+      endloop
+   endfacet
+   facet normal 1.000000e+000 0.000000e+000 0.000000e+000
+      outer loop
+         vertex 2.450000e-001 6.000000e-002 2.000000e-002
+         vertex 2.450000e-001 1.600000e-001 2.000000e-002
+         vertex 2.450000e-001 6.000000e-002 4.000000e-002
+      endloop
+   endfacet
+   facet normal 1.000000e+000 0.000000e+000 0.000000e+000
+      outer loop
+         vertex 2.450000e-001 6.000000e-002 4.000000e-002
+         vertex 2.450000e-001 1.600000e-001 2.000000e-002
+         vertex 2.450000e-001 1.600000e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -2.775558e-015 -1.000000e+000 0.000000e+000
+      outer loop
+         vertex 2.450000e-001 1.600000e-001 2.000000e-002
+         vertex 2.550000e-001 1.600000e-001 2.000000e-002
+         vertex 2.450000e-001 1.600000e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal -2.775558e-015 -1.000000e+000 0.000000e+000
+      outer loop
+         vertex 2.450000e-001 1.600000e-001 4.000000e-002
+         vertex 2.550000e-001 1.600000e-001 2.000000e-002
+         vertex 2.550000e-001 1.600000e-001 4.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 2.450000e-001 1.600000e-001 2.000000e-002
+         vertex 2.450000e-001 6.000000e-002 2.000000e-002
+         vertex 2.550000e-001 1.600000e-001 2.000000e-002
+      endloop
+   endfacet
+   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
+      outer loop
+         vertex 2.550000e-001 1.600000e-001 2.000000e-002
+         vertex 2.450000e-001 6.000000e-002 2.000000e-002
+         vertex 2.550000e-001 6.000000e-002 2.000000e-002
+      endloop
+   endfacet
+endsolid

BIN
examples/obj/leeperrysmith/Infinite-Level_02_Disp_NoSmoothUV-4096.jpg


+ 468 - 472
examples/scenes/test_scene.js

@@ -1,524 +1,520 @@
 {
 
-"metadata":
-{
-	"formatVersion": 3,
-	"type"		   : "scene"
-},
-
-"urlBaseType" : "relativeToHTML",
-
-"objects":
-{
-	"cube1" : {
-		"geometry" : "cubeNormals",
-		"materials": [ "lambert_red" ],
-		"position" : [ 0, 0, 0 ],
-		"rotation" : [ 0, -0.3, 0 ],
-		"scale"	   : [ 1, 1, 1 ],
-		"visible"  : true
+	"metadata": {
+		"formatVersion": 3,
+		"type" : "scene"
 	},
 
-	"cube2" : {
-		"geometry" : "cubeWire",
-		"materials": [ "basic_white" ],
-		"position" : [ 0, 0, 0 ],
-		"rotation" : [ 0, -0.3, 0 ],
-		"scale"	   : [ 2, 2, 2 ],
-		"visible"  : true
-	},
-
-	"cube3" : {
-		"geometry" : "cube",
-		"materials": [ "minecraft" ],
-		"position" : [ -30, -5, 25 ],
-		"rotation" : [ 0, 0.8, 0 ],
-		"scale"	   : [ 1, 1, 1 ],
-		"visible"  : true
-	},
+	"urlBaseType" : "relativeToHTML",
 
-	"sphere_lambert" : {
-		"geometry" : "sphere",
-		"materials": [ "lambert_green" ],
-		"position" : [ -20, -5, 15 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 1, 1, 1 ],
-		"visible"  : true
-	},
-
-	"sphere_refraction" : {
-		"geometry" : "sphere",
-		"materials": [ "basic_refraction" ],
-		"position" : [ 50, 45, -50 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 1, 1, 1 ],
-		"visible"  : true
-	},
-
-	"icosahedron" : {
-		"geometry" : "icosahedron",
-		"materials": [ "faceted_white" ],
-		"position" : [ 20, 10, -60 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 1, 1, 1 ],
-		"visible"  : true
-	},
-
-
-	"torus" : {
-		"geometry" : "torus",
-		"materials": [ "phong_orange" ],
-		"position" : [ -20, 5, -50 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 2, 2, 2 ],
-		"visible"  : true
-	},
+	"objects": {
 
-	"cone" : {
-		"geometry" : "cone",
-		"materials": [ "lambert_blue" ],
-		"position" : [ -50, 15, -50 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 1, 1, 1 ],
-		"visible"  : true
-	},
-
-	"cylinder" : {
-		"geometry" : "cylinder",
-		"materials": [ "lambert_blue" ],
-		"position" : [ 50, 15, -50 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 1, 1, 1 ],
-		"visible"  : true
-	},
-
-	"colorcube1" : {
-		"geometry" : "colorcube",
-		"materials": [],
-		"position" : [ -10, -5, 30 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 5, 5, 5 ],
-		"visible"  : true,
-		"children" : {
-			"colorcube2" : {
-				"geometry" : "colorcube",
-				"materials": [],
-				"position" : [ 0, 2, 0 ],
-				"rotation" : [ 0.1, 0.1, 0.1 ],
-				"scale"    : [ 0.5, 0.5, 0.5 ],
-				"visible"  : true,
-				"children" : {
-					"colorcube3" : {
-						"geometry" : "colorcube",
-						"materials": [],
-						"position" : [ 0, 2, 0 ],
-						"rotation" : [ 0.1, 0.1, 0.1 ],
-						"scale"    : [ 0.5, 0.5, 0.5 ],
-						"visible"  : true,
-						"children" : {
-							"colorcube4" : {
-								"geometry" : "colorcube",
-								"materials": [],
-								"position" : [ 0, 2, 0 ],
-								"rotation" : [ 0.1, 0.1, 0.1 ],
-								"scale"    : [ 0.5, 0.5, 0.5 ],
-								"visible"  : true
+		"cube1" : {
+			"geometry" : "cubeNormals",
+			"materials": [ "lambert_red" ],
+			"position" : [ 0, 0, 0 ],
+			"rotation" : [ 0, -0.3, 0 ],
+			"scale"	   : [ 1, 1, 1 ],
+			"visible"  : true,
+			"properties" : {
+				"rotating" : true
+			}
+		},
+
+		"cube2" : {
+			"geometry" : "cubeWire",
+			"materials": [ "basic_white" ],
+			"position" : [ 0, 0, 0 ],
+			"rotation" : [ 0, -0.3, 0 ],
+			"scale"	   : [ 2, 2, 2 ],
+			"visible"  : true
+		},
+
+		"cube3" : {
+			"geometry" : "cube",
+			"materials": [ "minecraft" ],
+			"position" : [ -30, -5, 25 ],
+			"rotation" : [ 0, 0.8, 0 ],
+			"scale"	   : [ 1, 1, 1 ],
+			"visible"  : true
+		},
+
+		"sphere_lambert" : {
+			"geometry" : "sphere",
+			"materials": [ "lambert_green" ],
+			"position" : [ -20, -5, 15 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 1, 1, 1 ],
+			"visible"  : true
+		},
+
+		"sphere_refraction" : {
+			"geometry" : "sphere",
+			"materials": [ "basic_refraction" ],
+			"position" : [ 50, 45, -50 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 1, 1, 1 ],
+			"visible"  : true
+		},
+
+		"icosahedron" : {
+			"geometry" : "icosahedron",
+			"materials": [ "faceted_white" ],
+			"position" : [ 20, 10, -60 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 1, 1, 1 ],
+			"visible"  : true
+		},
+
+
+		"torus" : {
+			"geometry" : "torus",
+			"materials": [ "phong_orange" ],
+			"position" : [ -20, 5, -50 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 2, 2, 2 ],
+			"visible"  : true
+		},
+
+		"cone" : {
+			"geometry" : "cone",
+			"materials": [ "lambert_blue" ],
+			"position" : [ -50, 15, -50 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 1, 1, 1 ],
+			"visible"  : true
+		},
+
+		"cylinder" : {
+			"geometry" : "cylinder",
+			"materials": [ "lambert_blue" ],
+			"position" : [ 50, 15, -50 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 1, 1, 1 ],
+			"visible"  : true
+		},
+
+		"colorcube1" : {
+			"geometry" : "colorcube",
+			"materials": [],
+			"position" : [ -10, -5, 30 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 5, 5, 5 ],
+			"visible"  : true,
+			"children" : {
+				"colorcube2" : {
+					"geometry" : "colorcube",
+					"materials": [],
+					"position" : [ 0, 2, 0 ],
+					"rotation" : [ 0.1, 0.1, 0.1 ],
+					"scale"    : [ 0.5, 0.5, 0.5 ],
+					"visible"  : true,
+					"children" : {
+						"colorcube3" : {
+							"geometry" : "colorcube",
+							"materials": [],
+							"position" : [ 0, 2, 0 ],
+							"rotation" : [ 0.1, 0.1, 0.1 ],
+							"scale"    : [ 0.5, 0.5, 0.5 ],
+							"visible"  : true,
+							"children" : {
+								"colorcube4" : {
+									"geometry" : "colorcube",
+									"materials": [],
+									"position" : [ 0, 2, 0 ],
+									"rotation" : [ 0.1, 0.1, 0.1 ],
+									"scale"    : [ 0.5, 0.5, 0.5 ],
+									"visible"  : true
+								}
 							}
 						}
 					}
 				}
 			}
+		},
+
+		"veyron" : {
+			"geometry" : "veyron",
+			"materials": [ "face" ],
+			"position" : [ 40, -1, 0 ],
+			"rotation" : [ 0, 0.3, 0 ],
+			"scale"	   : [ 0.25, 0.25, 0.25 ],
+			"visible"  : true
+		},
+
+		"walt" : {
+			"geometry" : "WaltHead",
+			"materials": [ "lambert_cube" ],
+			"position" : [ -45, 10, 0 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 0.5, 0.5, 0.5 ],
+			"visible"  : true
+		},
+
+		"quad_bg" : {
+			"geometry" : "quad",
+			"materials": [ "textured_bg" ],
+			"position" : [ 0, 15, -90 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 20, 20, 20 ],
+			"visible"  : true
+		},
+
+		"ground" : {
+			"geometry" : "plane",
+			"materials": [ "basic_gray" ],
+			"position" : [ 0, -10, 0 ],
+			"rotation" : [ -1.57, 0, 0 ],
+			"scale"	   : [ 100, 100, 100 ],
+			"visible"  : true
 		}
-	},
-
-	"veyron" : {
-		"geometry" : "veyron",
-		"materials": [ "face" ],
-		"position" : [ 40, -1, 0 ],
-		"rotation" : [ 0, 0.3, 0 ],
-		"scale"	   : [ 0.25, 0.25, 0.25 ],
-		"visible"  : true
-	},
-
-	"walt" : {
-		"geometry" : "WaltHead",
-		"materials": [ "lambert_cube" ],
-		"position" : [ -45, 10, 0 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 0.5, 0.5, 0.5 ],
-		"visible"  : true
-	},
-
-	"quad_bg" : {
-		"geometry" : "quad",
-		"materials": [ "textured_bg" ],
-		"position" : [ 0, 15, -90 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 20, 20, 20 ],
-		"visible"  : true
-	},
-
-	"ground" : {
-		"geometry" : "plane",
-		"materials": [ "basic_gray" ],
-		"position" : [ 0, -10, 0 ],
-		"rotation" : [ -1.57, 0, 0 ],
-		"scale"	   : [ 100, 100, 100 ],
-		"visible"  : true
-	}
-
-},
-
-"geometries":
-{
-	"cube": {
-		"type"  : "cube",
-		"width" : 10,
-		"height": 10,
-		"depth" : 10,
-		"segmentsWidth"  : 1,
-		"segmentsHeight" : 1,
-		"segmentsDepth"  : 1,
-		"flipped" : false,
-		"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
-	},
-
-	"cubeNormals": {
-		"type"  : "cube",
-		"width" : 10,
-		"height": 10,
-		"depth" : 10,
-		"segmentsWidth"  : 1,
-		"segmentsHeight" : 1,
-		"segmentsDepth"  : 1,
-		"flipped" : false,
-		"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
-	},
-
-	"cubeWire": {
-		"type"  : "cube",
-		"width" : 10,
-		"height": 10,
-		"depth" : 10,
-		"segmentsWidth"  : 1,
-		"segmentsHeight" : 1,
-		"segmentsDepth"  : 1,
-		"flipped" : false,
-		"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
-	},
-
-	"plane": {
-		"type"   : "plane",
-		"width"  : 10,
-		"height" : 10,
-		"segmentsWidth"  : 50,
-		"segmentsHeight" : 50
-	},
-
-	"quad": {
-		"type"   : "plane",
-		"width"  : 10,
-		"height" : 10,
-		"segmentsWidth"  : 1,
-		"segmentsHeight" : 1
-	},
-
-	"sphere": {
-		"type"    : "sphere",
-		"radius"  : 5,
-		"segmentsWidth"  : 32,
-		"segmentsHeight" : 16
-	},
-
-	"icosahedron": {
-		"type"    : "icosahedron",
-		"radius"  : 20,
-		"subdivisions"  : 2
-	},
-
-	"torus": {
-		"type"    : "torus",
-		"radius"  : 5,
-		"tube"	  : 2,
-		"segmentsR" : 16,
-		"segmentsT" : 32
-	},
-
-	"cylinder": {
-		"type"    : "cylinder",
-		"topRad"   : 5,
-		"botRad"   : 5,
-		"height"   : 50,
-		"radSegs"  : 32,
-		"heightSegs": 1
-	},
-
-	"cone": {
-		"type"    : "cylinder",
-		"topRad"   : 0,
-		"botRad"   : 5,
-		"height"   : 50,
-		"radSegs"  : 32,
-		"heightSegs" : 1
-	},
-
-	"WaltHead": {
-		"type": "bin_mesh",
-		"url" : "obj/walt/WaltHead_bin.js"
-	},
-
-	"veyron": {
-		"type": "bin_mesh",
-		"url" : "obj/veyron/VeyronNoUv_bin.js"
-	},
-
-	"colorcube": {
-		"type": "embedded_mesh",
-		"id"  : "cube_fvc"
-	}
 
-},
-
-"embeds": {
-
-	"cube_fvc": {
-
-    "metadata" : { "formatVersion" : 3 },
-
-    "scale" : 1.0,
-
-    "materials": [	{
-	"DbgColor" : 15658734,
-	"DbgIndex" : 0,
-	"DbgName" : "Material",
-	"colorAmbient" : [0.0, 0.0, 0.0],
-	"colorDiffuse" : [0.8, 0.8, 0.8],
-	"colorSpecular" : [0.5, 0.5, 0.5],
-	"specularCoef" : 50,
-	"transparency" : 1.0,
-	"vertexColors" : true
-	}],
-
-    "vertices": [1.000000,-1.000000,-1.000000,1.000000,-1.000000,1.000000,-1.000000,-1.000000,1.000000,-1.000000,-1.000000,-1.000000,1.000000,1.000000,-1.000000,0.999999,1.000000,1.000001,-1.000000,1.000000,1.000000,-1.000000,1.000000,-1.000000],
-
-    "morphTargets": [],
-
-    "normals": [],
-
-    "colors": [16777215,16769421,16769424,8454135,15195931,7299839,16586715,16711687,1056014,6029475,13762484,9044089,7962349,6772991,16774622,4144383,11973887,1966063,1056285,9081232,13696943,5002581],
-
-    "uvs": [[]],
-
-    "faces": [131,0,1,2,3,0,0,1,2,3,131,4,7,6,5,0,4,5,6,7,131,0,4,5,1,0,0,8,9,10,131,1,5,6,2,0,0,11,12,13,131,2,6,7,3,0,14,15,16,17,131,4,0,3,7,0,18,19,20,21],
-
-    "edges" : []
-
-	}
-
-},
-
-"materials":
-{
-
-	"basic_gray": {
-		"type": "MeshBasicMaterial",
-		"parameters": { "color": 6710886, "wireframe": true }
 	},
 
-	"basic_white": {
-		"type": "MeshBasicMaterial",
-		"parameters": { "color": 16777215, "wireframe": true }
-	},
+	"geometries": {
+
+		"cube": {
+			"type"  : "cube",
+			"width" : 10,
+			"height": 10,
+			"depth" : 10,
+			"segmentsWidth"  : 1,
+			"segmentsHeight" : 1,
+			"segmentsDepth"  : 1,
+			"flipped" : false,
+			"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
+		},
+
+		"cubeNormals": {
+			"type"  : "cube",
+			"width" : 10,
+			"height": 10,
+			"depth" : 10,
+			"segmentsWidth"  : 1,
+			"segmentsHeight" : 1,
+			"segmentsDepth"  : 1,
+			"flipped" : false,
+			"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
+		},
+
+		"cubeWire": {
+			"type"  : "cube",
+			"width" : 10,
+			"height": 10,
+			"depth" : 10,
+			"segmentsWidth"  : 1,
+			"segmentsHeight" : 1,
+			"segmentsDepth"  : 1,
+			"flipped" : false,
+			"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
+		},
+
+		"plane": {
+			"type"   : "plane",
+			"width"  : 10,
+			"height" : 10,
+			"segmentsWidth"  : 50,
+			"segmentsHeight" : 50
+		},
+
+		"quad": {
+			"type"   : "plane",
+			"width"  : 10,
+			"height" : 10,
+			"segmentsWidth"  : 1,
+			"segmentsHeight" : 1
+		},
+
+		"sphere": {
+			"type"    : "sphere",
+			"radius"  : 5,
+			"segmentsWidth"  : 32,
+			"segmentsHeight" : 16
+		},
+
+		"icosahedron": {
+			"type"    : "icosahedron",
+			"radius"  : 20,
+			"subdivisions"  : 2
+		},
+
+		"torus": {
+			"type"    : "torus",
+			"radius"  : 5,
+			"tube"	  : 2,
+			"segmentsR" : 16,
+			"segmentsT" : 32
+		},
+
+		"cylinder": {
+			"type"    : "cylinder",
+			"topRad"   : 5,
+			"botRad"   : 5,
+			"height"   : 50,
+			"radSegs"  : 32,
+			"heightSegs": 1
+		},
+
+		"cone": {
+			"type"    : "cylinder",
+			"topRad"   : 0,
+			"botRad"   : 5,
+			"height"   : 50,
+			"radSegs"  : 32,
+			"heightSegs" : 1
+		},
+
+		"WaltHead": {
+			"type": "bin_mesh",
+			"url" : "obj/walt/WaltHead_bin.js"
+		},
+
+		"veyron": {
+			"type": "bin_mesh",
+			"url" : "obj/veyron/VeyronNoUv_bin.js"
+		},
+
+		"colorcube": {
+			"type": "embedded_mesh",
+			"id"  : "cube_fvc"
+		}
 
-	"faceted_white": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 16777215, "shading": "flat" }
 	},
 
-	"lambert_red": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 16711680 }
-	},
+	"embeds": {
 
-	"lambert_green": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 30481, "blending": "AdditiveBlending", "transparent": true }
-	},
+		"cube_fvc": {
 
-	"lambert_blue": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 21930 }
-	},
+			"metadata" : {
+				"formatVersion" : 3
+			},
 
-	"phong_orange": {
-		"type": "MeshPhongMaterial",
-		"parameters": { "color": 0, "specular": 11162880 }
-	},
+			"scale" : 1.0,
 
-	"basic_refraction": {
-		"type": "MeshBasicMaterial",
-		"parameters": { "color": 16777215, "envMap": "cube_refraction", "refractionRatio": 0.95 }
-	},
+			"materials": [{
+				"DbgColor" : 15658734,
+				"DbgIndex" : 0,
+				"DbgName" : "Material",
+				"colorAmbient" : [0.0, 0.0, 0.0],
+				"colorDiffuse" : [0.8, 0.8, 0.8],
+				"colorSpecular" : [0.5, 0.5, 0.5],
+				"specularCoef" : 50,
+				"transparency" : 1.0,
+				"vertexColors" : true
+			}],
 
-	"lambert_cube": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 16737792, "envMap": "cube_reflection", "combine": "MixOperation", "reflectivity": 0.3 }
-	},
+			"vertices": [1.000000,-1.000000,-1.000000,1.000000,-1.000000,1.000000,-1.000000,-1.000000,1.000000,-1.000000,-1.000000,-1.000000,1.000000,1.000000,-1.000000,0.999999,1.000000,1.000001,-1.000000,1.000000,1.000000,-1.000000,1.000000,-1.000000],
 
-	"chrome": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 16777215, "envMap": "cube_reflection" }
-	},
+			"morphTargets": [],
 
-	"darkerchrome": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 2236962, "envMap": "cube_reflection" }
-	},
+			"normals": [],
 
-	"glass": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 1052742, "envMap": "cube_reflection", "opacity": 0.25, "transparent": true }
-	},
+			"colors": [16777215,16769421,16769424,8454135,15195931,7299839,16586715,16711687,1056014,6029475,13762484,9044089,7962349,6772991,16774622,4144383,11973887,1966063,1056285,9081232,13696943,5002581],
 
-	"interior": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 328965 }
-	},
-
-	"backlights": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 16711680, "opacity": 0.5 }
-	},
+			"uvs": [[]],
 
-	"backsignals": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 16759552, "opacity": 0.5 }
-	},
+			"faces": [131,0,1,2,3,0,0,1,2,3,131,4,7,6,5,0,4,5,6,7,131,0,4,5,1,0,0,8,9,10,131,1,5,6,2,0,0,11,12,13,131,2,6,7,3,0,14,15,16,17,131,4,0,3,7,0,18,19,20,21]
 
-	"textured_bg": {
-		"type": "MeshBasicMaterial",
-		"parameters": { "color": 16777215, "map": "texture_bg" }
-	},
+		}
 
-	"minecraft": {
-		"type": "MeshBasicMaterial",
-		"parameters": { "color": 16777215, "map": "texture_minecraft" }
 	},
 
-	"face": {
-		"type": "MeshFaceMaterial",
-		"parameters": {}
-	}
-
-},
-
-"textures":
-{
+	"materials": {
+
+		"basic_gray": {
+			"type": "MeshBasicMaterial",
+			"parameters": { "color": 6710886, "wireframe": true }
+		},
+
+		"basic_white": {
+			"type": "MeshBasicMaterial",
+			"parameters": { "color": 16777215, "wireframe": true }
+		},
+
+		"faceted_white": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 16777215, "shading": "flat" }
+		},
+
+		"lambert_red": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 16711680 }
+		},
+
+		"lambert_green": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 30481, "blending": "AdditiveBlending", "transparent": true }
+		},
+
+		"lambert_blue": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 21930 }
+		},
+
+		"phong_orange": {
+			"type": "MeshPhongMaterial",
+			"parameters": { "color": 0, "specular": 11162880 }
+		},
+
+		"basic_refraction": {
+			"type": "MeshBasicMaterial",
+			"parameters": { "color": 16777215, "envMap": "cube_refraction", "refractionRatio": 0.95 }
+		},
+
+		"lambert_cube": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 16737792, "envMap": "cube_reflection", "combine": "MixOperation", "reflectivity": 0.3 }
+		},
+
+		"chrome": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 16777215, "envMap": "cube_reflection" }
+		},
+
+		"darkerchrome": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 2236962, "envMap": "cube_reflection" }
+		},
+
+		"glass": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 1052742, "envMap": "cube_reflection", "opacity": 0.25, "transparent": true }
+		},
+
+		"interior": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 328965 }
+		},
+
+		"backlights": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 16711680, "opacity": 0.5 }
+		},
+
+		"backsignals": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 16759552, "opacity": 0.5 }
+		},
+
+		"textured_bg": {
+			"type": "MeshBasicMaterial",
+			"parameters": { "color": 16777215, "map": "texture_bg" }
+		},
+
+		"minecraft": {
+			"type": "MeshBasicMaterial",
+			"parameters": { "color": 16777215, "map": "texture_minecraft" }
+		},
+
+		"face": {
+			"type": "MeshFaceMaterial",
+			"parameters": {}
+		}
 
-	"cube_reflection": {
-		"url": [ "textures/cube/SwedishRoyalCastle/px.jpg",
-				 "textures/cube/SwedishRoyalCastle/nx.jpg",
-				 "textures/cube/SwedishRoyalCastle/py.jpg",
-				 "textures/cube/SwedishRoyalCastle/ny.jpg",
-				 "textures/cube/SwedishRoyalCastle/pz.jpg",
-				 "textures/cube/SwedishRoyalCastle/nz.jpg"
-				]
 	},
 
-	"cube_refraction": {
-		"url": [ "textures/cube/SwedishRoyalCastle/px.jpg",
-				 "textures/cube/SwedishRoyalCastle/nx.jpg",
-				 "textures/cube/SwedishRoyalCastle/py.jpg",
-				 "textures/cube/SwedishRoyalCastle/ny.jpg",
-				 "textures/cube/SwedishRoyalCastle/nz.jpg",
-				 "textures/cube/SwedishRoyalCastle/pz.jpg"
-				],
-		"mapping": "CubeRefractionMapping"
-	},
+	"textures": {
+
+		"cube_reflection": {
+			"url": [ "textures/cube/SwedishRoyalCastle/px.jpg",
+					 "textures/cube/SwedishRoyalCastle/nx.jpg",
+					 "textures/cube/SwedishRoyalCastle/py.jpg",
+					 "textures/cube/SwedishRoyalCastle/ny.jpg",
+					 "textures/cube/SwedishRoyalCastle/pz.jpg",
+					 "textures/cube/SwedishRoyalCastle/nz.jpg"
+					]
+		},
+
+		"cube_refraction": {
+			"url": [ "textures/cube/SwedishRoyalCastle/px.jpg",
+					 "textures/cube/SwedishRoyalCastle/nx.jpg",
+					 "textures/cube/SwedishRoyalCastle/py.jpg",
+					 "textures/cube/SwedishRoyalCastle/ny.jpg",
+					 "textures/cube/SwedishRoyalCastle/nz.jpg",
+					 "textures/cube/SwedishRoyalCastle/pz.jpg"
+					],
+			"mapping": "CubeRefractionMapping"
+		},
+
+		"texture_bg": {
+			"url": "textures/cube/SwedishRoyalCastle/pz.jpg"
+		},
+
+		"texture_minecraft": {
+			"url": "textures/minecraft/grass.png",
+			"magFilter": "NearestFilter",
+			"minFilter": "LinearMipMapLinearFilter"
+		}
 
-	"texture_bg": {
-		"url": "textures/cube/SwedishRoyalCastle/pz.jpg"
 	},
 
-	"texture_minecraft": {
-		"url": "textures/minecraft/grass.png",
-		"magFilter": "NearestFilter",
-		"minFilter": "LinearMipMapLinearFilter"
-	}
-
-},
+	"cameras": {
+		"cam1": {
+			"type"  : "perspective",
+			"fov"   : 50,
+			"aspect": 1.33333,
+			"near"  : 1,
+			"far"   : 1000,
+			"position": [0,0,100],
+			"target"  : [0,0,0]
+		},
+
+		"cam2": {
+			"type"  : "ortho",
+			"left"  : 0,
+			"right" : 1024,
+			"top"   : 0,
+			"bottom": 1024,
+			"near"  : 1,
+			"far"   : 1000,
+			"position": [0,0,0],
+			"target"  : [0,0,0]
+		}
 
-"cameras":
-{
-	"cam1": {
-		"type"  : "perspective",
-		"fov"   : 50,
-		"aspect": 1.33333,
-		"near"  : 1,
-		"far"   : 1000,
-		"position": [0,0,100],
-		"target"  : [0,0,0]
 	},
 
-	"cam2": {
-		"type"  : "ortho",
-		"left"  : 0,
-		"right" : 1024,
-		"top"   : 0,
-		"bottom": 1024,
-		"near"  : 1,
-		"far"   : 1000,
-		"position": [0,0,0],
-		"target"  : [0,0,0]
-	}
+	"lights": {
+		"light1": {
+			"type"		 : "directional",
+			"direction"	 : [0,1,1],
+			"color" 	 : 16777215,
+			"intensity"	 : 0.8
+		},
 
-},
+		"light2": {
+			"type"	  : "point",
+			"position": [0,0,0],
+			"color"   : 16777215
+		}
 
-"lights":
-{
-	"light1": {
-		"type"		 : "directional",
-		"direction"	 : [0,1,1],
-		"color" 	 : 16777215,
-		"intensity"	 : 0.8
 	},
 
-	"light2": {
-		"type"	  : "point",
-		"position": [0,0,0],
-		"color"   : 16777215
-	}
-
-},
+	"fogs":	{
+		"basic": {
+			"type": "linear",
+			"color": [1,0,0],
+			"near": 1,
+			"far": 1000
+		},
 
-"fogs":
-{
-	"basic": {
-		"type" : "linear",
-		"color": [1,0,0],
-		"near" : 1,
-		"far"  : 1000
-	},
+		"exponential": {
+			"type": "exp2",
+			"color": [1,1,1],
+			"density": 0.005
+		},
 
-	"exponential": {
-		"type"    : "exp2",
-		"color"   : [1,1,1],
-		"density" : 0.005
+		"black": {
+			"type": "exp2",
+			"color": [0,0,0],
+			"density": 0.005
+		}
 	},
 
-	"black": {
-		"type"    : "exp2",
-		"color"   : [0,0,0],
-		"density" : 0.005
+	"defaults": {
+		"bgcolor": [0,0,0],
+		"bgalpha": 1,
+		"camera": "cam1",
+		"fog": "black"
 	}
-},
-
-"defaults" :
-{
-	"bgcolor" : [0,0,0],
-	"bgalpha" : 1,
-	"camera"  : "cam1",
-	"fog"	  : "black"
-}
 
 }

+ 1 - 1
examples/webgl_animation_cloth.html

@@ -37,7 +37,7 @@
 			<a onclick="togglePins();">Pins</a>
 		</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/webgl_animation_skinning.html

@@ -39,7 +39,7 @@
 		click to start animation
 		</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 330 - 0
examples/webgl_animation_skinning_morph.html

@@ -0,0 +1,330 @@
+<!doctype html>
+<html lang="en">
+	<head>
+		<title>three.js webgl - skinning + morphing [knight]</title>
+		<meta charset="utf-8">
+		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
+		<style>
+			body {
+				color: #000;
+				font-family:Monospace;
+				font-size:13px;
+				text-align:center;
+
+				background-color: #fff;
+				margin: 0px;
+				overflow: hidden;
+			}
+
+			#info {
+				position: absolute;
+				top: 0px; width: 100%;
+				padding: 5px;
+			}
+
+			a {
+				color: #0af;
+			}
+		</style>
+	</head>
+
+	<body>
+
+		<div id="container"></div>
+
+		<div id="info">
+		<a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> webgl - skinning + morphing
+		- knight by <a href="http://vimeo.com/36113323">apendua</a>
+		</div>
+
+		<script src="../build/three.min.js"></script>
+
+		<script src="js/Detector.js"></script>
+		<script src="js/Stats.js"></script>
+
+		<script>
+
+			var SCREEN_WIDTH = window.innerWidth;
+			var SCREEN_HEIGHT = window.innerHeight;
+			var FLOOR = -250;
+
+			var container,stats;
+
+			var camera, scene;
+			var renderer;
+
+			var mesh;
+
+			var mouseX = 0, mouseY = 0;
+
+			var windowHalfX = window.innerWidth / 2;
+			var windowHalfY = window.innerHeight / 2;
+
+			var clock = new THREE.Clock();
+
+			document.addEventListener( 'mousemove', onDocumentMouseMove, false );
+
+			init();
+			animate();
+
+			function init() {
+
+				container = document.getElementById( 'container' );
+
+				camera = new THREE.PerspectiveCamera( 30, SCREEN_WIDTH / SCREEN_HEIGHT, 1, 10000 );
+				camera.position.z = 2200;
+
+				scene = new THREE.Scene();
+
+				scene.fog = new THREE.Fog( 0xffffff, 2000, 10000 );
+				scene.fog.color.setHSV( 0.6, 0, 1 );
+
+				scene.add( camera );
+
+				// GROUND
+
+				/*
+				var groundTexture = THREE.ImageUtils.loadTexture( "textures/terrain/grasslight-big.jpg" );
+				groundTexture.wrapS = groundTexture.wrapT = THREE.RepeatWrapping;
+				groundTexture.repeat.set( 16, 16 );
+				groundTexture.anisotropy = 4;
+				*/
+
+				var groundMaterial = new THREE.MeshPhongMaterial( { /*map: groundTexture,*/ emissive: 0xbbbbbb, perPixel: true } );
+				var planeGeometry = new THREE.PlaneGeometry( 16000, 16000 );
+
+				var ground = new THREE.Mesh( planeGeometry, groundMaterial );
+				ground.position.set( 0, FLOOR, 0 );
+				ground.rotation.x = -Math.PI/2;
+				scene.add( ground );
+
+				ground.receiveShadow = true;
+
+
+				// LIGHTS
+
+				var ambient = new THREE.AmbientLight( 0x222222 );
+				scene.add( ambient );
+
+
+				var light = new THREE.DirectionalLight( 0xffffff, 1.6 );
+				light.position.set( 0, 140, 500 );
+				light.position.multiplyScalar( 1.1 );
+				light.color.setHSV( 0.6, 0.075, 1 );
+				scene.add( light );
+
+				light.castShadow = true;
+
+				light.shadowMapWidth = 2048;
+				light.shadowMapHeight = 2048;
+
+				var d = 390;
+
+				light.shadowCameraLeft = -d * 2;
+				light.shadowCameraRight = d * 2;
+				light.shadowCameraTop = d * 1.5;
+				light.shadowCameraBottom = -d;
+
+				light.shadowCameraFar = 3500;
+				//light.shadowCameraVisible = true;
+
+				//
+
+				var light = new THREE.DirectionalLight( 0xffffff, 1 );
+				light.position.set( 0, -1, 0 );
+				light.color.setHSV( 0.25, 0.85, 0.5 );
+				scene.add( light );
+
+				// RENDERER
+
+				renderer = new THREE.WebGLRenderer( { antialias: true } );
+				renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );
+				renderer.domElement.style.position = "relative";
+
+				renderer.setClearColor( scene.fog.color, 1 );
+
+				container.appendChild( renderer.domElement );
+
+				renderer.gammaInput = true;
+				renderer.gammaOutput = true;
+				renderer.physicallyBasedShading = true;
+
+				renderer.shadowMapEnabled = true;
+
+
+				// STATS
+
+				stats = new Stats();
+				stats.domElement.style.position = 'absolute';
+				stats.domElement.style.top = '0px';
+				stats.domElement.style.zIndex = 100;
+				container.appendChild( stats.domElement );
+
+				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#777";
+				stats.domElement.children[ 0 ].style.background = "transparent";
+				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
+
+				//
+
+				var loader = new THREE.JSONLoader();
+				loader.load( "models/skinned/knight.js", function( geometry ) { createScene( geometry,  0, FLOOR, -300, 60 ) } );
+
+				//
+
+				window.addEventListener( 'resize', onWindowResize, false );
+
+			}
+
+			function onWindowResize() {
+
+				windowHalfX = window.innerWidth / 2;
+				windowHalfY = window.innerHeight / 2;
+
+				camera.aspect = window.innerWidth / window.innerHeight;
+				camera.updateProjectionMatrix();
+
+				renderer.setSize( window.innerWidth, window.innerHeight );
+
+			}
+
+			function ensureLoop( animation ) {
+
+				for ( var i = 0; i < animation.hierarchy.length; i ++ ) {
+
+					var bone = animation.hierarchy[ i ];
+
+					var first = bone.keys[ 0 ];
+					var last = bone.keys[ bone.keys.length - 1 ];
+
+					last.pos = first.pos;
+					last.rot = first.rot;
+					last.scl = first.scl;
+
+				}
+
+			}
+
+			function createScene( geometry, x, y, z, s ) {
+
+				ensureLoop( geometry.animation );
+
+				geometry.computeBoundingBox();
+				var bb = geometry.boundingBox;
+
+				THREE.AnimationHandler.add( geometry.animation );
+
+				var path = "textures/cube/Park2/";
+				var format = '.jpg';
+				var urls = [
+						path + 'posx' + format, path + 'negx' + format,
+						path + 'posy' + format, path + 'negy' + format,
+						path + 'posz' + format, path + 'negz' + format
+					];
+
+
+				//var envMap = THREE.ImageUtils.loadTextureCube( urls );
+
+				//var map = THREE.ImageUtils.loadTexture( "textures/ash_uvgrid01.jpg" );
+
+				//var bumpMap = THREE.ImageUtils.generateDataTexture( 1, 1, new THREE.Color() );
+				//var bumpMap = THREE.ImageUtils.loadTexture( "textures/water.jpg" );
+
+				for ( var i = 0; i < geometry.materials.length; i ++ ) {
+
+					var m = geometry.materials[ i ];
+					m.skinning = true;
+					m.morphTargets = true;
+
+					m.specular.setHSV( 0, 0, 0.1 );
+
+					m.color.setHSV( 0.6, 0, 0.6 );
+					m.ambient.copy( m.color );
+
+					//m.map = map;
+					//m.envMap = envMap;
+					//m.bumpMap = bumpMap;
+					//m.bumpScale = 2;
+
+					//m.combine = THREE.MixOperation;
+					//m.reflectivity = 0.75;
+
+					m.wrapAround = true;
+					m.perPixel = true;
+
+				}
+
+				mesh = new THREE.SkinnedMesh( geometry, new THREE.MeshFaceMaterial() );
+				mesh.position.set( x, y - bb.min.y * s, z );
+				mesh.scale.set( s, s, s );
+				scene.add( mesh );
+
+				mesh.castShadow = true;
+				mesh.receiveShadow = true;
+
+				animation = new THREE.Animation( mesh, geometry.animation.name );
+				animation.JITCompile = false;
+				animation.interpolationType = THREE.AnimationHandler.LINEAR;
+
+				animation.play();
+
+			}
+
+			function onDocumentMouseMove( event ) {
+
+				mouseX = ( event.clientX - windowHalfX );
+				mouseY = ( event.clientY - windowHalfY );
+
+			}
+
+			//
+
+			function animate() {
+
+				requestAnimationFrame( animate );
+
+				render();
+				stats.update();
+
+			}
+
+			function render() {
+
+				var delta = 0.75 * clock.getDelta();
+
+				camera.position.x += ( mouseX - camera.position.x ) * .05;
+				camera.position.y = THREE.Math.clamp( camera.position.y + ( - mouseY - camera.position.y ) * .05, 0, 1000 );
+
+				camera.lookAt( scene.position );
+
+				// update skinning
+
+				THREE.AnimationHandler.update( delta );
+
+				// update morphs
+
+				if ( mesh ) {
+
+					var time = Date.now() * 0.001;
+
+					// mouth
+
+					mesh.morphTargetInfluences[ 1 ] = ( 1 + Math.sin( 4 * time ) ) / 2;
+
+					// frown ?
+
+					mesh.morphTargetInfluences[ 2 ] = ( 1 + Math.sin( 2 * time ) ) / 2;
+
+					// eyes
+
+					mesh.morphTargetInfluences[ 3 ] = ( 1 + Math.cos( 4 * time ) ) / 2;
+
+				}
+
+				renderer.render( scene, camera );
+
+			}
+
+		</script>
+
+	</body>
+</html>

+ 313 - 0
examples/webgl_buffergeometry.html

@@ -0,0 +1,313 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<title>three.js webgl - buffergeometry</title>
+		<meta charset="utf-8">
+		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
+		<style>
+			body {
+				color: #cccccc;
+				font-family:Monospace;
+				font-size:13px;
+				text-align:center;
+
+				background-color: #050505;
+				margin: 0px;
+				overflow: hidden;
+			}
+
+			#info {
+				position: absolute;
+				top: 0px; width: 100%;
+				padding: 5px;
+			}
+
+			a {
+
+				color: #0080ff;
+			}
+
+		</style>
+	</head>
+	<body>
+
+		<div id="container"></div>
+		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> webgl - buffergeometry</div>
+
+		<script src="../build/three.js"></script>
+
+		<script src="js/Detector.js"></script>
+		<script src="js/Stats.js"></script>
+
+		<script>
+
+			if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
+
+			var container, stats;
+
+			var camera, scene, renderer;
+
+			var mesh;
+
+			init();
+			animate();
+
+			function init() {
+
+				container = document.getElementById( 'container' );
+
+				//
+
+				camera = new THREE.PerspectiveCamera( 27, window.innerWidth / window.innerHeight, 1, 3500 );
+				camera.position.z = 2750;
+
+				scene = new THREE.Scene();
+				scene.fog = new THREE.Fog( 0x050505, 2000, 3500 );
+
+				//
+
+				scene.add( new THREE.AmbientLight( 0x444444 ) );
+
+				var light1 = new THREE.DirectionalLight( 0xffffff, 0.5 );
+				light1.position.set( 1, 1, 1 );
+				scene.add( light1 );
+
+				var light2 = new THREE.DirectionalLight( 0xffffff, 1.5 );
+				light2.position.set( 0, -1, 0 );
+				scene.add( light2 );
+
+				//
+
+				var triangles = 250000;
+
+				var geometry = new THREE.BufferGeometry();
+				geometry.attributes = {
+					index: {
+						itemSize: 1,
+						array: new Int16Array( triangles * 3 ),
+						numItems: triangles * 3
+					},
+					position: {
+						itemSize: 3,
+						array: new Float32Array( triangles * 3 * 3 ),
+						numItems: triangles * 3 * 3
+					},
+					normal: {
+						itemSize: 3,
+						array: new Float32Array( triangles * 3 * 3 ),
+						numItems: triangles * 3 * 3
+					},
+					color: {
+						itemSize: 3,
+						array: new Float32Array( triangles * 3 * 3 ),
+						numItems: triangles * 3 * 3
+					}
+				}
+
+				// break geometry into
+				// chunks of 20,000 triangles (3 unique vertices per triangle)
+				// for indices to fit into 16 bit integer number
+
+				var chunkSize = 20000;
+
+				var indices = geometry.attributes.index.array;
+
+				for ( var i = 0; i < indices.length; i ++ ) {
+
+					indices[ i ] = i % ( 3 * chunkSize );
+
+				}
+
+				var positions = geometry.attributes.position.array;
+				var normals = geometry.attributes.normal.array;
+				var colors = geometry.attributes.color.array;
+
+				var color = new THREE.Color();
+
+				var n = 800, n2 = n/2;	// triangles spread in the cube
+				var d = 12, d2 = d/2;	// individual triangle size
+
+				var pA = new THREE.Vector3();
+				var pB = new THREE.Vector3();
+				var pC = new THREE.Vector3();
+
+				var cb = new THREE.Vector3();
+				var ab = new THREE.Vector3();
+
+				for ( var i = 0; i < positions.length; i += 9 ) {
+
+					// positions
+
+					var x = Math.random() * n - n2;
+					var y = Math.random() * n - n2;
+					var z = Math.random() * n - n2;
+
+					var ax = x + Math.random() * d - d2;
+					var ay = y + Math.random() * d - d2;
+					var az = z + Math.random() * d - d2;
+
+					var bx = x + Math.random() * d - d2;
+					var by = y + Math.random() * d - d2;
+					var bz = z + Math.random() * d - d2;
+
+					var cx = x + Math.random() * d - d2;
+					var cy = y + Math.random() * d - d2;
+					var cz = z + Math.random() * d - d2;
+
+					positions[ i ]     = ax;
+					positions[ i + 1 ] = ay;
+					positions[ i + 2 ] = az;
+
+					positions[ i + 3 ] = bx;
+					positions[ i + 4 ] = by;
+					positions[ i + 5 ] = bz;
+
+					positions[ i + 6 ] = cx;
+					positions[ i + 7 ] = cy;
+					positions[ i + 8 ] = cz;
+
+					// flat face normals
+
+					pA.set( ax, ay, az );
+					pB.set( bx, by, bz );
+					pC.set( cx, cy, cz );
+
+					cb.sub( pC, pB );
+					ab.sub( pA, pB );
+					cb.crossSelf( ab );
+
+					cb.normalize();
+
+					var nx = cb.x;
+					var ny = cb.y;
+					var nz = cb.z;
+
+					normals[ i ]     = nx;
+					normals[ i + 1 ] = ny;
+					normals[ i + 2 ] = nz;
+
+					normals[ i + 3 ] = nx;
+					normals[ i + 4 ] = ny;
+					normals[ i + 5 ] = nz;
+
+					normals[ i + 6 ] = nx;
+					normals[ i + 7 ] = ny;
+					normals[ i + 8 ] = nz;
+
+					// colors
+
+					var vx = ( x / n ) + 0.5;
+					var vy = ( y / n ) + 0.5;
+					var vz = ( z / n ) + 0.5;
+
+					//color.setHSV( 0.5 + 0.5 * vx, 0.25 + 0.75 * vy, 0.25 + 0.75 * vz );
+					color.setRGB( vx, vy, vz );
+
+					colors[ i ]     = color.r;
+					colors[ i + 1 ] = color.g;
+					colors[ i + 2 ] = color.b;
+
+					colors[ i + 3 ] = color.r;
+					colors[ i + 4 ] = color.g;
+					colors[ i + 5 ] = color.b;
+
+					colors[ i + 6 ] = color.r;
+					colors[ i + 7 ] = color.g;
+					colors[ i + 8 ] = color.b;
+
+				}
+
+				geometry.offsets = [];
+
+				var start = 0;
+				var index = 0;
+				var left = triangles * 3;
+
+				for ( ;; ) {
+
+					var count = Math.min( chunkSize * 3, left );
+
+					var chunk = { start: start, count: count, index: index };
+
+					geometry.offsets.push( chunk );
+
+					start += count;
+					index += chunkSize * 3;
+
+					left -= count;
+
+					if ( left <= 0 ) break;
+
+				}
+
+				geometry.computeBoundingSphere();
+
+				var material = new THREE.MeshPhongMaterial( { color: 0xaaaaaa, ambient: 0xaaaaaa, specular: 0xffffff, shininess: 250,
+															  side: THREE.DoubleSide, perPixel: true, vertexColors: THREE.VertexColors } );
+
+				mesh = new THREE.Mesh( geometry, material );
+				scene.add( mesh );
+
+				//
+
+				renderer = new THREE.WebGLRenderer( { antialias: false, clearColor: 0x333333, clearAlpha: 1, alpha: false } );
+				renderer.setSize( window.innerWidth, window.innerHeight );
+				renderer.setClearColor( scene.fog.color, 1 );
+
+				renderer.gammaInput = true;
+				renderer.gammaOutput = true;
+				renderer.physicallyBasedShading = true;
+
+				container.appendChild( renderer.domElement );
+
+				//
+
+				stats = new Stats();
+				stats.domElement.style.position = 'absolute';
+				stats.domElement.style.top = '0px';
+				container.appendChild( stats.domElement );
+
+				//
+
+				window.addEventListener( 'resize', onWindowResize, false );
+
+			}
+
+			function onWindowResize() {
+
+				windowHalfX = window.innerWidth / 2;
+				windowHalfY = window.innerHeight / 2;
+
+				camera.aspect = window.innerWidth / window.innerHeight;
+				camera.updateProjectionMatrix();
+
+				renderer.setSize( window.innerWidth, window.innerHeight );
+
+			}
+
+			//
+
+			function animate() {
+
+				requestAnimationFrame( animate );
+
+				render();
+				stats.update();
+
+			}
+
+			function render() {
+
+				var time = Date.now() * 0.001;
+
+				mesh.rotation.x = time * 0.25;
+				mesh.rotation.y = time * 0.5;
+
+				renderer.render( scene, camera );
+
+			}
+
+		</script>
+
+	</body>
+</html>

+ 22 - 12
examples/webgl_camera.html

@@ -39,7 +39,7 @@
 		<b>O</b> orthographic <b>P</b> perspective
 		</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 		<script src="js/Stats.js"></script>
 
 		<script>
@@ -67,19 +67,18 @@
 
 				camera = new THREE.PerspectiveCamera( 50, 0.5 * SCREEN_WIDTH / SCREEN_HEIGHT, 1, 10000 );
 				camera.position.z = 2500;
-				scene.add( camera );
 
 				cameraPerspective = new THREE.PerspectiveCamera( 50, 0.5 * SCREEN_WIDTH / SCREEN_HEIGHT, 150, 1000 );
 
 				cameraPerspectiveHelper = new THREE.CameraHelper( cameraPerspective );
-				cameraPerspective.add( cameraPerspectiveHelper );
+				scene.add( cameraPerspectiveHelper );
 
 				//
 
 				cameraOrtho = new THREE.OrthographicCamera( 0.5 * SCREEN_WIDTH / - 2, 0.5 * SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, SCREEN_HEIGHT / - 2, 150, 1000 );
 
 				cameraOrthoHelper = new THREE.CameraHelper( cameraOrtho );
-				cameraOrtho.add( cameraOrthoHelper );
+				scene.add( cameraOrthoHelper );
 
 				//
 
@@ -166,8 +165,19 @@
 
 				switch( event.keyCode ) {
 
-					case 79: /*O*/	activeCamera = cameraOrtho; activeHelper = cameraOrthoHelper; break;
-					case 80: /*P*/ 	activeCamera = cameraPerspective; activeHelper = cameraPerspectiveHelper; break;
+					case 79: /*O*/
+
+						activeCamera = cameraOrtho;
+						activeHelper = cameraOrthoHelper;
+
+						break;
+
+					case 80: /*P*/
+
+						activeCamera = cameraPerspective;
+						activeHelper = cameraPerspectiveHelper;
+
+						break;
 
 				}
 
@@ -226,9 +236,9 @@
 					cameraPerspective.updateProjectionMatrix();
 
 					cameraPerspectiveHelper.update();
-					cameraPerspectiveHelper.lines.visible = true;
+					cameraPerspectiveHelper.visible = true;
 
-					cameraOrthoHelper.lines.visible = false;
+					cameraOrthoHelper.visible = false;
 
 				} else {
 
@@ -236,9 +246,9 @@
 					cameraOrtho.updateProjectionMatrix();
 
 					cameraOrthoHelper.update();
-					cameraOrthoHelper.lines.visible = true;
+					cameraOrthoHelper.visible = true;
 
-					cameraPerspectiveHelper.lines.visible = false;
+					cameraPerspectiveHelper.visible = false;
 
 				}
 
@@ -246,12 +256,12 @@
 
 				renderer.clear();
 
-				activeHelper.lines.visible = false;
+				activeHelper.visible = false;
 
 				renderer.setViewport( 0, 0, SCREEN_WIDTH/2, SCREEN_HEIGHT );
 				renderer.render( scene, activeCamera );
 
-				activeHelper.lines.visible = true;
+				activeHelper.visible = true;
 
 				renderer.setViewport( SCREEN_WIDTH/2, 0, SCREEN_WIDTH/2, SCREEN_HEIGHT );
 				renderer.render( scene, camera );

+ 1 - 1
examples/webgl_custom_attributes.html

@@ -31,7 +31,7 @@
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - custom attributes example</div>
 		<div id="container"></div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/webgl_custom_attributes_lines.html

@@ -34,7 +34,7 @@
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="fonts/helvetiker_bold.typeface.js"></script>
 

+ 1 - 1
examples/webgl_custom_attributes_particles.html

@@ -34,7 +34,7 @@
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - custom attributes example - particles</div>
 		<div id="container"></div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/webgl_custom_attributes_particles2.html

@@ -31,7 +31,7 @@
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - custom attributes example - particles - billboards</div>
 		<div id="container"></div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/webgl_custom_attributes_particles3.html

@@ -31,7 +31,7 @@
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - custom attributes example - particles - billboards - alphatest</div>
 		<div id="container"></div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/webgl_geometries.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/webgl_geometries2.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 2 - 2
examples/webgl_geometry_colors.html

@@ -32,9 +32,9 @@
 	<body>
 
 		<div id="container"></div>
-		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - vertex colors - webgl</div>
+		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> webgl - vertex colors</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/webgl_geometry_colors_blender.html

@@ -34,7 +34,7 @@
 		<div id="container"></div>
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> webgl - io blender - vertex colors</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/webgl_geometry_convex.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>
 

+ 1 - 1
examples/webgl_geometry_cube.html

@@ -13,7 +13,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script>
 

+ 1 - 1
examples/webgl_geometry_dynamic.html

@@ -40,7 +40,7 @@
 		<div id="container"></div>
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - dynamic geometry demo - webgl<br />(left click: forward, right click: backward)</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/webgl_geometry_extrude_shapes.html

@@ -18,7 +18,7 @@
 	<body>
 		<canvas id="debug" style="position:absolute; left:100px"></canvas>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 		<script src="../src/extras/core/Curve.js"></script>
 		<script src="../src/extras/geometries/TubeGeometry.js"></script>
 		<script src="../src/extras/geometries/ExtrudeGeometry.js"></script>

+ 15 - 16
examples/webgl_geometry_extrude_splines.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 		<script src="../src/extras/core/Curve.js"></script>
 		<script src="../src/extras/geometries/TubeGeometry.js"></script>
 		<script src="../src/extras/helpers/CameraHelper.js"></script>
@@ -165,7 +165,7 @@
 
 			showCameraHelper = document.getElementById('cameraHelper').checked;
 
-			cameraHelper.children[0].visible = showCameraHelper;
+			cameraHelper.visible = showCameraHelper;
 			cameraEye.visible = showCameraHelper;
 		}
 
@@ -217,23 +217,22 @@
 			addTube();
 
 			// Debug point
-			cameraEye = new THREE.Mesh(new THREE.SphereGeometry(5), new THREE.MeshBasicMaterial({
-					color: 0xdddddd
-			}));
+			cameraEye = new THREE.Mesh(
+				new THREE.SphereGeometry( 5 ),
+				new THREE.MeshBasicMaterial( { color: 0xdddddd } )
+			);
 
-			cameraHelper.children[0].visible = showCameraHelper;
+			cameraHelper.visible = showCameraHelper;
 			cameraEye.visible = showCameraHelper;
 
 			parent.add(cameraEye);
 
-			cameraHelper.scale.multiplyScalar(0.1);
+			cameraHelper.scale.multiplyScalar( 0.1 );
 			splineCamera.add(cameraHelper);
 			parent.add(splineCamera);
 
 			//
-			renderer = new THREE.WebGLRenderer({
-					antialias: true
-			});
+			renderer = new THREE.WebGLRenderer({ antialias: true } );
 			renderer.setSize(window.innerWidth, window.innerHeight);
 
 			container.appendChild(renderer.domElement);
@@ -308,10 +307,10 @@
 
 			if (event.touches.length == 1) {
 
-					event.preventDefault();
+				event.preventDefault();
 
-					mouseXOnMouseDown = event.touches[0].pageX - windowHalfX;
-					targetRotationOnMouseDown = targetRotation;
+				mouseXOnMouseDown = event.touches[0].pageX - windowHalfX;
+				targetRotationOnMouseDown = targetRotation;
 
 			}
 
@@ -321,10 +320,10 @@
 
 			if (event.touches.length == 1) {
 
-					event.preventDefault();
+				event.preventDefault();
 
-					mouseX = event.touches[0].pageX - windowHalfX;
-					targetRotation = targetRotationOnMouseDown + (mouseX - mouseXOnMouseDown) * 0.05;
+				mouseX = event.touches[0].pageX - windowHalfX;
+				targetRotation = targetRotationOnMouseDown + (mouseX - mouseXOnMouseDown) * 0.05;
 
 			}
 

+ 1 - 1
examples/webgl_geometry_extrude_uvs2.html

@@ -3,7 +3,7 @@
 	<head>
 		<title>three.js webgl - UV mapped ExtrudeGeometry</title>
 		
-		<script type="text/javascript" src="../build/Three.js"></script>
+		<script type="text/javascript" src="../build/three.min.js"></script>
 		<script type="text/javascript" src="js/UVsUtils.js"></script>
 
 		<script type="text/javascript">

+ 1 - 1
examples/webgl_geometry_hierarchy.html

@@ -16,7 +16,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 		<script src="js/Stats.js"></script>
 
 		<script>

+ 1 - 1
examples/webgl_geometry_hierarchy2.html

@@ -16,7 +16,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 		<script src="js/Stats.js"></script>
 
 		<script>

+ 1 - 1
examples/webgl_geometry_large_mesh.html

@@ -45,7 +45,7 @@
 
 		<pre id="log"></pre>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 		<script src="js/Stats.js"></script>
 
 		<script>

+ 1 - 1
examples/webgl_geometry_minecraft.html

@@ -41,7 +41,7 @@
 		<div id="container"><br /><br /><br /><br /><br />Generating world...</div>
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - <a href="http://www.minecraft.net/" target="_blank">minecraft</a> demo. featuring <a href="http://painterlypack.net/" target="_blank">painterly pack</a><br />(left click: forward, right click: backward)</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/ImprovedNoise.js"></script>
 		<script src="js/Detector.js"></script>

+ 1 - 1
examples/webgl_geometry_minecraft_ao.html

@@ -48,7 +48,7 @@
 			<button id="baot">texture + ao</button>
 		</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/ImprovedNoise.js"></script>
 

+ 1 - 1
examples/webgl_geometry_shapes.html

@@ -16,7 +16,7 @@
 	<body>
 		<canvas id="debug" style="position:absolute; left:100px"></canvas>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 1 - 1
examples/webgl_geometry_subdivison.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 1 - 1
examples/webgl_geometry_terrain.html

@@ -34,7 +34,7 @@
 		<div id="container"><br /><br /><br /><br /><br />Generating world...</div>
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - webgl terrain demo<br />(left click: forward, right click: backward)</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/ImprovedNoise.js"></script>
 		<script src="js/Detector.js"></script>

+ 1 - 1
examples/webgl_geometry_terrain_fog.html

@@ -34,7 +34,7 @@
 		<div id="container"><br /><br /><br /><br /><br />Generating world...</div>
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - webgl terrain + fog demo <br />(left click: forward, right click: backward)</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/ImprovedNoise.js"></script>
 

+ 1 - 1
examples/webgl_geometry_tessellation.html

@@ -33,7 +33,7 @@
 		<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - geometry tessellation example</div>
 		<div id="container"></div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/webgl_geometry_text.html

@@ -39,7 +39,7 @@
 		</div>
 
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/ShaderExtras.js"></script>
 

+ 1 - 1
examples/webgl_hdr.html

@@ -37,7 +37,7 @@
 			based on <a href="http://spidergl.org/example.php?id=13" target="_blank">SpiderGL</a>
 		</div>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Detector.js"></script>
 		<script src="js/Stats.js"></script>

+ 1 - 1
examples/webgl_interactive_cubes.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 1 - 1
examples/webgl_interactive_cubes_gpu.html

@@ -35,7 +35,7 @@
 		
 		<div id="container"></div>
 	
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

+ 1 - 1
examples/webgl_interactive_draggablecubes.html

@@ -15,7 +15,7 @@
 	</head>
 	<body>
 
-		<script src="../build/Three.js"></script>
+		<script src="../build/three.min.js"></script>
 
 		<script src="js/Stats.js"></script>
 

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