Update index.html
Browse files- index.html +3 -3
index.html
CHANGED
@@ -90,9 +90,9 @@
|
|
90 |
const material = new THREE.MeshBasicMaterial({ color: color });
|
91 |
const cube = new THREE.Mesh(geometry, material);
|
92 |
|
93 |
-
// x
|
94 |
cube.position.set(
|
95 |
-
(canvas.width / 2
|
96 |
(canvas.height / 2 - y) * cubeSize * 1.2, // y座標を反転
|
97 |
Math.random() * 200 - 100 // 初期位置のばらつきを与える
|
98 |
);
|
@@ -107,7 +107,7 @@
|
|
107 |
|
108 |
// 各立方体をターゲット位置へ移動させる
|
109 |
cubes.forEach((cube, index) => {
|
110 |
-
const targetX = ((canvas.width
|
111 |
const targetY = ((canvas.height / 2) - Math.floor(index / canvas.width)) * cubeSize * 1.2;
|
112 |
const targetZ = 0;
|
113 |
|
|
|
90 |
const material = new THREE.MeshBasicMaterial({ color: color });
|
91 |
const cube = new THREE.Mesh(geometry, material);
|
92 |
|
93 |
+
// x座標はそのままに、y座標のみ反転させる
|
94 |
cube.position.set(
|
95 |
+
(x - canvas.width / 2) * cubeSize * 1.2, // x座標をそのまま使用
|
96 |
(canvas.height / 2 - y) * cubeSize * 1.2, // y座標を反転
|
97 |
Math.random() * 200 - 100 // 初期位置のばらつきを与える
|
98 |
);
|
|
|
107 |
|
108 |
// 各立方体をターゲット位置へ移動させる
|
109 |
cubes.forEach((cube, index) => {
|
110 |
+
const targetX = ((index % canvas.width) - canvas.width / 2) * cubeSize * 1.2;
|
111 |
const targetY = ((canvas.height / 2) - Math.floor(index / canvas.width)) * cubeSize * 1.2;
|
112 |
const targetZ = 0;
|
113 |
|