code: function buildNodeHierachy( nodeId, parentObject, json, allNodes, skins ) {
  
  			var node = allNodes[ nodeId ];
  			var nodeDef = json.nodes[ nodeId ];
  
  			// build skeleton here as well
  
  			if ( nodeDef.skin !== undefined ) {
  
  				var meshes = node.isGroup === true ? node.children : [ node ];
  
  				for ( var i = 0, il = meshes.length; i < il; i ++ ) {
  
  					var mesh = meshes[ i ];
  					var skinEntry = skins[ nodeDef.skin ];
  
  					var bones = [];
  					var boneInverses = [];
  
  					for ( var j = 0, jl = skinEntry.joints.length; j < jl; j ++ ) {
  
  						var jointId = skinEntry.joints[ j ];
  						var jointNode = allNodes[ jointId ];
  
  						if ( jointNode ) {
  
  							bones.push( jointNode );
  
  							var mat = new THREE.Matrix4();
  
  							if ( skinEntry.inverseBindMatrices !== undefined ) {
  
  								mat.fromArray( skinEntry.inverseBindMatrices.array, j * 16 );
  
  							}
  
  							boneInverses.push( mat );
  
  						} else {
  
  							console.warn( 'THREE.GLTFLoader: Joint "%s" could not be found.', jointId );
  
  						}
  
  					}
  
  					mesh.bind( new THREE.Skeleton( bones, boneInverses ), mesh.matrixWorld );
  
  				}
  
  			}
  
  			// build node hierachy
  
  			parentObject.add( node );
  
  			if ( nodeDef.children ) {
  
  				var children = nodeDef.children;
  
  				for ( var i = 0, il = children.length; i < il; i ++ ) {
  
  					var child = children[ i ];
  					buildNodeHierachy( child, node, json, allNodes, skins );
  
  				}
  
  			}
  
  		}
docs: scene node hierachy builder