soiz commited on
Commit
23b1214
·
verified ·
1 Parent(s): d8cbec2

Update index.html

Browse files
Files changed (1) hide show
  1. 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
- // xyの座標を反転させる
94
  cube.position.set(
95
- (canvas.width / 2 - x) * cubeSize * 1.2, // x座標を反転
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 / 2) - (index % canvas.width)) * cubeSize * 1.2;
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