examples/lib/three.js
function ( geometry ) {

		geometry.computeBoundingBox();

		var bb = geometry.boundingBox;

		var offset = new THREE.Vector3();

		offset.addVectors( bb.min, bb.max );
		offset.multiplyScalar( -0.5 );

		geometry.applyMatrix( new THREE.Matrix4().makeTranslation( offset.x, offset.y, offset.z ) );
		geometry.computeBoundingBox();

		return offset;

	}
function ( geometry ) {

		geometry.computeBoundingBox();

		var bb = geometry.boundingBox;

		var offset = new THREE.Vector3();

		offset.addVectors( bb.min, bb.max );
		offset.multiplyScalar( -0.5 );

		geometry.applyMatrix( new THREE.Matrix4().makeTranslation( offset.x, offset.y, offset.z ) );
		geometry.computeBoundingBox();

		return offset;

	}
function ( geometry ) { geometry . computeBoundingBox ( ) ; var bb = geometry . boundingBox ; var offset = new THREE . Vector3 ( ) ; offset . addVectors ( bb . min , bb . max ) ; offset . multiplyScalar ( - 0.5 ) ; geometry . applyMatrix ( new THREE . Matrix4 ( ) . makeTranslation ( offset . x , offset . y , offset . z ) ) ; geometry . computeBoundingBox ( ) ; return offset ; }
Center geometry so that 0,0,0 is in center of bounding box
Center geometry so that 0 0 0 is in center of bounding box