未验证 提交 4e14ab7a 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #17012 from Mugen87/dev36

Geometry: Honor second set of uvs in .merge().
......@@ -695,8 +695,6 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
vertices2 = geometry.vertices,
faces1 = this.faces,
faces2 = geometry.faces,
uvs1 = this.faceVertexUvs[ 0 ],
uvs2 = geometry.faceVertexUvs[ 0 ],
colors1 = this.colors,
colors2 = geometry.colors;
......@@ -778,23 +776,25 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
// uvs
for ( i = 0, il = uvs2.length; i < il; i ++ ) {
for ( var i = 0, il = geometry.faceVertexUvs.length; i < il; i ++ ) {
var uv = uvs2[ i ], uvCopy = [];
var faceVertexUvs2 = geometry.faceVertexUvs[ i ];
if ( uv === undefined ) {
if ( this.faceVertexUvs[ i ] === undefined ) this.faceVertexUvs[ i ] = [];
continue;
for ( var j = 0, jl = faceVertexUvs2.length; j < jl; j ++ ) {
}
var uvs2 = faceVertexUvs2[ j ], uvsCopy = [];
for ( var j = 0, jl = uv.length; j < jl; j ++ ) {
for ( var k = 0, kl = uvs2.length; k < kl; k ++ ) {
uvCopy.push( uv[ j ].clone() );
uvsCopy.push( uvs2[ k ].clone() );
}
}
uvs1.push( uvCopy );
this.faceVertexUvs[ i ].push( uvsCopy );
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册