├── .gitignore ├── .npmignore ├── AnimalGeometry.js ├── Edge.js ├── Face.js ├── GeometryGeneratorTetraHedron.js ├── LICENSE.md ├── README.md ├── Skeleton ├── SkeletonPreviewPoints.js └── index.js ├── Vertex.js ├── animation-ensure-loop.js ├── bones.js ├── bower.json ├── index.js ├── lib ├── stats.min.js └── threex.rendererstats.js ├── package.json └── test.js /.gitignore: -------------------------------------------------------------------------------- 1 | bower_components 2 | node_modules 3 | *.log 4 | .DS_Store 5 | bundle.js 6 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | bower_components 2 | node_modules 3 | *.log 4 | .DS_Store 5 | bundle.js 6 | test 7 | test.js 8 | demo/ -------------------------------------------------------------------------------- /AnimalGeometry.js: -------------------------------------------------------------------------------- 1 | var GeometryGeneratorTetraHedron = require('./GeometryGeneratorTetraHedron'); 2 | function AnimalGeometry(sizeX, sizeY, sizeZ, segsX, segsY, segsZ) { 3 | THREE.Geometry.call(this); 4 | 5 | var geometryGenerator = new GeometryGeneratorTetraHedron(sizeX); 6 | this.vertices = geometryGenerator.collectVertices(); 7 | this.faces = geometryGenerator.collectFaces(); 8 | this.computeFaceNormals(); 9 | this.computeVertexNormals(); 10 | } 11 | 12 | AnimalGeometry.prototype = Object.create(THREE.Geometry.prototype); 13 | module.exports = AnimalGeometry; -------------------------------------------------------------------------------- /Edge.js: -------------------------------------------------------------------------------- 1 | var idCounter = 0; 2 | function Edge(v1, v2) { 3 | this.v1 = v1; 4 | this.v2 = v2; 5 | v1.addEdge(this); 6 | v2.addEdge(this); 7 | this.getLength(); 8 | this.faces = []; 9 | this.id = idCounter; 10 | idCounter++; 11 | } 12 | 13 | var __tempVec3 = new THREE.Vector3(); 14 | Edge.prototype = { 15 | getLength: function() { 16 | this.length = this.v1.clone().sub(this.v2).length(); 17 | return this.length; 18 | }, 19 | addFace: function(face) { 20 | this.faces.push(face); 21 | }, 22 | removeFace: function(face) { 23 | this.faces = this.faces.filter(function(f) { 24 | return (face !== f); 25 | }) 26 | }, 27 | split: function(percent) { 28 | if(percent === undefined) { percent = 0.5; } 29 | var vertex = this.v1.clone().multiplyScalar(1-percent); 30 | vertex.add(__tempVec3.copy(this.v2).multiplyScalar(percent)); 31 | var edges = [ 32 | new Edge(this.v1, vertex), 33 | new Edge(vertex, this.v2) 34 | ]; 35 | return { 36 | vertex: vertex, 37 | edges: edges 38 | } 39 | }, 40 | splitManyTimes: function(divisions) { 41 | var v1 = this.v1; 42 | var v2 = this.v2; 43 | var vertices = divisions.map(function(percent) { 44 | var vertex = v1.clone().multiplyScalar(1-percent); 45 | vertex.add(__tempVec3.copy(v2).multiplyScalar(percent)); 46 | return vertex; 47 | }); 48 | vertices.unshift(v1); 49 | vertices.push(v2); 50 | var edges = []; 51 | for (var i = 1; i < vertices.length; i++) { 52 | edges.push(new Edge(vertices[i-1], vertices[i])); 53 | } 54 | return { 55 | vertices: vertices, 56 | edges: edges 57 | } 58 | }, 59 | isConnectedTo: function(edge) { 60 | if(this.v1 === edge.v1 || this.v1 === edge.v2 || this.v2 === edge.v1 || this.v2 === edge.v2) return true; 61 | return false; 62 | }, 63 | getSharedVertex: function(edge) { 64 | if(this.v1 === edge.v1) return this.v1; 65 | if(this.v1 === edge.v2) return this.v1; 66 | if(this.v2 === edge.v1) return this.v2; 67 | if(this.v2 === edge.v2) return this.v2; 68 | 69 | }, 70 | getUnsharedVertex: function(edge) { 71 | if(this.v1 !== edge.v1 && this.v1 !== edge.v2) return this.v1; 72 | if(this.v2 !== edge.v1 && this.v2 !== edge.v2) return this.v2; 73 | }, 74 | attemptLength: function(length, strength) { 75 | var center = this.v1.clone().add(this.v2).multiplyScalar(.5); 76 | var vec = this.v2.clone().sub(this.v1).multiplyScalar(.5); 77 | var oldLength = this.getLength(); 78 | length -= (length - oldLength) * strength; 79 | vec.multiplyScalar((length / oldLength)); 80 | this.v1.copy(center).sub(vec); 81 | this.v2.copy(center).add(vec); 82 | }, 83 | getNormal: function() { 84 | var normal = new THREE.Vector3(); 85 | for (var i = 0; i < this.faces.length; i++) { 86 | normal.add(this.faces[i].getNormal()); 87 | } 88 | normal.multiplyScalar(1 / this.faces.length); 89 | normal.normalize(); 90 | return normal; 91 | }, 92 | disconnect: function() { 93 | this.v1.removeEdge(this); 94 | this.v2.removeEdge(this); 95 | this.v1 = null; 96 | this.v2 = null; 97 | } 98 | } 99 | 100 | module.exports = Edge; -------------------------------------------------------------------------------- /Face.js: -------------------------------------------------------------------------------- 1 | var idCounter = 0; 2 | 3 | function Face(edge1, edge2, edge3, flip) { 4 | this.edges = flip ? [edge1, edge2, edge3] : [edge3, edge2, edge1]; 5 | var _this = this; 6 | this.edges.forEach(function(edge){ 7 | edge.addFace(_this); 8 | }) 9 | this.id = idCounter; 10 | idCounter++; 11 | } 12 | 13 | var normal = new THREE.Vector3(); 14 | var tempVec3 = new THREE.Vector3(); 15 | 16 | Face.prototype = { 17 | getFace: function() { 18 | var verts = [ 19 | this.edges[0].getSharedVertex(this.edges[1]), 20 | this.edges[1].getSharedVertex(this.edges[2]), 21 | this.edges[2].getSharedVertex(this.edges[0]) 22 | ]; 23 | return new THREE.Face3(verts[0], verts[1], verts[2]); 24 | }, 25 | getPrevEdge: function(edge) { 26 | return this.edges[(this.edges.indexOf(edge)+2)%3]; 27 | }, 28 | getNextEdge: function(edge) { 29 | return this.edges[(this.edges.indexOf(edge)+1)%3]; 30 | }, 31 | getVertexOpposingEdge: function(edge) { 32 | return this.getNextEdge(edge).getUnsharedVertex(edge); 33 | }, 34 | removeItselfFromEdges: function() { 35 | var _this = this; 36 | this.edges.forEach(function(edge){ 37 | edge.removeFace(_this); 38 | }) 39 | }, 40 | getNormal: function() { 41 | var face = this.getFace(); 42 | 43 | normal.subVectors( face.c, face.b ); 44 | tempVec3.subVectors( face.a, face.b ); 45 | normal.cross( tempVec3 ); 46 | 47 | normal.normalize(); 48 | 49 | return normal; 50 | } 51 | } 52 | module.exports = Face; -------------------------------------------------------------------------------- /GeometryGeneratorTetraHedron.js: -------------------------------------------------------------------------------- 1 | var Vertex = require('./Vertex'); 2 | var Edge = require('./Edge'); 3 | var Face = require('./Face'); 4 | function GeometryGeneratorTetraHedron(size) { 5 | size = size || 1; 6 | this.vertices = []; 7 | this.edges = []; 8 | this.faces = []; 9 | 10 | var topLeft = this.createVertex(-size, -5, 0); //Top Left 11 | var topRight = this.createVertex(size, -5, 0); //Top Right 12 | var bottomRear = this.createVertex(0, 5, -size); //Bottom Rear 13 | var bottomFront = this.createVertex(0, 5, size); //Bottom Front 14 | 15 | var topEdge = this.createEdge(topLeft, topRight); 16 | var bottomEdge = this.createEdge(bottomRear, bottomFront); 17 | var rearLeftEdge = this.createEdge(topLeft, bottomRear); 18 | var rearRightEdge = this.createEdge(topRight, bottomRear); 19 | var frontLeftEdge = this.createEdge(topLeft, bottomFront); 20 | var frontRightEdge = this.createEdge(topRight, bottomFront); 21 | 22 | this.createFace(topEdge, rearLeftEdge, rearRightEdge, true); 23 | this.createFace(topEdge, frontLeftEdge, frontRightEdge); 24 | this.createFace(bottomEdge, frontLeftEdge, rearLeftEdge); 25 | this.createFace(bottomEdge, frontRightEdge, rearRightEdge, true); 26 | 27 | var len = topEdge.getLength(); 28 | // this.splitEdge(topEdge); 29 | // this.splitEdge(bottomEdge); 30 | // this.splitEdge(rearLeftEdge); 31 | // this.splitEdge(rearRightEdge); 32 | // this.splitEdge(frontLeftEdge); 33 | // this.splitEdge(frontRightEdge); 34 | // return; 35 | 36 | for (var i = 0, total = 500; i < total; i++) { 37 | this.edges.sort(function(a, b) { 38 | return b.length - a.length; 39 | }); 40 | this.splitEdge(this.edges[0]); 41 | }; 42 | 43 | 44 | // for (var i = 0, total = 20; i < total; i++) { 45 | // this.edges.forEach(function(edge) { 46 | // edge.attemptLength(.05, .95); 47 | // }) 48 | // } 49 | 50 | for (var i = 0, total = 1500; i < total; i++) { 51 | 52 | this.edges.sort(function(a, b) { 53 | return b.length - a.length; 54 | }); 55 | this.splitEdge(this.edges[0]); 56 | }; 57 | 58 | // for (var i = 0, total = 10; i < total; i++) { 59 | 60 | // this.edges.forEach(function(edge) { 61 | // edge.attemptLength(.05, .95); 62 | // }) 63 | // } 64 | 65 | } 66 | GeometryGeneratorTetraHedron.prototype = { 67 | createVertex: function(x, y, z) { 68 | var vert = new Vertex(x, y, z); 69 | this.vertices.push(vert); 70 | return vert; 71 | }, 72 | createEdge: function(v1, v2) { 73 | var edge = new Edge(v1, v2); 74 | this.edges.push(edge); 75 | return edge; 76 | }, 77 | createFace: function(e1, e2, e3, flip) { 78 | var face = new Face(e1, e2, e3, flip); 79 | this.faces.push(face); 80 | return face; 81 | }, 82 | destroyEdge: function(edge) { 83 | this.edges = this.edges.filter(function(e){ 84 | return (e !== edge); 85 | }); 86 | }, 87 | destroyFace: function(face) { 88 | this.faces = this.faces.filter(function(f){ 89 | return (f !== face); 90 | }); 91 | face.removeItselfFromEdges(); 92 | }, 93 | collectVertices: function() { 94 | return this.vertices; 95 | }, 96 | collectFaces: function() { 97 | var faces = []; 98 | for (var i = this.faces.length - 1; i >= 0; i--) { 99 | var face = this.faces[i].getFace(this.vertices); 100 | if(face) { 101 | faces.push(face); 102 | //convert vertices to vertex indices 103 | face.a = this.vertices.indexOf(face.a); 104 | face.b = this.vertices.indexOf(face.b); 105 | face.c = this.vertices.indexOf(face.c); 106 | } 107 | }; 108 | return faces; 109 | }, 110 | splitEdge: function(edge) { 111 | var faces = edge.faces; 112 | var newParts = edge.split(); 113 | this.vertices.push(newParts.vertex); 114 | var normal = edge.getNormal(); 115 | normal.multiplyScalar(Math.min(0.2, edge.getLength() * 0.1)); 116 | newParts.vertex.x += normal.x; 117 | newParts.vertex.y += normal.y; 118 | newParts.vertex.z += normal.z; 119 | this.edges.push(newParts.edges[0]); 120 | this.edges.push(newParts.edges[1]); 121 | function getNewEdgeConnectedTo(sharedEdge) { 122 | if(sharedEdge.isConnectedTo(newParts.edges[0])) return newParts.edges[0]; 123 | if(sharedEdge.isConnectedTo(newParts.edges[1])) return newParts.edges[1]; 124 | } 125 | var _this = this; 126 | faces.forEach(function(f){ 127 | var splitEdge = new Edge(newParts.vertex, f.getVertexOpposingEdge(edge)); 128 | _this.edges.push(splitEdge); 129 | var prevEdge = f.getPrevEdge(edge); 130 | var nextEdge = f.getNextEdge(edge); 131 | _this.createFace(splitEdge, getNewEdgeConnectedTo(prevEdge), prevEdge, f.flip); 132 | _this.createFace(splitEdge, nextEdge, getNewEdgeConnectedTo(nextEdge), f.flip); 133 | _this.destroyFace(f); 134 | }); 135 | this.destroyEdge(edge); 136 | } 137 | }; 138 | 139 | module.exports = GeometryGeneratorTetraHedron; -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2014 Tomasz Dysinski 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 20 | OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # threejs-procedural-animal 2 | 3 | [![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges) 4 | 5 | An experiment in procedural animal generation using threejs. 6 | 7 | ## Usage 8 | 9 | [![NPM](https://nodei.co/npm/threejs-procedural-animal.png)](https://nodei.co/npm/threejs-procedural-animal/) 10 | 11 | ## License 12 | 13 | MIT, see [LICENSE.md](http://github.com/bunnybones1/threejs-procedural-animal/blob/master/LICENSE.md) for details. 14 | -------------------------------------------------------------------------------- /Skeleton/SkeletonPreviewPoints.js: -------------------------------------------------------------------------------- 1 | function SkeletonPreviewPoints(skeleton) { 2 | var geometry = new THREE.Geometry(); 3 | Object.keys(skeleton.joints).forEach(function(key) { 4 | geometry.vertices.push(skeleton.joints[key]); 5 | }); 6 | var color = 0xffffff; 7 | var material = new THREE.PointsMaterial( { 8 | color: color, 9 | size: 0.5, 10 | sizeAttenuation: true 11 | } ); 12 | THREE.Points.call(this, geometry, material); 13 | 14 | var lineGeometry = new THREE.Geometry(); 15 | Object.keys(skeleton.bones).forEach(function(key) { 16 | lineGeometry.vertices.push(skeleton.bones[key].v1, skeleton.bones[key].v2); 17 | }); 18 | var lineMaterial = new THREE.LineBasicMaterial({ 19 | color: color, 20 | linewidth: 1 21 | } ); 22 | var line = new THREE.LineSegments( lineGeometry, lineMaterial ); 23 | this.add(line); 24 | } 25 | 26 | SkeletonPreviewPoints.prototype = Object.create(THREE.Points.prototype); 27 | 28 | module.exports = SkeletonPreviewPoints; -------------------------------------------------------------------------------- /Skeleton/index.js: -------------------------------------------------------------------------------- 1 | var Vertex = require('../Vertex'); 2 | var Edge = require('../Edge'); 3 | var SkeletonPreviewPoints = require('./SkeletonPreviewPoints'); 4 | 5 | function __makeSplittingArguments(boneName, splitTimes, baseName, nameBackwards, proportions){ 6 | if(!proportions) { 7 | proportions = []; 8 | for (var i = 0; i < splitTimes; i++) { 9 | proportions[i] = 1; 10 | } 11 | } 12 | var normalizer = 0; 13 | for (var i = 0; i < splitTimes; i++) { 14 | normalizer += proportions[i]; 15 | } 16 | 17 | for (var i = 0; i < splitTimes; i++) { 18 | proportions[i] /= normalizer; 19 | } 20 | 21 | var divisions = []; 22 | var accumilator = 0; 23 | for (var i = 0; i < splitTimes; i++) { 24 | accumilator += proportions[i]; 25 | divisions[i] = accumilator; 26 | } 27 | 28 | var boneNames = []; 29 | for (var i = 1; i <= splitTimes; i++) { 30 | boneNames.push(baseName+i); 31 | } 32 | 33 | if(nameBackwards) { 34 | boneNames.reverse(); 35 | } 36 | // ['c7','c6','c5','c4','c3','c2','c1'] 37 | var jointNames = []; 38 | for (var i = 1; i < splitTimes; i++) { 39 | jointNames.push(boneNames[i-1] + '-' + boneNames[i]); 40 | } 41 | // ['c7-c6','c6-c5','c5-c4','c4-c3','c3-c2','c2-c1'] 42 | return [ 43 | boneName, 44 | divisions, 45 | boneNames, 46 | jointNames 47 | ]; 48 | } 49 | 50 | function Skeleton() { 51 | this.joints = {}; 52 | this.bones = {}; 53 | 54 | this.addJoint('hip-spine', 0, 0.9, 0); 55 | this.addJoint('tailTip', 0, 0.8, 0); 56 | this.addJoint('head-neck', 0, 1.46, 0); 57 | this.addJoint('philange-1-distal-tip', 0.7, 1.56, 0); 58 | this.addJoint('philange-2-distal-tip', 0.8, 1.46, 0); 59 | this.addJoint('philange-3-distal-tip', 0.81, 1.41, 0); 60 | this.addJoint('philange-4-distal-tip', 0.8, 1.36, 0); 61 | this.addJoint('philange-5-distal-tip', 0.78, 1.31, 0); 62 | this.addJoint('tarsal-1-distal-tip', 0.33, -0.15, 0); 63 | 64 | this.addBone('spine', 'hip-spine', 'head-neck'); 65 | this.cutBone( 66 | 'spine', 67 | [0.2, 0.8], 68 | ['spine-lumbar', 'spine-thoracic', 'spine-cervical'], 69 | ['l1-t12', 't1-c7'] 70 | ); 71 | this.cutBoneManyTimes('spine-cervical', 7, 'spine-c', true); 72 | this.cutBoneManyTimes('spine-thoracic', 12, 'spine-t', true); 73 | this.cutBoneManyTimes('spine-lumbar', 5, 'spine-l', true); 74 | 75 | this.addBone('arm', 't1-c7', 'philange-2-distal-tip'); 76 | this.addBone('leg', 'hip-spine', 'tarsal-1-distal-tip'); 77 | this.cutBoneManyTimes('arm', 7, 'arm', false, [18, 30, 26, 8, 5, 3, 2, 1]); 78 | this.cutBoneManyTimes('leg', 7, 'leg', false, [14, 38, 40, 13, 4, 1.5, 1, 0.5]); 79 | 80 | this.addBone('thumb', 'arm3-arm4', 'philange-1-distal-tip'); 81 | this.cutBoneManyTimes('thumb', 3, 'thumb', false, [8, 5, 3, 2]); 82 | this.addBone('philange-3', 'arm3-arm4', 'philange-3-distal-tip'); 83 | this.cutBoneManyTimes('philange-3', 3, 'philange-3', false, [8, 5, 3, 2, 1]); 84 | this.addBone('philange-4', 'arm3-arm4', 'philange-4-distal-tip'); 85 | this.cutBoneManyTimes('philange-4', 3, 'philange-4', false, [8, 5, 3, 2, 1]); 86 | this.addBone('philange-5', 'arm3-arm4', 'philange-5-distal-tip'); 87 | this.cutBoneManyTimes('philange-5', 3, 'philange-5', false, [8, 5, 3, 2, 1]); 88 | // this.cutBoneManyTimes('arm', 6, 'arm', false, [18, 30, 26, 8, 5, 3, 2]); 89 | // this.cutBoneManyTimes('arm', 6, 'arm', false, [18, 30, 26, 8, 5, 3, 2]); 90 | // this.cutBoneManyTimes('arm', 6, 'arm', false, [18, 30, 26, 8, 5, 3, 2]); 91 | 92 | 93 | 94 | this.addBone('spine', 'hip-spine', 'tailTip'); 95 | } 96 | 97 | Skeleton.prototype.createPreview = function() { 98 | return new SkeletonPreviewPoints(this); 99 | } 100 | 101 | Skeleton.prototype.addJoint = function(name, x, y, z) { 102 | this.joints[name] = new Vertex(x, y, z); 103 | } 104 | 105 | Skeleton.prototype.addBone = function(name, jointNameA, jointNameB) { 106 | this.bones[name] = new Edge(this.joints[jointNameA], this.joints[jointNameB]); 107 | } 108 | 109 | Skeleton.prototype.cutBoneManyTimes = function(boneName, splitTimes, baseName, nameBackwards, proportions) { 110 | this.cutBone.apply(this, __makeSplittingArguments(boneName, splitTimes, baseName, nameBackwards, proportions)); 111 | } 112 | 113 | Skeleton.prototype.cutBone = function(boneName, divisions, boneNames, jointNames) { 114 | var originalBone = this.bones[boneName]; 115 | delete this.bones[boneName]; 116 | var results = originalBone.splitManyTimes(divisions); 117 | for (var i = 0; i < boneNames.length; i++) { 118 | this.bones[boneNames[i]] = results.edges[i]; 119 | } 120 | for (var i = 0; i < boneNames.length; i++) { 121 | this.joints[jointNames[i]] = results.vertices[i+1]; 122 | } 123 | originalBone.disconnect(); 124 | } 125 | 126 | module.exports = Skeleton; -------------------------------------------------------------------------------- /Vertex.js: -------------------------------------------------------------------------------- 1 | function Vertex(x, y, z) { 2 | THREE.Vector3.call(this, x, y, z); 3 | this.edges = []; 4 | } 5 | 6 | Vertex.prototype = Object.create(THREE.Vector3.prototype); 7 | 8 | Vertex.prototype.addEdge = function(edge) { 9 | this.edges.push(edge); 10 | } 11 | 12 | Vertex.prototype.removeEdge = function(edge) { 13 | this.edges = this.edges.filter(function(e) { 14 | return edge !== e; 15 | }) 16 | } 17 | 18 | Vertex.prototype.clone = function() { 19 | return new Vertex( this.x, this.y, this.z ); 20 | } 21 | 22 | Vertex.prototype.destroy = function() { 23 | this.edges.forEach(function(edge) { 24 | edge.disconnect(); 25 | }); 26 | } 27 | module.exports = Vertex; -------------------------------------------------------------------------------- /animation-ensure-loop.js: -------------------------------------------------------------------------------- 1 | function ensureLoop( animation ) { 2 | 3 | for ( var i = 0; i < animation.hierarchy.length; i ++ ) { 4 | 5 | var obj = animation.hierarchy[ i ]; 6 | 7 | var first = obj.keys[ 0 ]; 8 | var last = obj.keys[ obj.keys.length - 1 ]; 9 | 10 | last.pos = first.pos; 11 | last.rot = first.rot; 12 | last.scl = first.scl; 13 | 14 | } 15 | 16 | }; 17 | 18 | module.exports = ensureLoop; -------------------------------------------------------------------------------- /bones.js: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "metadata" : 4 | { 5 | "formatVersion" : 3.1, 6 | "generatedBy" : "Blender 2.65 Exporter", 7 | "vertices" : 482, 8 | "faces" : 480, 9 | "normals" : 384, 10 | "colors" : 0, 11 | "uvs" : [], 12 | "materials" : 1, 13 | "morphTargets" : 0, 14 | "bones" : 2 15 | }, 16 | 17 | "scale" : 1.000000, 18 | 19 | "materials" : [ { 20 | "DbgColor" : 15658734, 21 | "DbgIndex" : 0, 22 | "DbgName" : "Material", 23 | "blending" : "NormalBlending", 24 | "colorAmbient" : [0.6400000190734865, 0.6400000190734865, 0.6400000190734865], 25 | "colorDiffuse" : [0.6400000190734865, 0.6400000190734865, 0.6400000190734865], 26 | "colorSpecular" : [0.5, 0.5, 0.5], 27 | "depthTest" : true, 28 | "depthWrite" : true, 29 | "shading" : "Lambert", 30 | "specularCoef" : 50, 31 | "transparency" : 1.0, 32 | "transparent" : false, 33 | "vertexColors" : false 34 | }], 35 | 36 | "vertices" : [6.51926e-08,-5.98696,1.42489e-07,0.350694,-5.98062,2.01817e-07,2.23517e-08,-5.98062,0.350695,-0.350694,-5.98062,8.26072e-08,1.04308e-07,-5.98062,-0.350694,0.326389,-5.97466,-0.326389,0.326389,-5.97466,0.326389,-0.326389,-5.97466,0.326389,-0.326389,-5.97466,-0.326389,5.61514,1.3423,-5.0605e-07,5.60825,1.34098,-0.350695,5.54239,1.68543,-5.98335e-07,5.60825,1.34098,0.350694,5.6741,0.996522,-4.00012e-07,5.66305,1.01915,-0.326389,5.54046,1.66032,-0.326389,5.54046,1.66032,0.326388,5.66305,1.01916,0.326389,5.65725,0.425913,-2.16254e-07,5.64513,0.48546,-0.362848,5.7074,0.525646,-2.48944e-07,5.64513,0.48546,0.362847,5.54437,0.374282,-1.92627e-07,5.53263,0.43567,-0.375,5.69412,0.579671,-0.326389,5.69412,0.579671,0.326389,5.53263,0.43567,0.375,5.48673,1.31774,0.907986,5.55417,0.961218,0.847222,5.55351,1.33051,0.819444,5.41788,1.674,0.847222,5.36831,1.2951,0.937499,5.43873,0.926774,0.874999,5.61196,1.00939,0.763889,5.48938,1.65055,0.763888,5.29789,1.66343,0.874999,5.31622,2.20958,-7.30244e-07,5.32692,2.14976,0.362846,5.39962,2.13538,-7.13973e-07,5.32692,2.14976,-0.362848,5.19225,2.21592,-7.26042e-07,5.20399,2.15454,0.374999,5.40722,2.08027,0.326388,5.40722,2.08027,-0.32639,5.20399,2.15454,-0.375001,1.67405e-07,-5.85109,-0.907986,0.362847,-5.85044,-0.847222,1.56462e-07,-5.93031,-0.819444,-0.362847,-5.85044,-0.847222,1.71363e-07,-5.68872,-0.9375,0.375,-5.68872,-0.875,0.326389,-5.9277,-0.763889,-0.326389,-5.9277,-0.763889,-0.375,-5.68872,-0.875,2.69854,-0.137032,6.84276e-09,2.6863,-0.0762431,-0.375,3.28039,-0.0393877,-3.3755e-08,2.6863,-0.076243,0.375,2.0994,-0.243973,4.88426e-08,2.08692,-0.183488,-0.375,3.26841,0.0217008,-0.375,3.26841,0.0217012,0.375,2.08692,-0.183487,0.375,2.51505,0.774803,0.9375,2.58844,0.410069,0.875,3.10063,0.876955,0.9375,2.44165,1.13954,0.875,1.91216,0.663322,0.9375,1.98705,0.300404,0.875,3.17254,0.510418,0.875,3.02873,1.24349,0.875,1.83726,1.02624,0.875,2.33156,1.68664,-4.20633e-07,2.34379,1.62585,0.375,2.92087,1.7933,-4.93476e-07,2.34379,1.62585,-0.375,1.72492,1.57062,-3.45463e-07,1.7374,1.51013,0.375,2.93286,1.73221,0.374999,2.93286,1.73221,-0.375,1.7374,1.51013,-0.375,4.55712,1.14,-0.9375,4.62754,0.771677,-0.875,4.13612,1.05951,-0.9375,4.48669,1.50833,-0.875,4.90809,1.20711,-0.9375,4.97852,0.838782,-0.875,4.20654,0.691184,-0.875,4.0657,1.42784,-0.875,4.83767,1.57544,-0.875,2.51505,0.774803,-0.9375,2.58844,0.410068,-0.875,1.91216,0.663321,-0.9375,2.44165,1.13954,-0.875,3.10063,0.876955,-0.9375,3.17254,0.510418,-0.875,1.98705,0.300403,-0.875,1.83726,1.02624,-0.875,3.02873,1.24349,-0.875,0.627689,-0.105854,2.36711e-07,0.590553,-0.0751813,-0.375,0.917613,-0.114364,1.73422e-07,0.590552,-0.0751812,0.375,0.624116,-0.329715,2.70904e-07,0.574775,-0.313803,-0.375,0.892679,-0.0689353,-0.375,0.892679,-0.0689349,0.375,0.574775,-0.313802,0.375,0.0706402,0.35423,0.9375,0.29346,0.170197,0.875,0.543599,0.567066,0.9375,-0.152179,0.538264,0.875,-0.116011,-0.0910295,0.9375,0.18004,-0.186504,0.875,0.693205,0.294494,0.875,0.393994,0.839638,0.875,-0.412062,0.00444464,0.875,-0.486408,0.814314,-1.74876e-07,-0.449272,0.783642,0.375,0.169586,1.2485,-2.17128e-07,-0.449272,0.783641,-0.375,-0.856138,0.147656,-1.62661e-07,-0.806796,0.131743,0.375,0.19452,1.20307,0.375,0.19452,1.20307,-0.375,-0.806796,0.131743,-0.375,0.0706405,0.35423,-0.9375,0.29346,0.170196,-0.875,-0.11601,-0.0910299,-0.9375,-0.152179,0.538263,-0.875,0.5436,0.567066,-0.9375,0.693205,0.294494,-0.875,0.18004,-0.186504,-0.875,-0.412061,0.0044442,-0.875,0.393994,0.839637,-0.875,0.909912,-1.97126,2.84737e-07,0.847883,-1.97069,-0.375,0.904199,-1.37441,2.84381e-07,0.847883,-1.97069,0.375,0.920999,-2.57966,2.77543e-07,0.858734,-2.57938,-0.375,0.842409,-1.37356,-0.375,0.842409,-1.37356,0.375,0.858734,-2.57938,0.375,-0.0205152,-1.9627,0.9375,0.351655,-1.96612,0.875,-0.0226519,-1.36154,0.9375,-0.392686,-1.95928,0.875,-0.0129769,-2.5754,0.9375,0.360614,-2.57711,0.875,0.348088,-1.36669,0.875,-0.393392,-1.35639,0.875,-0.386567,-2.5737,0.875,-0.950941,-1.95415,-1.31411e-07,-0.888913,-1.95472,0.375,-0.949502,-1.34866,-1.45418e-07,-0.888913,-1.95472,-0.375,-0.946953,-2.57114,-1.09115e-07,-0.884688,-2.57142,0.375,-0.887712,-1.34952,0.375,-0.887712,-1.34952,-0.375,-0.884688,-2.57142,-0.375,-0.0205147,-1.9627,-0.9375,0.351656,-1.96612,-0.875,-0.0129765,-2.5754,-0.9375,-0.392685,-1.95928,-0.875,-0.0226515,-1.36154,-0.9375,0.348089,-1.36669,-0.875,0.360614,-2.57711,-0.875,-0.386567,-2.5737,-0.875,-0.393392,-1.35639,-0.875,0.9375,-4.44197,2.7519e-07,0.875,-4.44197,-0.375,0.9375,-3.83597,2.79434e-07,0.875,-4.44197,0.375,0.9375,-4.98029,2.6985e-07,0.875,-4.9803,-0.375,0.875,-3.83597,-0.375,0.875,-3.83597,0.375,0.875,-4.98029,0.375,-1.07102e-07,-4.44197,0.9375,0.375,-4.44197,0.875,-1.3411e-07,-3.83597,0.9375,-0.375,-4.44197,0.875,-8.19564e-08,-4.98029,0.9375,0.375,-4.9803,0.875,0.375,-3.83597,0.875,-0.375,-3.83597,0.875,-0.375,-4.98029,0.875,-0.9375,-4.44197,-5.17045e-08,-0.875,-4.44197,0.375,-0.9375,-3.83597,-7.0743e-08,-0.875,-4.44197,-0.375,-0.9375,-4.98029,-3.56242e-08,-0.875,-4.9803,0.375,-0.875,-3.83597,0.375,-0.875,-3.83597,-0.375,-0.875,-4.98029,-0.375,1.65543e-07,-4.44197,-0.9375,0.375,-4.44197,-0.875,1.63913e-07,-4.98029,-0.9375,-0.375,-4.44197,-0.875,1.78814e-07,-3.83597,-0.9375,0.375,-3.83597,-0.875,0.375,-4.98029,-0.875,-0.375,-4.98029,-0.875,-0.375,-3.83597,-0.875,0.907986,-5.85109,2.7392e-07,0.847222,-5.85044,-0.362847,0.9375,-5.68872,2.63563e-07,0.847222,-5.85044,0.362847,0.819444,-5.93031,2.66672e-07,0.763889,-5.9277,-0.326389,0.875,-5.68872,-0.375,0.875,-5.68872,0.375,0.763889,-5.9277,0.326389,-4.47035e-08,-5.85109,0.907986,0.362847,-5.85044,0.847222,-5.21541e-08,-5.68872,0.9375,-0.362847,-5.85044,0.847222,-3.72529e-08,-5.93031,0.819445,0.326389,-5.9277,0.763889,0.375,-5.68872,0.875,-0.375,-5.68872,0.875,-0.326389,-5.9277,0.763889,-0.907986,-5.85109,-4.54548e-09,-0.847222,-5.85044,0.362847,-0.9375,-5.68872,-1.9559e-08,-0.847222,-5.85044,-0.362847,-0.819444,-5.93031,1.33527e-08,-0.763889,-5.9277,0.326389,-0.875,-5.68872,0.375,-0.875,-5.68872,-0.375,-0.763889,-5.9277,-0.326389,4.73317,0.219184,-1.61379e-07,4.72144,0.280572,-0.375,5.08415,0.28629,-1.89803e-07,4.72144,0.280573,0.375,4.31218,0.138692,-1.27385e-07,4.30044,0.20008,-0.375,5.07241,0.347678,-0.375,5.07241,0.347679,0.375,4.30044,0.20008,0.375,4.55712,1.14,0.937499,4.62754,0.771677,0.875,4.90809,1.20711,0.937499,4.48669,1.50833,0.874999,4.13612,1.05951,0.937499,4.20655,0.691185,0.875,4.97852,0.838782,0.875,4.83767,1.57544,0.874999,4.0657,1.42784,0.874999,4.38106,2.06083,-6.60801e-07,4.3928,1.99944,0.374999,4.73204,2.12793,-6.93416e-07,4.3928,1.99944,-0.375001,3.96006,1.98033,-6.16096e-07,3.9718,1.91895,0.374999,4.74377,2.06654,0.374999,4.74377,2.06654,-0.375001,3.9718,1.91895,-0.375001,5.48673,1.31774,-0.907987,5.55417,0.961217,-0.847223,5.36831,1.2951,-0.937501,5.41788,1.674,-0.847223,5.55351,1.33051,-0.819445,5.61196,1.00939,-0.763889,5.43873,0.926774,-0.875,5.29789,1.66343,-0.875,5.48938,1.65055,-0.763889,0.598958,-5.95695,-0.302083,0.643229,-5.96171,2.40105e-07,0.598958,-5.95695,0.302084,0.302083,-5.95695,-0.598958,1.39698e-07,-5.96171,-0.643229,-0.302083,-5.95695,-0.598958,5.49742,0.619834,-0.6875,5.61027,0.663947,-0.665365,5.66031,0.741124,-0.598959,0.302083,-5.95695,0.598958,-1.86265e-08,-5.96171,0.643229,-0.302083,-5.95695,0.598958,5.49742,0.619834,0.6875,5.61027,0.663947,0.665364,5.66031,0.741125,0.598958,-0.598958,-5.95695,0.302083,-0.643229,-5.96171,4.26649e-08,-0.598958,-5.95695,-0.302083,5.2392,1.97037,0.687499,5.36036,1.971,0.665364,5.43535,1.91773,0.598958,5.2392,1.97037,-0.687501,5.36036,1.971,-0.665365,5.43535,1.91773,-0.598959,5.69498,0.747752,-0.302084,5.70846,0.705258,-3.13704e-07,5.69498,0.747753,0.302083,5.63923,1.03935,-0.598959,5.58767,1.33704,-0.64323,5.52577,1.63276,-0.598959,5.63923,1.03935,0.598958,5.58767,1.33704,0.643229,5.52577,1.63276,0.598958,5.47002,1.92436,0.302083,5.46687,1.96883,-6.70414e-07,5.47002,1.92436,-0.302084,0.6875,-5.68872,-0.6875,0.665365,-5.84978,-0.665364,0.598958,-5.92509,-0.598958,0.6875,-5.68872,0.6875,0.665365,-5.84978,0.665365,0.598958,-5.92509,0.598959,-0.6875,-5.68872,0.6875,-0.665365,-5.84978,0.665365,-0.598958,-5.92509,0.598958,-0.6875,-5.68872,-0.6875,-0.665364,-5.84978,-0.665365,-0.598958,-5.92509,-0.598958,3.81736,0.107716,-0.375,3.82909,0.0463282,-8.83016e-08,3.81736,0.107717,0.375,3.72346,0.598821,0.875,3.65304,0.967149,0.9375,3.58261,1.33548,0.875,3.48872,1.82658,0.374999,3.47698,1.88797,-5.54661e-07,3.48872,1.82658,-0.375001,3.72346,0.59882,-0.875,3.65304,0.967149,-0.9375,3.58261,1.33548,-0.875,2.04947,-0.0020285,-0.6875,2.64961,0.106124,-0.6875,3.23246,0.20497,-0.6875,2.04947,-0.00202808,0.6875,2.64961,0.106124,0.6875,3.23246,0.204971,0.6875,1.77485,1.32867,0.6875,2.38049,1.44348,0.6875,2.96881,1.54894,0.6875,1.77485,1.32867,-0.6875,2.38049,1.44348,-0.6875,2.96881,1.54894,-0.6875,1.38395,0.184297,-0.875,1.30754,0.545386,-0.9375,1.23113,0.906475,-0.875,1.48583,-0.297156,-0.375,1.49856,-0.357337,9.73733e-08,1.48583,-0.297155,0.375,1.38395,0.184297,0.875,1.30754,0.545386,0.9375,1.23113,0.906475,0.875,1.12925,1.38793,0.375,1.11652,1.44811,-2.7541e-07,1.12925,1.38793,-0.375,0.426749,-0.266066,-0.6875,0.479143,0.0168353,-0.6875,0.817876,0.0673506,-0.6875,0.426749,-0.266065,0.6875,0.479143,0.0168354,0.6875,0.817876,0.067351,0.6875,-0.658771,0.0840061,0.6875,-0.337862,0.691625,0.6875,0.269323,1.06678,0.6875,-0.65877,0.084006,-0.6875,-0.337862,0.691625,-0.6875,0.269323,1.06678,-0.6875,0.349947,-0.774899,-0.875,-0.0193522,-0.768005,-0.9375,-0.388652,-0.761111,-0.875,0.842346,-0.784091,-0.375,0.903896,-0.78524,2.8189e-07,0.842346,-0.784091,0.375,0.349947,-0.774899,0.875,-0.0193527,-0.768005,0.9375,-0.388652,-0.761111,0.875,-0.881051,-0.751919,0.375,-0.942601,-0.750771,-1.65745e-07,-0.881051,-0.75192,-0.375,0.671939,-2.57853,-0.6875,0.661798,-1.96898,-0.6875,0.657039,-1.37098,-0.6875,0.671939,-2.57853,0.6875,0.661798,-1.96898,0.6875,0.657039,-1.37098,0.6875,-0.697893,-2.57228,0.6875,-0.702828,-1.95643,0.6875,-0.702342,-1.35209,0.6875,-0.697892,-2.57228,-0.6875,-0.702828,-1.95643,-0.6875,-0.702342,-1.35209,-0.6875,0.375,-3.20359,-0.875,1.98372e-07,-3.20359,-0.9375,-0.375,-3.20359,-0.875,0.875,-3.20359,-0.375,0.9375,-3.20359,2.76007e-07,0.875,-3.20359,0.375,0.375,-3.20359,0.875,-1.63913e-07,-3.20359,0.9375,-0.375,-3.20359,0.875,-0.875,-3.20359,0.375,-0.9375,-3.20359,-9.09346e-08,-0.875,-3.20359,-0.375,0.6875,-4.98029,-0.6875,0.6875,-4.44197,-0.6875,0.6875,-3.83597,-0.6875,0.6875,-4.98029,0.6875,0.6875,-4.44197,0.6875,0.6875,-3.83597,0.6875,-0.6875,-4.98029,0.6875,-0.6875,-4.44197,0.6875,-0.6875,-3.83597,0.6875,-0.6875,-4.98029,-0.6875,-0.6875,-4.44197,-0.6875,-0.6875,-3.83597,-0.6875,0.375,-5.40964,-0.875,1.68569e-07,-5.40964,-0.9375,-0.375,-5.40964,-0.875,0.875,-5.40964,-0.375,0.9375,-5.40964,2.71853e-07,0.875,-5.40964,0.375,0.375,-5.40964,0.875,-6.70552e-08,-5.40964,0.9375,-0.375,-5.40964,0.875,-0.875,-5.40964,0.375,-0.9375,-5.40964,-2.43073e-08,-0.875,-5.40964,-0.375,5.0372,0.531842,-0.6875,4.68622,0.464736,-0.6875,4.26523,0.384244,-0.6875,5.0372,0.531843,0.6875,4.68622,0.464737,0.6875,4.26523,0.384244,0.6875,4.77899,1.88238,0.687499,4.42801,1.81527,0.687499,4.00701,1.73478,0.687499,4.77898,1.88238,-0.687501,4.42801,1.81527,-0.6875,4.00701,1.73478,-0.6875,5.34545,0.399883,-0.375,5.35719,0.338494,-1.92619e-07,5.34545,0.399883,0.375,5.25155,0.890987,0.874999,5.18113,1.25932,0.937499,5.11071,1.62764,0.874999,5.01681,2.11875,0.374999,5.00507,2.18014,-7.12995e-07,5.01681,2.11875,-0.375001,5.25155,0.890986,-0.875,5.18113,1.25932,-0.937501,5.11071,1.62764,-0.875,0.509259,-5.94733,-0.509259,0.509259,-5.94733,0.509259,-0.509259,-5.94733,0.509259,-0.509259,-5.94733,-0.509259,5.66766,0.833853,-0.50926,5.66766,0.833853,0.509259,5.47639,1.83425,0.509259,5.47639,1.83425,-0.50926,3.78215,0.29188,-0.6875,3.78215,0.291881,0.6875,3.52393,1.64242,0.6875,3.52393,1.64242,-0.6875,1.44762,-0.116611,-0.6875,1.44762,-0.116611,0.6875,1.16745,1.20738,0.6875,1.16746,1.20738,-0.6875,0.657697,-0.780644,-0.6875,0.657696,-0.780644,0.6875,-0.696401,-0.755367,0.6875,-0.696401,-0.755367,-0.6875,0.6875,-3.20359,-0.6875,0.6875,-3.20359,0.6875,-0.6875,-3.20359,0.6875,-0.6875,-3.20359,-0.6875,0.6875,-5.40964,-0.6875,0.6875,-5.40964,0.6875,-0.6875,-5.40964,0.6875,-0.6875,-5.40964,-0.6875,5.31024,0.584046,-0.6875,5.31024,0.584047,0.6875,5.05202,1.93458,0.687499,5.05202,1.93458,-0.687501], 37 | 38 | "morphTargets" : [], 39 | 40 | "normals" : [0,-1,0,0,-0.999054,-0.043367,0.045961,-0.997864,-0.045961,0.043367,-0.999054,0,0.118961,-0.991058,-0.060152,0.124027,-0.992248,0,0,-0.992248,-0.124027,0.060152,-0.991058,-0.118961,0.108036,-0.98825,-0.108036,0.045961,-0.997864,0.045961,0,-0.999054,0.043367,0.060152,-0.991058,0.118961,0,-0.992248,0.124027,0.118961,-0.991058,0.060152,0.108036,-0.98825,0.108036,-0.045961,-0.997864,0.045961,-0.043367,-0.999054,0,-0.118961,-0.991058,0.060152,-0.124027,-0.992248,0,-0.060152,-0.991058,0.118961,-0.108036,-0.98825,0.108036,-0.045961,-0.997864,-0.045961,-0.060152,-0.991058,-0.118961,-0.118961,-0.991058,-0.060152,-0.108036,-0.98825,-0.108036,0.982208,0.18778,0,0.990081,0.140385,0,0.989196,0.137333,-0.050874,0.981048,0.187567,-0.048006,0.983947,0.120457,-0.131413,0.97293,0.18601,-0.137028,0.998657,0.051424,0,0.996155,0.056612,-0.066439,0.990509,0.067873,-0.119327,0.970092,0.237251,-0.050874,0.972045,0.234718,0,0.946806,0.314829,-0.066439,0.947203,0.320597,0,0.959014,0.251015,-0.131443,0.945677,0.302316,-0.119327,0.970092,0.237251,0.050874,0.981048,0.187567,0.048006,0.959014,0.251015,0.131413,0.97293,0.18601,0.137028,0.946806,0.314829,0.066439,0.945677,0.302316,0.119327,0.989196,0.137333,0.050874,0.996155,0.056612,0.066439,0.983947,0.120457,0.131443,0.990509,0.067873,0.119327,0.685354,-0.728172,0,0.303507,-0.952818,0,0.29432,-0.891659,-0.343944,0.681234,-0.671041,-0.292581,0.25425,-0.66567,-0.701559,0.649525,-0.477859,-0.591357,0.18778,-0.982208,0,0.176214,-0.92169,-0.3455,0.132786,-0.69451,-0.707083,0.964782,-0.216926,-0.148625,0.968932,-0.2472,0,0.947356,-0.120731,-0.296487,0.964782,-0.216926,0.148625,0.681234,-0.671041,0.292581,0.947356,-0.120731,0.296487,0.649525,-0.477859,0.591357,0.29432,-0.891659,0.343944,0.176214,-0.92169,0.3455,0.25425,-0.66567,0.701559,0.132786,-0.69451,0.707083,0.526872,0.100711,0.843928,0.117038,0.02237,0.992859,0.184057,-0.314982,0.931059,0.588366,-0.185369,0.787011,0,0,1,0.064882,-0.339335,0.938414,0.918668,0.024293,0.394238,0.889187,0.169988,0.424757,0.86285,0.316294,0.394238,0.478469,0.389355,0.787011,0.835994,0.461715,0.296487,0.427412,0.683798,0.591357,0.054872,0.360668,0.931059,-0.064882,0.339335,0.938414,-0.009217,0.712516,0.701559,-0.132786,0.69451,0.707083,0.368358,0.929655,0,-0.069369,0.997589,0,-0.055361,0.937346,0.343944,0.385632,0.874996,0.292581,-0.18778,0.982208,0,-0.176214,0.92169,0.3455,0.816706,0.557543,0.148625,0.809412,0.587207,0,0.816706,0.557543,-0.148625,0.385632,0.874996,-0.292581,0.835994,0.461715,-0.296487,0.427412,0.683798,-0.591357,-0.055361,0.937346,-0.343944,-0.176214,0.92169,-0.3455,-0.009217,0.712516,-0.701559,-0.132786,0.69451,-0.707083,0,-0.479171,-0.877712,0,-0.089541,-0.995972,0.344859,-0.091403,-0.934172,0.304758,-0.485336,-0.819483,0.70397,-0.093814,-0.70397,0.616291,-0.490249,-0.616291,0,0,-1,0.3455,0,-0.938414,0.707083,0,-0.707083,0.158788,-0.891995,-0.42317,0,-0.890713,-0.454512,0.319254,-0.892239,-0.319254,-0.158788,-0.891995,-0.42317,-0.304758,-0.485336,-0.819483,-0.319254,-0.892239,-0.319254,-0.616291,-0.490249,-0.616291,-0.344859,-0.091403,-0.934172,-0.3455,0,-0.938414,-0.70397,-0.093814,-0.70397,-0.707083,0,-0.707083,0.170782,-0.98529,0,0.180731,-0.98352,0,0.170171,-0.924039,-0.342265,0.160772,-0.925321,-0.343364,0.129429,-0.698599,-0.703696,0.122196,-0.69866,-0.704917,-0.089236,-0.996002,0,-0.078036,-0.950407,-0.301035,-0.04886,-0.759911,-0.648152,0.1507,-0.926603,-0.344462,0.1601,-0.987091,0,0.160924,-0.924863,-0.344523,0.171209,-0.985229,0,0.114475,-0.698721,-0.706137,0.12186,-0.698111,-0.705496,0.1507,-0.926603,0.344462,0.160772,-0.925321,0.343364,0.114475,-0.698721,0.706137,0.122196,-0.69866,0.704917,0.160924,-0.924863,0.344523,0.12186,-0.698111,0.705496,0.170171,-0.924039,0.342265,-0.078036,-0.950407,0.301035,0.129429,-0.698599,0.703696,-0.04886,-0.759911,0.648152,-0.000275,0.000458,0.999969,0.064028,-0.342479,0.937315,0.060396,-0.34199,0.937742,-0.006714,-0.016022,0.999847,-0.012055,-0.401257,0.91586,0.056551,-0.341502,0.938139,-0.000275,0.000488,0.999969,0.059999,-0.342143,0.937712,9.2e-05,-0.001404,0.999969,-0.05887,0.342204,0.937742,-0.062593,0.342631,0.937346,-0.121372,0.698325,0.705374,-0.128758,0.698202,0.704184,-0.060671,0.339152,0.938749,-0.125004,0.695425,0.707602,-0.066195,0.343089,0.936949,-0.051393,0.357433,0.932493,-0.135868,0.69808,0.702963,-0.126255,0.7163,0.686239,-0.182775,0.983154,0,-0.192419,0.981292,0,-0.180456,0.922208,0.341929,-0.171331,0.923551,0.343028,-0.198675,0.980041,0,-0.18189,0.927366,0.326884,-0.161809,0.924863,0.344127,-0.172735,0.984954,0,-0.16654,0.92346,0.345592,-0.177679,0.984069,0,-0.161809,0.924863,-0.344127,-0.171331,0.923551,-0.343028,-0.121372,0.698325,-0.705374,-0.128758,0.698202,-0.704184,-0.16654,0.92346,-0.345592,-0.125004,0.695425,-0.707602,-0.180456,0.922208,-0.341929,-0.18189,0.927366,-0.326884,-0.135868,0.69808,-0.702963,-0.126255,0.7163,-0.686239,0.064882,-0.339335,-0.938414,0.059999,-0.342143,-0.937712,9.2e-05,-0.001404,-0.999969,-0.064882,0.339335,-0.938414,-0.060671,0.339152,-0.938749,-0.000275,0.000458,-0.999969,-0.000275,0.000488,-0.999969,0.056551,-0.341502,-0.938139,0.060396,-0.34199,-0.937742,0.064028,-0.342479,-0.937315,-0.012055,-0.401257,-0.91586,-0.006714,-0.016022,-0.999847,-0.066195,0.343089,-0.936949,-0.062593,0.342631,-0.937346,-0.051393,0.357433,-0.932493,-0.05887,0.342204,-0.937742,0.68572,-0.727836,0,0.966521,0.256508,0,0.936674,0.210974,-0.279458,0.642933,-0.685507,-0.341563,0.750572,0.089145,-0.654683,0.48265,-0.5103,-0.711753,0.966399,0.256996,0,0.923063,0.235786,-0.303842,0.737754,0.168645,-0.653645,-0.161382,-0.953887,-0.253029,-0.201849,-0.9794,0,-0.053346,-0.783898,-0.61858,-0.161382,-0.953887,0.253029,0.642933,-0.685507,0.341563,-0.053346,-0.783898,0.61858,0.48265,-0.5103,0.711753,0.936674,0.210974,0.279458,0.923063,0.235786,0.303842,0.750572,0.089145,0.654683,0.737754,0.168645,0.653645,-0.033204,0.035768,0.998779,-0.029756,0.007691,0.999512,0.369121,-0.007233,0.929319,0.238044,-0.238777,0.941435,0.009857,0.007752,0.999908,0.387036,0.070009,0.919401,0.029878,-0.397046,0.917295,-0.007111,0.022523,0.999695,-0.127476,0.400342,0.907437,-0.31785,0.303568,0.89819,-0.271401,0.720878,0.637684,-0.573229,0.535112,0.620502,-0.405591,0.095676,0.908994,-0.363048,-0.001373,0.93173,-0.738853,0.20539,0.641774,-0.727744,0.019654,0.685537,-0.73455,0.678518,0,-0.956084,0.293069,0,-0.914457,0.273721,0.297952,-0.70397,0.651692,0.282205,-0.998718,0.050508,0,-0.943968,0.042238,0.32725,-0.35905,0.885433,0.295022,-0.383251,0.923612,0,-0.35905,0.885433,-0.295022,-0.70397,0.651692,-0.282205,-0.271401,0.720878,-0.637684,-0.573229,0.535112,-0.620502,-0.914457,0.273721,-0.297952,-0.943968,0.042238,-0.32725,-0.738853,0.20539,-0.641774,-0.727744,0.019654,-0.685537,-0.033204,0.035768,-0.998779,-0.007111,0.022523,-0.999695,0.029878,-0.397046,-0.917295,0.238044,-0.238777,-0.941435,0.369121,-0.007233,-0.929319,-0.029756,0.007691,-0.999512,0.387036,0.070009,-0.919401,0.009857,0.007752,-0.999908,-0.405591,0.095676,-0.908994,-0.31785,0.303568,-0.89819,-0.363048,-0.001373,-0.93173,-0.127476,0.400342,-0.907437,0.999878,0.013703,0,0.999725,0.022126,0,0.938536,0.020417,-0.344493,0.939055,0.012513,-0.343455,0.707877,0.014679,-0.706137,0.709128,0.008698,-0.705008,0.999908,0.013092,0,0.938627,0.012116,-0.344707,0.708335,0.00882,-0.705802,0.939512,0.004181,-0.342418,0.999969,0.004822,0,0.710318,0.002411,-0.703848,0.939512,0.004181,0.342418,0.939055,0.012513,0.343455,0.710318,0.002411,0.703848,0.709128,0.008698,0.705008,0.938536,0.020417,0.344493,0.938627,0.012116,0.344707,0.707877,0.014679,0.706137,0.708304,0.00882,0.705802,-0.000427,0.000183,0.999969,-0.000427,0.000153,0.999969,0.346141,0.006653,0.938139,0.347209,0.003723,0.937773,0.001068,9.2e-05,0.999969,0.346965,0.004059,0.937834,0.348277,0.000641,0.937376,-0.000458,0.000183,0.999969,-0.349193,0.001343,0.93704,-0.348125,-0.00177,0.937437,-0.710959,0.003815,0.703177,-0.709799,-0.002533,0.704367,-0.347026,-0.004761,0.937834,-0.344798,-0.003082,0.938658,-0.708579,-0.008667,0.705557,-0.706748,-0.005799,0.707419,-0.999969,-0.002228,0,-0.999939,-0.010865,0,-0.93881,-0.010529,0.344249,-0.939238,-0.002411,0.343181,-0.999969,-0.007569,0,-0.938353,-0.007263,0.3455,-0.939604,0.006012,0.342112,-0.999969,0.006745,0,-0.939604,0.006012,-0.342112,-0.939238,-0.002411,-0.343181,-0.710959,0.003815,-0.703177,-0.709799,-0.002533,-0.704367,-0.93881,-0.010529,-0.344249,-0.938353,-0.007263,-0.3455,-0.708579,-0.008667,-0.705557,-0.706748,-0.005799,-0.707419,-0.000427,0.000183,-0.999969,-0.000458,0.000183,-0.999969,0.348277,0.000641,-0.937376,0.347209,0.003723,-0.937773,0.346141,0.006653,-0.938139,-0.000427,0.000153,-0.999969,0.346965,0.004059,-0.937834,0.001068,9.2e-05,-0.999969,-0.347026,-0.004761,-0.937834,-0.348125,-0.00177,-0.937437,-0.344798,-0.003082,-0.938658,-0.349193,0.001343,-0.93704,1,0,0,0.938414,0,-0.3455,0.938414,0,0.3455,0.707083,0,0.707083,0.3455,0,0.938414,0,0,0.999969,-0.3455,0,0.938414,-0.707083,0,0.707083,-0.999969,0,0,-0.938414,0,0.3455,-1,0,0,-0.938414,0,-0.3455,0.877712,-0.479171,0,0.454512,-0.890713,0,0.42317,-0.891995,-0.158788,0.819483,-0.485336,-0.304758,0.934172,-0.091403,-0.344859,0.995972,-0.089541,0,0.934172,-0.091403,0.344859,0.819483,-0.485336,0.304758,0.70397,-0.093814,0.70397,0.616291,-0.490249,0.616291,0.42317,-0.891995,0.158788,0.319254,-0.892239,0.319254,0,-0.479171,0.877712,0,-0.890713,0.454543,0.158788,-0.891995,0.42317,0.304758,-0.485336,0.819483,0.344859,-0.091403,0.934172,0,-0.089541,0.995972,-0.344859,-0.091403,0.934172,-0.304758,-0.485336,0.819483,-0.70397,-0.093814,0.70397,-0.616291,-0.490249,0.616291,-0.158788,-0.891995,0.42317,-0.319254,-0.892239,0.319254,-0.877712,-0.479171,0,-0.454512,-0.890713,0,-0.42317,-0.891995,0.158788,-0.819483,-0.485336,0.304758,-0.934172,-0.091403,0.344859,-0.995972,-0.089541,0,-0.934172,-0.091403,-0.344859,-0.819453,-0.485336,-0.304758,-0.42317,-0.891995,-0.158788,0.526872,0.100711,-0.843928,0.889187,0.169988,-0.424757,0.918668,0.024293,-0.394238,0.588366,-0.1854,-0.787011,0.184057,-0.314982,-0.931059,0.117038,0.02237,-0.992859,0.054872,0.360668,-0.931059,0.478469,0.389355,-0.787011,0.86285,0.316294,-0.394238], 41 | 42 | "colors" : [], 43 | 44 | "uvs" : [], 45 | 46 | "faces" : [35,0,4,5,1,0,0,1,2,3,35,1,5,270,271,0,3,2,4,5,35,4,274,273,5,0,1,6,7,2,35,5,273,450,270,0,2,7,8,4,35,0,1,6,2,0,0,3,9,10,35,2,6,279,280,0,10,9,11,12,35,1,271,272,6,0,3,5,13,9,35,6,272,451,279,0,9,13,14,11,35,0,2,7,3,0,0,10,15,16,35,3,7,285,286,0,16,15,17,18,35,2,280,281,7,0,10,12,19,15,35,7,281,452,285,0,15,19,20,17,35,0,3,8,4,0,0,16,21,1,35,4,8,275,274,0,1,21,22,6,35,3,286,287,8,0,16,18,23,21,35,8,287,453,275,0,21,23,24,22,35,9,13,14,10,0,25,26,27,28,35,10,14,297,298,0,28,27,29,30,35,13,295,294,14,0,26,31,32,27,35,14,294,454,297,0,27,32,33,29,35,9,10,15,11,0,25,28,34,35,35,11,15,305,304,0,35,34,36,37,35,10,298,299,15,0,28,30,38,34,35,15,299,457,305,0,34,38,39,36,35,9,11,16,12,0,25,35,40,41,35,12,16,302,301,0,41,40,42,43,35,11,304,303,16,0,35,37,44,40,35,16,303,456,302,0,40,44,45,42,35,9,12,17,13,0,25,41,46,26,35,13,17,296,295,0,26,46,47,31,35,12,301,300,17,0,41,43,48,46,35,17,300,455,296,0,46,48,49,47,35,18,22,23,19,0,50,51,52,53,35,19,23,276,277,0,53,52,54,55,35,22,439,438,23,0,51,56,57,52,35,23,438,478,276,0,52,57,58,54,35,18,19,24,20,0,50,53,59,60,35,20,24,294,295,0,60,59,32,31,35,19,277,278,24,0,53,55,61,59,35,24,278,454,294,0,59,61,33,32,35,18,20,25,21,0,50,60,62,63,35,21,25,284,283,0,63,62,64,65,35,20,295,296,25,0,60,31,47,62,35,25,296,455,284,0,62,47,49,64,35,18,21,26,22,0,50,63,66,51,35,22,26,440,439,0,51,66,67,56,35,21,283,282,26,0,63,65,68,66,35,26,282,479,440,0,66,68,69,67,35,27,31,32,28,0,70,71,72,73,35,28,32,282,283,0,73,72,68,65,35,31,442,441,32,0,71,74,75,72,35,32,441,479,282,0,72,75,69,68,35,27,28,33,29,0,70,73,76,77,35,29,33,300,301,0,77,76,48,43,35,28,283,284,33,0,73,65,64,76,35,33,284,455,300,0,76,64,49,48,35,27,29,34,30,0,70,77,78,79,35,30,34,290,289,0,79,78,80,81,35,29,301,302,34,0,77,43,42,78,35,34,302,456,290,0,78,42,45,80,35,27,30,35,31,0,70,79,82,71,35,31,35,443,442,0,71,82,83,74,35,30,289,288,35,0,79,81,84,82,35,35,288,480,443,0,82,84,85,83,35,36,40,41,37,0,86,87,88,89,35,37,41,288,289,0,89,88,84,81,35,40,445,444,41,0,87,90,91,88,35,41,444,480,288,0,88,91,85,84,35,36,37,42,38,0,86,89,92,93,35,38,42,303,304,0,93,92,44,37,35,37,289,290,42,0,89,81,80,92,35,42,290,456,303,0,92,80,45,44,35,36,38,43,39,0,86,93,94,95,35,39,43,293,292,0,95,94,96,97,35,38,304,305,43,0,93,37,36,94,35,43,305,457,293,0,94,36,39,96,35,36,39,44,40,0,86,95,98,87,35,40,44,446,445,0,87,98,99,90,35,39,292,291,44,0,95,97,100,98,35,44,291,481,446,0,98,100,101,99,35,45,49,50,46,0,102,103,104,105,35,46,50,306,307,0,105,104,106,107,35,49,415,414,50,0,103,108,109,104,35,50,414,474,306,0,104,109,110,106,35,45,46,51,47,0,102,105,111,112,35,47,51,273,274,0,112,111,7,6,35,46,307,308,51,0,105,107,113,111,35,51,308,450,273,0,111,113,8,7,35,45,47,52,48,0,102,112,114,115,35,48,52,317,316,0,115,114,116,117,35,47,274,275,52,0,112,6,22,114,35,52,275,453,317,0,114,22,24,116,35,45,48,53,49,0,102,115,118,103,35,49,53,416,415,0,103,118,119,108,35,48,316,315,53,0,115,117,120,118,35,53,315,477,416,0,118,120,121,119,35,54,58,59,55,0,122,123,124,125,35,55,59,330,331,0,125,124,126,127,35,58,346,345,59,0,123,128,129,124,35,59,345,462,330,0,124,129,130,126,35,54,55,60,56,0,122,125,131,132,35,56,60,318,319,0,132,131,133,134,35,55,331,332,60,0,125,127,135,131,35,60,332,458,318,0,131,135,136,133,35,54,56,61,57,0,122,132,137,138,35,57,61,335,334,0,138,137,139,140,35,56,319,320,61,0,132,134,141,137,35,61,320,459,335,0,137,141,142,139,35,54,57,62,58,0,122,138,143,123,35,58,62,347,346,0,123,143,144,128,35,57,334,333,62,0,138,140,145,143,35,62,333,463,347,0,143,145,146,144,35,63,67,68,64,0,147,147,148,149,35,64,68,333,334,0,149,148,145,140,35,67,349,348,68,0,147,150,151,148,35,68,348,463,333,0,148,151,146,145,35,63,64,69,65,0,147,149,152,153,35,65,69,321,322,0,153,152,154,155,35,64,334,335,69,0,149,140,139,152,35,69,335,459,321,0,152,139,142,154,35,63,65,70,66,0,147,153,156,157,35,66,70,338,337,0,157,156,158,159,35,65,322,323,70,0,153,155,160,156,35,70,323,460,338,0,156,160,161,158,35,63,66,71,67,0,147,157,162,147,35,67,71,350,349,0,147,162,163,150,35,66,337,336,71,0,157,159,164,162,35,71,336,464,350,0,162,164,165,163,35,72,76,77,73,0,166,167,168,169,35,73,77,336,337,0,169,168,164,159,35,76,352,351,77,0,167,170,171,168,35,77,351,464,336,0,168,171,165,164,35,72,73,78,74,0,166,169,172,173,35,74,78,324,325,0,173,172,174,175,35,73,337,338,78,0,169,159,158,172,35,78,338,460,324,0,172,158,161,174,35,72,74,79,75,0,166,173,176,177,35,75,79,341,340,0,177,176,178,179,35,74,325,326,79,0,173,175,180,176,35,79,326,461,341,0,176,180,181,178,35,72,75,80,76,0,166,177,182,167,35,76,80,353,352,0,167,182,183,170,35,75,340,339,80,0,177,179,184,182,35,80,339,465,353,0,182,184,185,183,35,81,85,86,82,0,108,108,186,186,35,82,86,426,427,0,186,186,58,58,35,85,448,447,86,0,108,108,186,186,35,86,447,478,426,0,186,186,58,58,35,81,82,87,83,0,108,186,186,108,35,83,87,327,328,0,108,186,187,188,35,82,427,428,87,0,186,58,58,186,35,87,428,458,327,0,186,58,136,187,35,81,83,88,84,0,108,108,189,189,35,84,88,437,436,0,189,189,101,101,35,83,328,329,88,0,108,188,190,189,35,88,329,461,437,0,189,190,181,101,35,81,84,89,85,0,108,189,189,108,35,85,89,449,448,0,108,189,189,108,35,84,436,435,89,0,189,101,101,189,35,89,435,481,449,0,189,101,101,189,35,90,94,95,91,0,191,192,193,194,35,91,95,332,331,0,194,193,135,127,35,94,328,327,95,0,192,188,187,193,35,95,327,458,332,0,193,187,136,135,35,90,91,96,92,0,191,194,195,191,35,92,96,342,343,0,191,195,196,197,35,91,331,330,96,0,194,127,126,195,35,96,330,462,342,0,195,126,130,196,35,90,92,97,93,0,191,191,198,199,35,93,97,339,340,0,199,198,184,179,35,92,343,344,97,0,191,197,200,198,35,97,344,465,339,0,198,200,185,184,35,90,93,98,94,0,191,199,201,192,35,94,98,329,328,0,192,201,190,188,35,93,340,341,98,0,199,179,178,201,35,98,341,461,329,0,201,178,181,190,35,99,103,104,100,0,202,203,204,205,35,100,104,354,355,0,205,204,206,207,35,103,370,369,104,0,203,208,209,204,35,104,369,466,354,0,204,209,210,206,35,99,100,105,101,0,202,205,211,212,35,101,105,345,346,0,212,211,129,128,35,100,355,356,105,0,205,207,213,211,35,105,356,462,345,0,211,213,130,129,35,99,101,106,102,0,202,212,214,215,35,102,106,359,358,0,215,214,216,217,35,101,346,347,106,0,212,128,144,214,35,106,347,463,359,0,214,144,146,216,35,99,102,107,103,0,202,215,218,203,35,103,107,371,370,0,203,218,219,208,35,102,358,357,107,0,215,217,220,218,35,107,357,467,371,0,218,220,221,219,35,108,112,113,109,0,222,223,224,225,35,109,113,357,358,0,225,224,220,217,35,112,373,372,113,0,223,226,227,224,35,113,372,467,357,0,224,227,221,220,35,108,109,114,110,0,222,225,228,229,35,110,114,348,349,0,229,228,151,150,35,109,358,359,114,0,225,217,216,228,35,114,359,463,348,0,228,216,146,151,35,108,110,115,111,0,222,229,230,231,35,111,115,362,361,0,231,230,232,233,35,110,349,350,115,0,229,150,163,230,35,115,350,464,362,0,230,163,165,232,35,108,111,116,112,0,222,231,234,223,35,112,116,374,373,0,223,234,235,226,35,111,361,360,116,0,231,233,236,234,35,116,360,468,374,0,234,236,237,235,35,117,121,122,118,0,238,239,240,241,35,118,122,360,361,0,241,240,236,233,35,121,376,375,122,0,239,242,243,240,35,122,375,468,360,0,240,243,237,236,35,117,118,123,119,0,238,241,244,245,35,119,123,351,352,0,245,244,171,170,35,118,361,362,123,0,241,233,232,244,35,123,362,464,351,0,244,232,165,171,35,117,119,124,120,0,238,245,246,247,35,120,124,365,364,0,247,246,248,249,35,119,352,353,124,0,245,170,183,246,35,124,353,465,365,0,246,183,185,248,35,117,120,125,121,0,238,247,250,239,35,121,125,377,376,0,239,250,251,242,35,120,364,363,125,0,247,249,252,250,35,125,363,469,377,0,250,252,253,251,35,126,130,131,127,0,254,255,256,257,35,127,131,356,355,0,257,256,213,207,35,130,343,342,131,0,255,197,196,256,35,131,342,462,356,0,256,196,130,213,35,126,127,132,128,0,254,257,258,259,35,128,132,366,367,0,259,258,260,261,35,127,355,354,132,0,257,207,206,258,35,132,354,466,366,0,258,206,210,260,35,126,128,133,129,0,254,259,262,263,35,129,133,363,364,0,263,262,252,249,35,128,367,368,133,0,259,261,264,262,35,133,368,469,363,0,262,264,253,252,35,126,129,134,130,0,254,263,265,255,35,130,134,344,343,0,255,265,200,197,35,129,364,365,134,0,263,249,248,265,35,134,365,465,344,0,265,248,185,200,35,135,139,140,136,0,266,267,268,269,35,136,140,378,379,0,269,268,270,271,35,139,394,393,140,0,267,272,273,268,35,140,393,470,378,0,268,273,274,270,35,135,136,141,137,0,266,269,275,276,35,137,141,369,370,0,276,275,209,208,35,136,379,380,141,0,269,271,277,275,35,141,380,466,369,0,275,277,210,209,35,135,137,142,138,0,266,276,278,279,35,138,142,383,382,0,279,278,280,281,35,137,370,371,142,0,276,208,219,278,35,142,371,467,383,0,278,219,221,280,35,135,138,143,139,0,266,279,282,267,35,139,143,395,394,0,267,282,283,272,35,138,382,381,143,0,279,281,284,282,35,143,381,471,395,0,282,284,285,283,35,144,148,149,145,0,286,287,288,289,35,145,149,381,382,0,289,288,284,281,35,148,397,396,149,0,287,290,291,288,35,149,396,471,381,0,288,291,285,284,35,144,145,150,146,0,286,289,292,293,35,146,150,372,373,0,293,292,227,226,35,145,382,383,150,0,289,281,280,292,35,150,383,467,372,0,292,280,221,227,35,144,146,151,147,0,286,293,294,295,35,147,151,386,385,0,295,294,296,297,35,146,373,374,151,0,293,226,235,294,35,151,374,468,386,0,294,235,237,296,35,144,147,152,148,0,286,295,298,287,35,148,152,398,397,0,287,298,299,290,35,147,385,384,152,0,295,297,300,298,35,152,384,472,398,0,298,300,301,299,35,153,157,158,154,0,302,303,304,305,35,154,158,384,385,0,305,304,300,297,35,157,400,399,158,0,303,306,307,304,35,158,399,472,384,0,304,307,301,300,35,153,154,159,155,0,302,305,308,309,35,155,159,375,376,0,309,308,243,242,35,154,385,386,159,0,305,297,296,308,35,159,386,468,375,0,308,296,237,243,35,153,155,160,156,0,302,309,310,311,35,156,160,389,388,0,311,310,312,313,35,155,376,377,160,0,309,242,251,310,35,160,377,469,389,0,310,251,253,312,35,153,156,161,157,0,302,311,314,303,35,157,161,401,400,0,303,314,315,306,35,156,388,387,161,0,311,313,316,314,35,161,387,473,401,0,314,316,317,315,35,162,166,167,163,0,318,319,320,321,35,163,167,380,379,0,321,320,277,271,35,166,367,366,167,0,319,261,260,320,35,167,366,466,380,0,320,260,210,277,35,162,163,168,164,0,318,321,322,323,35,164,168,390,391,0,323,322,324,325,35,163,379,378,168,0,321,271,270,322,35,168,378,470,390,0,322,270,274,324,35,162,164,169,165,0,318,323,326,327,35,165,169,387,388,0,327,326,316,313,35,164,391,392,169,0,323,325,328,326,35,169,392,473,387,0,326,328,317,316,35,162,165,170,166,0,318,327,329,319,35,166,170,368,367,0,319,329,264,261,35,165,388,389,170,0,327,313,312,329,35,170,389,469,368,0,329,312,253,264,35,171,175,176,172,0,330,330,331,331,35,172,176,402,403,0,331,331,110,110,35,175,418,417,176,0,330,330,331,331,35,176,417,474,402,0,331,331,110,110,35,171,172,177,173,0,330,331,331,330,35,173,177,393,394,0,330,331,273,272,35,172,403,404,177,0,331,110,110,331,35,177,404,470,393,0,331,110,274,273,35,171,173,178,174,0,330,330,332,332,35,174,178,407,406,0,332,332,333,333,35,173,394,395,178,0,330,272,283,332,35,178,395,471,407,0,332,283,285,333,35,171,174,179,175,0,330,332,332,330,35,175,179,419,418,0,330,332,332,330,35,174,406,405,179,0,332,333,333,332,35,179,405,475,419,0,332,333,333,332,35,180,184,185,181,0,74,74,334,334,35,181,185,405,406,0,334,334,333,333,35,184,421,420,185,0,74,74,334,334,35,185,420,475,405,0,334,334,333,333,35,180,181,186,182,0,74,334,334,335,35,182,186,396,397,0,335,334,291,290,35,181,406,407,186,0,334,333,333,334,35,186,407,471,396,0,334,333,285,291,35,180,182,187,183,0,74,335,336,336,35,183,187,410,409,0,336,336,337,337,35,182,397,398,187,0,335,290,299,336,35,187,398,472,410,0,336,299,301,337,35,180,183,188,184,0,74,336,336,74,35,184,188,422,421,0,74,336,336,74,35,183,409,408,188,0,336,337,337,336,35,188,408,476,422,0,336,337,337,336,35,189,193,194,190,0,338,338,339,339,35,190,194,408,409,0,339,339,337,337,35,193,424,423,194,0,338,340,339,339,35,194,423,476,408,0,339,339,337,337,35,189,190,195,191,0,338,339,339,340,35,191,195,399,400,0,340,339,307,306,35,190,409,410,195,0,339,337,337,339,35,195,410,472,399,0,339,337,301,307,35,189,191,196,192,0,338,340,341,341,35,192,196,413,412,0,341,341,121,121,35,191,400,401,196,0,340,306,315,341,35,196,401,473,413,0,341,315,317,121,35,189,192,197,193,0,338,341,341,338,35,193,197,425,424,0,338,341,341,340,35,192,412,411,197,0,341,121,121,341,35,197,411,477,425,0,341,121,121,341,35,198,202,203,199,0,108,108,109,109,35,199,203,404,403,0,109,109,110,110,35,202,391,390,203,0,108,325,324,109,35,203,390,470,404,0,109,324,274,110,35,198,199,204,200,0,108,109,109,108,35,200,204,414,415,0,108,109,109,108,35,199,403,402,204,0,109,110,110,109,35,204,402,474,414,0,109,110,110,109,35,198,200,205,201,0,108,108,119,119,35,201,205,411,412,0,119,119,121,121,35,200,415,416,205,0,108,108,119,119,35,205,416,477,411,0,119,119,121,121,35,198,201,206,202,0,108,119,119,108,35,202,206,392,391,0,108,119,328,325,35,201,412,413,206,0,119,121,121,119,35,206,413,473,392,0,119,121,317,328,35,207,211,212,208,0,342,343,344,345,35,208,212,308,307,0,345,344,113,107,35,211,271,270,212,0,343,5,4,344,35,212,270,450,308,0,344,4,8,113,35,207,208,213,209,0,342,345,346,347,35,209,213,417,418,0,347,346,331,330,35,208,307,306,213,0,345,107,106,346,35,213,306,474,417,0,346,106,110,331,35,207,209,214,210,0,342,347,348,349,35,210,214,309,310,0,349,348,350,351,35,209,418,419,214,0,347,330,332,348,35,214,419,475,309,0,348,332,333,350,35,207,210,215,211,0,342,349,352,343,35,211,215,272,271,0,343,352,13,5,35,210,310,311,215,0,349,351,353,352,35,215,311,451,272,0,352,353,14,13,35,216,220,221,217,0,354,355,356,357,35,217,221,311,310,0,357,356,353,351,35,220,280,279,221,0,355,12,11,356,35,221,279,451,311,0,356,11,14,353,35,216,217,222,218,0,354,357,358,359,35,218,222,420,421,0,359,358,334,74,35,217,310,309,222,0,357,351,350,358,35,222,309,475,420,0,358,350,333,334,35,216,218,223,219,0,354,359,360,361,35,219,223,312,313,0,361,360,362,363,35,218,421,422,223,0,359,74,336,360,35,223,422,476,312,0,360,336,337,362,35,216,219,224,220,0,354,361,364,355,35,220,224,281,280,0,355,364,19,12,35,219,313,314,224,0,361,363,365,364,35,224,314,452,281,0,364,365,20,19,35,225,229,230,226,0,366,367,368,369,35,226,230,314,313,0,369,368,365,363,35,229,286,285,230,0,367,18,17,368,35,230,285,452,314,0,368,17,20,365,35,225,226,231,227,0,366,369,370,371,35,227,231,423,424,0,371,370,339,340,35,226,313,312,231,0,369,363,362,370,35,231,312,476,423,0,370,362,337,339,35,225,227,232,228,0,366,371,372,373,35,228,232,315,316,0,373,372,120,117,35,227,424,425,232,0,371,340,341,372,35,232,425,477,315,0,372,341,121,120,35,225,228,233,229,0,366,373,374,367,35,229,233,287,286,0,367,374,23,18,35,228,316,317,233,0,373,117,116,374,35,233,317,453,287,0,374,116,24,23,35,234,238,239,235,0,56,56,57,57,35,235,239,428,427,0,57,57,58,58,35,238,319,318,239,0,56,134,133,57,35,239,318,458,428,0,57,133,136,58,35,234,235,240,236,0,56,57,57,56,35,236,240,438,439,0,56,57,57,56,35,235,427,426,240,0,57,58,58,57,35,240,426,478,438,0,57,58,58,57,35,234,236,241,237,0,56,56,67,67,35,237,241,429,430,0,67,67,69,69,35,236,439,440,241,0,56,56,67,67,35,241,440,479,429,0,67,67,69,69,35,234,237,242,238,0,56,67,67,56,35,238,242,320,319,0,56,67,141,134,35,237,430,431,242,0,67,69,69,67,35,242,431,459,320,0,67,69,142,141,35,243,247,248,244,0,74,74,75,75,35,244,248,431,430,0,75,75,69,69,35,247,322,321,248,0,74,155,154,75,35,248,321,459,431,0,75,154,142,69,35,243,244,249,245,0,74,75,75,74,35,245,249,441,442,0,74,75,75,74,35,244,430,429,249,0,75,69,69,75,35,249,429,479,441,0,75,69,69,75,35,243,245,250,246,0,74,74,83,83,35,246,250,432,433,0,83,83,85,85,35,245,442,443,250,0,74,74,83,83,35,250,443,480,432,0,83,83,85,85,35,243,246,251,247,0,74,83,83,74,35,247,251,323,322,0,74,83,160,155,35,246,433,434,251,0,83,85,85,83,35,251,434,460,323,0,83,85,161,160,35,252,256,257,253,0,90,90,91,91,35,253,257,434,433,0,91,91,85,85,35,256,325,324,257,0,90,175,174,91,35,257,324,460,434,0,91,174,161,85,35,252,253,258,254,0,90,91,91,90,35,254,258,444,445,0,90,91,91,90,35,253,433,432,258,0,91,85,85,91,35,258,432,480,444,0,91,85,85,91,35,252,254,259,255,0,90,90,99,99,35,255,259,435,436,0,99,99,101,101,35,254,445,446,259,0,90,90,99,99,35,259,446,481,435,0,99,99,101,101,35,252,255,260,256,0,90,99,99,90,35,256,260,326,325,0,90,99,180,175,35,255,436,437,260,0,99,101,101,99,35,260,437,461,326,0,99,101,181,180,35,261,265,266,262,0,375,376,377,378,35,262,266,278,277,0,378,377,61,55,35,265,298,297,266,0,376,30,29,377,35,266,297,454,278,0,377,29,33,61,35,261,262,267,263,0,375,378,379,380,35,263,267,447,448,0,380,379,186,108,35,262,277,276,267,0,378,55,54,379,35,267,276,478,447,0,379,54,58,186,35,261,263,268,264,0,375,380,381,382,35,264,268,291,292,0,382,381,100,97,35,263,448,449,268,0,380,108,189,381,35,268,449,481,291,0,381,189,101,100,35,261,264,269,265,0,375,382,383,376,35,265,269,299,298,0,376,383,38,30,35,264,292,293,269,0,382,97,96,383,35,269,293,457,299,0,383,96,39,38], 47 | 48 | "bones" : [{"parent":-1,"name":"BoneRoot","pos":[0,-5.7313,-0],"rotq":[0,0,0,1]},{"parent":0,"name":"Bone2","pos":[0,0.268702,-0],"rotq":[0,0,0,1]}], 49 | 50 | "skinIndices" : [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,1,0,0,1,0,1,0,1,1,0,1,0,0,1,0,1,0,1,1,0,0,1,0,1,0,1,1,0,1,0,0,1,0,1,0,1,1,0,0,1,0,1,0,1,1,0,1,0,0,1,0,1,0,1,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0], 51 | 52 | "skinWeights" : [0.999973,0,0.999973,0,0.999973,0,0.999973,0,0.999973,0,0.999972,0,0.999973,0,0.999972,0,0.999973,0,0.999919,0,0.999919,0,0.999919,0,0.999919,0,0.999919,0,0.999918,0,0.999919,0,0.999918,0,0.999919,0,0.999874,0,0.999873,0,0.999896,0,0.999875,0,0.999852,0,0.999851,0,0.999895,0,0.999897,0,0.999852,0,0.999874,0,0.999875,0,0.999896,0,0.999874,0,0.999852,0,0.999852,0,0.999897,0,0.999896,0,0.999852,0,0.999875,0,0.999874,0,0.999897,0,0.999875,0,0.999852,0,0.999852,0,0.999896,0,0.999898,0,0.999853,0,0.999946,0,0.999946,0,0.99996,0,0.999947,0,0.999933,0,0.999933,0,0.999959,0,0.99996,0,0.999934,0,0.981908,0.00967618,0.981908,0.00967618,0.9902,0.00483809,0.981908,0.00967619,0.973616,0.0145143,0.973616,0.0145143,0.9902,0.00483809,0.9902,0.00483809,0.973616,0.0145143,0.981908,0.00967618,0.981908,0.00967618,0.9902,0.00483809,0.981908,0.00967618,0.973616,0.0145143,0.973616,0.0145143,0.9902,0.00483809,0.9902,0.00483809,0.973616,0.0145143,0.981908,0.00967617,0.981908,0.00967617,0.9902,0.00483809,0.981908,0.00967617,0.973616,0.0145143,0.973616,0.0145143,0.9902,0.00483809,0.9902,0.00483808,0.973616,0.0145143,0.999161,0,0.999161,0,0.998827,0,0.999161,0,0.999496,0,0.999495,0,0.998827,0,0.998827,0,0.999496,0,0.981908,0.00967618,0.981908,0.00967618,0.973616,0.0145143,0.981908,0.00967617,0.9902,0.00483809,0.9902,0.00483809,0.973616,0.0145143,0.973616,0.0145143,0.9902,0.00483809,0.492571,0.491872,0.492571,0.491872,0.728598,0.255962,0.492571,0.491872,0.72918,0.255147,0.72918,0.255147,0.728598,0.255962,0.728598,0.255962,0.72918,0.255147,0.492571,0.491872,0.492571,0.491872,0.728598,0.255962,0.492571,0.491872,0.72918,0.255147,0.72918,0.255147,0.728598,0.255962,0.728598,0.255962,0.72918,0.255147,0.492571,0.491872,0.492571,0.491872,0.728598,0.255962,0.492571,0.491872,0.72918,0.255147,0.72918,0.255147,0.728598,0.255962,0.728598,0.255962,0.72918,0.255147,0.492571,0.491872,0.492571,0.491872,0.72918,0.255147,0.492571,0.491872,0.728598,0.255962,0.728598,0.255962,0.72918,0.255147,0.72918,0.255147,0.728598,0.255962,0.982264,0.00921045,0.982264,0.00921045,0.974027,0.0138157,0.982264,0.00921045,0.990502,0.00460522,0.990502,0.00460522,0.974027,0.0138157,0.974027,0.0138157,0.990502,0.00460523,0.982265,0.00921045,0.982265,0.00921045,0.974027,0.0138157,0.982264,0.00921045,0.990502,0.00460523,0.990502,0.00460523,0.974027,0.0138157,0.974027,0.0138157,0.990502,0.00460522,0.982264,0.00921044,0.982264,0.00921044,0.974027,0.0138157,0.982264,0.00921044,0.990502,0.00460522,0.990502,0.00460522,0.974027,0.0138157,0.974027,0.0138157,0.990502,0.00460522,0.982264,0.00921044,0.982264,0.00921044,0.990502,0.00460522,0.982264,0.00921044,0.974027,0.0138157,0.974027,0.0138157,0.990502,0.00460522,0.990502,0.00460522,0.974027,0.0138157,0.99933,0,0.99933,0,0.999035,0,0.99933,0,0.999625,0,0.999625,0,0.999035,0,0.999035,0,0.999625,0,0.99933,0,0.99933,0,0.999035,0,0.99933,0,0.999625,0,0.999625,0,0.999035,0,0.999035,0,0.999625,0,0.99933,0,0.99933,0,0.999035,0,0.99933,0,0.999625,0,0.999625,0,0.999035,0,0.999035,0,0.999625,0,0.99933,0,0.99933,0,0.999625,0,0.99933,0,0.999035,0,0.999035,0,0.999625,0,0.999625,0,0.999035,0,0.999947,0,0.999946,0,0.999933,0,0.999947,0,0.99996,0,0.999959,0,0.999933,0,0.999934,0,0.99996,0,0.999946,0,0.999947,0,0.999933,0,0.999946,0,0.99996,0,0.99996,0,0.999934,0,0.999933,0,0.999959,0,0.999946,0,0.999946,0,0.999933,0,0.999947,0,0.99996,0,0.999959,0,0.999933,0,0.999934,0,0.99996,0,0.999161,0,0.999161,0,0.999495,0,0.999161,0,0.998827,0,0.998827,0,0.999495,0,0.999496,0,0.998827,0,0.999161,0,0.999161,0,0.999495,0,0.999161,0,0.998827,0,0.998827,0,0.999496,0,0.999495,0,0.998827,0,0.999161,0,0.999161,0,0.999496,0,0.999162,0,0.998827,0,0.998827,0,0.999496,0,0.999496,0,0.998827,0,0.999874,0,0.999874,0,0.999852,0,0.999875,0,0.999897,0,0.999896,0,0.999852,0,0.999853,0,0.999898,0,0.999972,0,0.999973,0,0.999973,0,0.999972,0,0.999973,0,0.999973,0,0.999851,0,0.999873,0,0.999894,0,0.999973,0,0.999973,0,0.999972,0,0.999853,0,0.999875,0,0.999898,0,0.999972,0,0.999973,0,0.999973,0,0.999851,0,0.999873,0,0.999895,0,0.999853,0,0.999876,0,0.999899,0,0.999917,0,0.999918,0,0.99992,0,0.999918,0,0.999919,0,0.99992,0,0.99992,0,0.999919,0,0.999918,0,0.999918,0,0.999919,0,0.99992,0,0.999933,0,0.999946,0,0.999959,0,0.999934,0,0.999947,0,0.99996,0,0.999933,0,0.999946,0,0.999959,0,0.999934,0,0.999947,0,0.99996,0,0.998492,0,0.998492,0,0.998492,0,0.998492,0,0.998492,0,0.998492,0,0.998492,0,0.998492,0,0.998493,0,0.998492,0,0.998492,0,0.998492,0,0.973616,0.0145143,0.981908,0.00967618,0.9902,0.00483809,0.973616,0.0145143,0.981908,0.00967619,0.9902,0.00483809,0.973616,0.0145143,0.981908,0.00967618,0.9902,0.00483809,0.973616,0.0145143,0.981908,0.00967617,0.9902,0.00483808,0.965324,0.0193524,0.965324,0.0193524,0.965324,0.0193523,0.965324,0.0193524,0.965324,0.0193524,0.965324,0.0193524,0.965324,0.0193524,0.965324,0.0193524,0.965324,0.0193524,0.965324,0.0193523,0.965324,0.0193523,0.965324,0.0193523,0.72918,0.255147,0.492571,0.491872,0.728598,0.255962,0.72918,0.255147,0.492571,0.491872,0.728598,0.255962,0.72918,0.255147,0.492571,0.491872,0.728598,0.255962,0.72918,0.255147,0.492571,0.491872,0.728598,0.255962,0.965789,0.0184209,0.965789,0.0184209,0.965789,0.0184209,0.965789,0.0184209,0.965789,0.0184209,0.965789,0.0184209,0.965789,0.0184209,0.965789,0.0184209,0.965789,0.0184209,0.965789,0.0184209,0.965789,0.0184209,0.965789,0.0184209,0.990502,0.00460522,0.982264,0.00921044,0.974027,0.0138157,0.990502,0.00460523,0.982265,0.00921045,0.974027,0.0138157,0.990502,0.00460522,0.982264,0.00921045,0.974027,0.0138157,0.990502,0.00460522,0.982264,0.00921044,0.974027,0.0138157,0.998739,0,0.998739,0,0.998739,0,0.998739,0,0.998739,0,0.998739,0,0.998739,0,0.99874,0,0.99874,0,0.99874,0,0.99874,0,0.99874,0,0.999625,0,0.99933,0,0.999035,0,0.999625,0,0.99933,0,0.999035,0,0.999625,0,0.99933,0,0.999035,0,0.999625,0,0.99933,0,0.999035,0,0.99992,0,0.99992,0,0.99992,0,0.99992,0,0.99992,0,0.99992,0,0.99992,0,0.99992,0,0.99992,0,0.99992,0,0.99992,0,0.99992,0,0.999495,0,0.999161,0,0.998827,0,0.999496,0,0.999161,0,0.998827,0,0.999495,0,0.999161,0,0.998827,0,0.999496,0,0.999162,0,0.998827,0,0.999829,0,0.99983,0,0.99983,0,0.99983,0,0.99983,0,0.99983,0,0.99983,0,0.99983,0,0.999831,0,0.99983,0,0.99983,0,0.99983,0,0.999972,0,0.999973,0,0.999972,0,0.999973,0,0.999916,0,0.999921,0,0.999916,0,0.999921,0,0.998492,0,0.998492,0,0.998492,0,0.998493,0,0.965324,0.0193524,0.965324,0.0193524,0.965324,0.0193524,0.965324,0.0193523,0.965789,0.0184209,0.965789,0.0184209,0.965789,0.0184209,0.965789,0.0184209,0.998739,0,0.998739,0,0.99874,0,0.99874,0,0.99992,0,0.999921,0,0.99992,0,0.99992,0,0.999829,0,0.99983,0,0.99983,0,0.999831,0], 53 | 54 | "animations" : [] 55 | 56 | 57 | } 58 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "threejs-procedural-animal", 3 | "version": "0.0.1", 4 | "devDependencies": { 5 | "three.js": "*" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var ensureLoop = require('./animation-ensure-loop'); 2 | var AnimalGeometry = require('./AnimalGeometry'); 3 | function Animal(bones) { 4 | this.sway = Math.random() * .2 + .7; 5 | this.speed = Math.random() * .001 + .001; 6 | 7 | var totalLength = 10; 8 | var thickness = .3 + Math.random(); 9 | var subdivisions = 3; 10 | var geom = new AnimalGeometry(thickness, totalLength, thickness, subdivisions, totalLength*subdivisions, subdivisions); 11 | geom.bones = bones; 12 | 13 | var skinWeights = geom.skinWeights = []; 14 | var skinIndices = geom.skinIndices = []; 15 | for (var i = 0; i < geom.vertices.length; i++) { 16 | var rand = geom.vertices[i].y < 0 ? 1 : 0; 17 | skinWeights[i] = new THREE.Vector4(rand, -rand); 18 | skinIndices[i] = new THREE.Vector4(0, 1); 19 | }; 20 | var mat = new THREE.MeshPhongMaterial({ 21 | color: 0xffffff, 22 | shininess: 50, 23 | // shading: THREE.FlatShading, 24 | // wireframe: true, 25 | // side: THREE.DoubleSide, 26 | skinning: true 27 | }); 28 | THREE.SkinnedMesh.call(this, geom, mat); 29 | this.update = this.update.bind(this); 30 | 31 | this.envelopes = []; 32 | for (var i = 0; i < this.skeleton.bones.length; i++) { 33 | var bone = this.skeleton.bones[i]; 34 | // bone.add(new THREE.Mesh(new THREE.SphereGeometry(.5))); 35 | 36 | if(bone.parent !== this) { 37 | var v1 = this.worldToLocal(bone.parent.localToWorld(new THREE.Vector3())); 38 | var v2 = this.worldToLocal(bone.localToWorld(new THREE.Vector3())); 39 | var envelopeLine = new THREE.Line3(v1, v2); 40 | bone.parent.envelope = envelopeLine; 41 | envelopeLine.bone = bone.parent; 42 | envelopeLine.radius = 1.25; 43 | envelopeLine.index = this.skeleton.bones.indexOf(bone.parent); 44 | this.envelopes.push(envelopeLine); 45 | } 46 | }; 47 | 48 | var _this = this; 49 | 50 | function sortDistFromLines(a, b) { 51 | return a.distFromLine - b.distFromLine; 52 | } 53 | function findTheClosestEnvelopes(vert) { 54 | var closest = []; 55 | for (var i = 0; i < _this.envelopes.length; i++) { 56 | var envelope = _this.envelopes[i]; 57 | var closestPointOnLine = envelope.closestPointToPoint(vert, true); 58 | var distFromLine = closestPointOnLine.sub(vert).length(); 59 | closest.push({ 60 | envelope: envelope, 61 | distFromLine: distFromLine 62 | }); 63 | }; 64 | closest.sort(sortDistFromLines); 65 | return closest; 66 | } 67 | 68 | for (var i = 0; i < geom.vertices.length; i++) { 69 | var envelopes = findTheClosestEnvelopes(geom.vertices[i]); 70 | 71 | if(envelopes[0].distFromLine < envelopes[0].envelope.radius && envelopes[1].distFromLine < envelopes[1].envelope.radius) { 72 | skinWeights[i] = new THREE.Vector4(100*(1-(envelopes[0].distFromLine/envelopes[0].envelope.radius)), 100*(1-(envelopes[1].distFromLine/envelopes[1].envelope.radius))); 73 | } else if (envelopes[0].distFromLine / envelopes[0].envelope.radius > envelopes[1].distFromLine / envelopes[1].envelope.radius) { 74 | skinWeights[i] = new THREE.Vector4(0, 100); 75 | } else { 76 | skinWeights[i] = new THREE.Vector4(100, 0); 77 | } 78 | skinIndices[i] = new THREE.Vector4(envelopes[0].envelope.index, envelopes[1].envelope.index); 79 | }; 80 | 81 | } 82 | 83 | Animal.prototype = Object.create(THREE.SkinnedMesh.prototype); 84 | 85 | Animal.prototype.update = function(delta) { 86 | // return; 87 | var time = (new Date).getTime(); 88 | for (var i = 0; i < this.skeleton.bones.length; i++) { 89 | var bone = this.skeleton.bones[i]; 90 | bone.rotation.x = Math.sin(time*this.speed+i*2+Math.PI)*this.sway; 91 | bone.rotation.y = Math.sin(time*this.speed+i*2+Math.PI)*this.sway; 92 | bone.rotation.z = Math.sin(time*this.speed+i*2)*this.sway; 93 | // bone.rotation.x -= 0.02; 94 | }; 95 | } 96 | 97 | module.exports = Animal; -------------------------------------------------------------------------------- /lib/stats.min.js: -------------------------------------------------------------------------------- 1 | // stats.js - http://github.com/mrdoob/stats.js 2 | var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; 3 | i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); 4 | k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= 5 | "block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:11,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= 6 | a+"px",m=b,r=0);return b},update:function(){l=this.end()}}}; 7 | -------------------------------------------------------------------------------- /lib/threex.rendererstats.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author mrdoob / http://mrdoob.com/ 3 | * @author jetienne / http://jetienne.com/ 4 | */ 5 | /** @namespace */ 6 | var THREEx = THREEx || {} 7 | 8 | /** 9 | * provide info on THREE.WebGLRenderer 10 | * 11 | * @param {Object} renderer the renderer to update 12 | * @param {Object} Camera the camera to update 13 | */ 14 | THREEx.RendererStats = function (){ 15 | 16 | var msMin = 100; 17 | var msMax = 0; 18 | 19 | var container = document.createElement( 'div' ); 20 | container.style.cssText = 'width:80px;opacity:0.9;cursor:pointer'; 21 | 22 | var msDiv = document.createElement( 'div' ); 23 | msDiv.style.cssText = 'padding:0 0 3px 3px;text-align:left;background-color:#200;'; 24 | container.appendChild( msDiv ); 25 | 26 | var msText = document.createElement( 'div' ); 27 | msText.style.cssText = 'color:#f00;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px'; 28 | msText.innerHTML= 'WebGLRenderer'; 29 | msDiv.appendChild( msText ); 30 | 31 | var msTexts = []; 32 | var nLines = 9; 33 | for(var i = 0; i < nLines; i++){ 34 | msTexts[i] = document.createElement( 'div' ); 35 | msTexts[i].style.cssText = 'color:#f00;background-color:#311;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px'; 36 | msDiv.appendChild( msTexts[i] ); 37 | msTexts[i].innerHTML= '-'; 38 | } 39 | 40 | 41 | var lastTime = Date.now(); 42 | return { 43 | domElement: container, 44 | 45 | update: function(webGLRenderer){ 46 | // sanity check 47 | console.assert(webGLRenderer instanceof THREE.WebGLRenderer) 48 | 49 | // refresh only 30time per second 50 | if( Date.now() - lastTime < 1000/30 ) return; 51 | lastTime = Date.now() 52 | 53 | var i = 0; 54 | msTexts[i++].textContent = "== Memory ====="; 55 | msTexts[i++].textContent = "Programs: " + webGLRenderer.info.memory.programs; 56 | msTexts[i++].textContent = "Geometries: "+webGLRenderer.info.memory.geometries; 57 | msTexts[i++].textContent = "Textures: " + webGLRenderer.info.memory.textures; 58 | 59 | msTexts[i++].textContent = "== Render ====="; 60 | msTexts[i++].textContent = "Calls: " + webGLRenderer.info.render.calls; 61 | msTexts[i++].textContent = "Vertices: " + webGLRenderer.info.render.vertices; 62 | msTexts[i++].textContent = "Faces: " + webGLRenderer.info.render.faces; 63 | msTexts[i++].textContent = "Points: " + webGLRenderer.info.render.points; 64 | } 65 | } 66 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "threejs-procedural-animal", 3 | "version": "1.0.0", 4 | "description": "An experiment in procedural animal generation using threejs.", 5 | "main": "index.js", 6 | "license": "MIT", 7 | "author": { 8 | "name": "Tomasz Dysinski", 9 | "email": "oz@bunnybones.com", 10 | "url": "https://github.com/bunnybones1" 11 | }, 12 | "dependencies": { 13 | "lodash": "^2.4.1", 14 | "simplex-noise": "^2.1.1", 15 | "three": "^0.82.1" 16 | }, 17 | "devDependencies": { 18 | "input-resize": "^2.0.0", 19 | "loadandrunscripts": "^1.0.0", 20 | "threejs-managed-view": "^1.1.0" 21 | }, 22 | "scripts": { 23 | "test": "beefy test.js --live --open" 24 | }, 25 | "keywords": [ 26 | "threejs", 27 | "animal", 28 | "procedural" 29 | ], 30 | "repository": { 31 | "type": "git", 32 | "url": "git://github.com/bunnybones1/threejs-procedural-animal.git" 33 | }, 34 | "homepage": "https://github.com/bunnybones1/threejs-procedural-animal", 35 | "bugs": { 36 | "url": "https://github.com/bunnybones1/threejs-procedural-animal/issues" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | var ManagedView = require('threejs-managed-view'); 2 | var loadAndRunScripts = require('loadandrunscripts'); 3 | var Resize = require('input-resize'); 4 | window.THREE = require('three'); 5 | loadAndRunScripts( 6 | [ 7 | 'lib/stats.min.js', 8 | 'lib/threex.rendererstats.js' 9 | ], 10 | function() { 11 | var clock = new THREE.Clock(); 12 | var Animal = require('./'); 13 | var Skeleton = require('./Skeleton'); 14 | Resize.minWidth = 600; 15 | Resize.minHeight = 400; 16 | var view = new ManagedView.View({ 17 | stats:true 18 | }); 19 | view.camera.position.multiplyScalar(4); 20 | 21 | // view.renderManager.skipFrames = 5; 22 | 23 | var light = new THREE.HemisphereLight(0x7f9fff, 0x7f4f3f, 1); 24 | view.scene.add(light); 25 | 26 | var totalLength = 10; 27 | var totalSegments = 4; 28 | var segmentLength = totalLength / totalSegments; 29 | var skeleton = new Skeleton(); 30 | var skeletonPreview = skeleton.createPreview(); 31 | skeletonPreview.position.y = -5; 32 | skeletonPreview.scale.multiplyScalar(8); 33 | view.scene.add(skeletonPreview); 34 | return; 35 | var bones = [{"parent":-1,"name":"BoneRoot","pos":[0,-.5 * totalLength,0],"rotq":[0,0,0,1]}]; 36 | for (var i = 1; i <= totalSegments; i++) { 37 | bones.push({"parent":i-1,"name":"Bone"+i+1,"pos":[0,segmentLength,0],"rotq":[0,0,0,1]}); 38 | }; 39 | 40 | for(var i = 0, totalAnimals = 1; i < totalAnimals; i++) { 41 | var animal = new Animal(bones); 42 | animal.position.x = i - totalAnimals*.5; 43 | var skelHelp = new THREE.SkeletonHelper(animal); 44 | view.scene.add(skelHelp); 45 | view.renderManager.onEnterFrame.add(animal.update); 46 | view.renderManager.onEnterFrame.add(skelHelp.update.bind(skelHelp)); 47 | view.scene.add(animal); 48 | } 49 | 50 | var first = true; 51 | view.renderManager.onEnterFrame.add(function() { 52 | var delta = clock.getDelta(); 53 | if(first) { 54 | console.log(animal); 55 | first = false; 56 | } 57 | animal.rotation.y += 0.02; 58 | }) 59 | 60 | 61 | } 62 | ) --------------------------------------------------------------------------------