Merge pull request #1363 from ousttrue/fix/mesh_normalization

meshを正規化するときに、法線を正規化する
This commit is contained in:
ousttrue 2021-11-08 16:16:24 +09:00 committed by GitHub
commit f785bf12c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -370,7 +370,7 @@ namespace UniGLTF.MeshUtility
}
else
{
normals[j] = m.MultiplyVector(normals[j]) - meshNormals[j];
normals[j] = m.MultiplyVector(normals[j].normalized) - meshNormals[j];
}
}

View File

@ -70,7 +70,7 @@ namespace UniGLTF.MeshUtility
src.vertices = src.vertices.Select(x => m.MultiplyPoint(x)).ToArray();
if (src.normals != null && src.normals.Length > 0)
{
src.normals = src.normals.Select(x => m.MultiplyVector(x)).ToArray();
src.normals = src.normals.Select(x => m.MultiplyVector(x.normalized)).ToArray();
}
if (src.tangents != null && src.tangents.Length > 0)
{