examples/js/libs/ColladaLoader.js
function skinToBindPose(geometry,skeleton,skinController) {

		var bones = [];
		setupSkeleton( skeleton, bones, -1 );
		setupSkinningMatrices( bones, skinController.skin );
		var v = new THREE.Vector3();
		var skinned = [];

		for (var i = 0; i < geometry.vertices.length; i ++) {

			skinned.push(new THREE.Vector3());

		}

		for ( i = 0; i < bones.length; i ++ ) {

			if ( bones[ i ].type != 'JOINT' ) continue;

			for ( var j = 0; j < bones[ i ].weights.length; j ++ ) {

				var w = bones[ i ].weights[ j ];
				var vidx = w.index;
				var weight = w.weight;

				var o = geometry.vertices[vidx];
				var s = skinned[vidx];

				v.x = o.x;
				v.y = o.y;
				v.z = o.z;

				v.applyMatrix4( bones[i].skinningMatrix );

				s.x += (v.x * weight);
				s.y += (v.y * weight);
				s.z += (v.z * weight);
			}

		}

		for (var i = 0; i < geometry.vertices.length; i ++) {

			geometry.vertices[i] = skinned[i];

		}

	}
function skinToBindPose(geometry,skeleton,skinController) {

		var bones = [];
		setupSkeleton( skeleton, bones, -1 );
		setupSkinningMatrices( bones, skinController.skin );
		var v = new THREE.Vector3();
		var skinned = [];

		for (var i = 0; i < geometry.vertices.length; i ++) {

			skinned.push(new THREE.Vector3());

		}

		for ( i = 0; i < bones.length; i ++ ) {

			if ( bones[ i ].type != 'JOINT' ) continue;

			for ( var j = 0; j < bones[ i ].weights.length; j ++ ) {

				var w = bones[ i ].weights[ j ];
				var vidx = w.index;
				var weight = w.weight;

				var o = geometry.vertices[vidx];
				var s = skinned[vidx];

				v.x = o.x;
				v.y = o.y;
				v.z = o.z;

				v.applyMatrix4( bones[i].skinningMatrix );

				s.x += (v.x * weight);
				s.y += (v.y * weight);
				s.z += (v.z * weight);
			}

		}

		for (var i = 0; i < geometry.vertices.length; i ++) {

			geometry.vertices[i] = skinned[i];

		}

	}
function skinToBindPose ( geometry , skeleton , skinController ) { var bones = [ ] ; setupSkeleton ( skeleton , bones , - 1 ) ; setupSkinningMatrices ( bones , skinController . skin ) ; var v = new THREE . Vector3 ( ) ; var skinned = [ ] ; for ( var i = 0 ; i < geometry . vertices . length ; i ++ ) { skinned . push ( new THREE . Vector3 ( ) ) ; } for ( i = 0 ; i < bones . length ; i ++ ) { if ( bones [ i ] . type != 'JOINT' ) continue ; for ( var j = 0 ; j < bones [ i ] . weights . length ; j ++ ) { var w = bones [ i ] . weights [ j ] ; var vidx = w . index ; var weight = w . weight ; var o = geometry . vertices [ vidx ] ; var s = skinned [ vidx ] ; v . x = o . x ; v . y = o . y ; v . z = o . z ; v . applyMatrix4 ( bones [ i ] . skinningMatrix ) ; s . x += ( v . x * weight ) ; s . y += ( v . y * weight ) ; s . z += ( v . z * weight ) ; } } for ( var i = 0 ; i < geometry . vertices . length ; i ++ ) { geometry . vertices [ i ] = skinned [ i ] ; } }
Move the vertices into the pose that is proper for the start of the animation
Move the vertices into the pose that is proper for the start of the animation