提交 ca89f465 编写于 作者: A Alex Weiss

OBJLoader & OBJMTLLoader: Fixed sharing of Vector2 & Vector3 objects by UVs & normals.

Should bring the OBJ(MTL)Loader into compliance with #3762.
上级 04a74c8f
......@@ -63,9 +63,9 @@ THREE.OBJLoader.prototype = {
parseInt( b ) - (face_offset + 1),
parseInt( c ) - (face_offset + 1),
[
normals[ parseInt( normals_inds[ 0 ] ) - 1 ],
normals[ parseInt( normals_inds[ 1 ] ) - 1 ],
normals[ parseInt( normals_inds[ 2 ] ) - 1 ]
normals[ parseInt( normals_inds[ 0 ] ) - 1 ].clone(),
normals[ parseInt( normals_inds[ 1 ] ) - 1 ].clone(),
normals[ parseInt( normals_inds[ 2 ] ) - 1 ].clone()
]
) );
}
......@@ -73,9 +73,9 @@ THREE.OBJLoader.prototype = {
function add_uvs( a, b, c ) {
geometry.faceVertexUvs[ 0 ].push( [
uvs[ parseInt( a ) - 1 ],
uvs[ parseInt( b ) - 1 ],
uvs[ parseInt( c ) - 1 ]
uvs[ parseInt( a ) - 1 ].clone(),
uvs[ parseInt( b ) - 1 ].clone(),
uvs[ parseInt( c ) - 1 ].clone()
] );
}
......
......@@ -133,9 +133,9 @@ THREE.OBJMTLLoader.prototype = {
parseInt( b ) - (face_offset + 1),
parseInt( c ) - (face_offset + 1),
[
normals[ parseInt( normals_inds[ 0 ] ) - 1 ],
normals[ parseInt( normals_inds[ 1 ] ) - 1 ],
normals[ parseInt( normals_inds[ 2 ] ) - 1 ]
normals[ parseInt( normals_inds[ 0 ] ) - 1 ].clone(),
normals[ parseInt( normals_inds[ 1 ] ) - 1 ].clone(),
normals[ parseInt( normals_inds[ 2 ] ) - 1 ].clone()
]
) );
}
......@@ -143,9 +143,9 @@ THREE.OBJMTLLoader.prototype = {
function add_uvs( a, b, c ) {
geometry.faceVertexUvs[ 0 ].push( [
uvs[ parseInt( a ) - 1 ],
uvs[ parseInt( b ) - 1 ],
uvs[ parseInt( c ) - 1 ]
uvs[ parseInt( a ) - 1 ].clone(),
uvs[ parseInt( b ) - 1 ].clone(),
uvs[ parseInt( c ) - 1 ].clone()
] );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册