Update UV preview texture

Improvement to mesh template generator
This commit is contained in:
JannisX11 2023-04-17 12:46:37 +02:00
parent 61dcce891c
commit 99558d2145
2 changed files with 9 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -1014,6 +1014,15 @@ const TextureGenerator = {
}
}
}
// ... or on the side
else if (Math.epsilon(face_group.normal[2], 0, 0.05)) {
let offset_x = (Math.ceil(max_x) - max_x) / 2;
for (let fkey in vertex_uvs) {
for (let vkey in vertex_uvs[fkey]) {
vertex_uvs[fkey][vkey][0] += offset_x;
}
}
}
// Or align right if face points to right side of model
else if ((face_group.normal[0] > 0) != (face_group.normal[2] < 0)) {
for (let fkey in vertex_uvs) {