This commit is contained in:
syuilo
2026-02-12 10:55:57 +09:00
parent de1a3e3765
commit 51d2b0d6a5
10 changed files with 11 additions and 14 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

View File

@@ -158,7 +158,7 @@ onMounted(() => {
type: 'book',
position: [10, 100, 10],
rotation: [0, 0, 0],
variation: '1',
variation: 1,
}, {
id: 'u',
type: 'bed',

View File

@@ -105,21 +105,18 @@ const OBJECTS = {
const mesh = obj.meshes[2] as BABYLON.Mesh;
console.log(obj.meshes);
mesh.markVerticesDataAsUpdatable(BABYLON.VertexBuffer.UVKind, true);
if (o.variation === '1') {
const index = 0;
const x = index % 8;
const y = Math.floor(index / 8);
const index = o.variation;
const x = index % 8;
const y = Math.floor(index / 8);
const uvs = mesh.getVerticesData(BABYLON.VertexBuffer.UVKind)!;
for (let i = 0; i < uvs.length / 2; i++) {
const u = uvs[i * 2];
const v = uvs[i * 2 + 1];
uvs[i * 2] = u / 8;
uvs[i * 2 + 1] = v / 8;
}
mesh.updateVerticesData(BABYLON.VertexBuffer.UVKind, uvs);
const uvs = mesh.getVerticesData(BABYLON.VertexBuffer.UVKind)!;
for (let i = 0; i < uvs.length / 2; i++) {
const u = uvs[i * 2];
const v = uvs[i * 2 + 1];
uvs[i * 2] = (u / 8) + (x / 8);
uvs[i * 2 + 1] = (v / 8) + (y / 8);
}
mesh.updateVerticesData(BABYLON.VertexBuffer.UVKind, uvs);
},
},
'lava-lamp': {