提交 de338cfb 编写于 作者: M Mr.doob

MD2Character*: Use first frame for reference boundingBox.

上级 615c99f7
......@@ -44,8 +44,10 @@ THREE.MD2Character = function () {
loader.load( config.baseUrl + config.body, function ( geo ) {
geo.computeBoundingBox();
scope.root.position.y = - scope.scale * geo.boundingBox.min.y;
var boundingBox = new THREE.Box3();
boundingBox.setFromBufferAttribute( geo.attributes.position );
scope.root.position.y = - scope.scale * boundingBox.min.y;
var mesh = createPart( geo, scope.skinsBody[ 0 ] );
mesh.scale.set( scope.scale, scope.scale, scope.scale );
......
......@@ -156,8 +156,10 @@ THREE.MD2CharacterComplex = function () {
loader.load( config.baseUrl + config.body, function( geo ) {
geo.computeBoundingBox();
scope.root.position.y = - scope.scale * geo.boundingBox.min.y;
var boundingBox = new THREE.Box3();
boundingBox.setFromBufferAttribute( geo.attributes.position );
scope.root.position.y = - scope.scale * boundingBox.min.y;
var mesh = createPart( geo, scope.skinsBody[ 0 ] );
mesh.scale.set( scope.scale, scope.scale, scope.scale );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册