Update index.html
Browse files- index.html +4 -3
index.html
CHANGED
@@ -43,7 +43,7 @@
|
|
43 |
</form>
|
44 |
<div id="settings">
|
45 |
<label>
|
46 |
-
|
47 |
</label>
|
48 |
<label>
|
49 |
カメラ X: <input type="range" id="cameraX" min="-500" max="500" value="-100" oninput="updateCameraPosition()">
|
@@ -105,6 +105,7 @@
|
|
105 |
document.getElementById('scene-container').innerHTML = ''; // 既存のcanvasを削除
|
106 |
document.getElementById('scene-container').appendChild(renderer.domElement);
|
107 |
|
|
|
108 |
createCubesFromImage();
|
109 |
animate();
|
110 |
}
|
@@ -161,9 +162,9 @@
|
|
161 |
create3DScene();
|
162 |
}
|
163 |
|
164 |
-
function
|
165 |
const color = document.getElementById('bgColorPicker').value;
|
166 |
-
|
167 |
}
|
168 |
|
169 |
function updateCameraPosition() {
|
|
|
43 |
</form>
|
44 |
<div id="settings">
|
45 |
<label>
|
46 |
+
シーン背景色: <input type="color" id="bgColorPicker" value="#222222" onchange="updateSceneBackgroundColor()">
|
47 |
</label>
|
48 |
<label>
|
49 |
カメラ X: <input type="range" id="cameraX" min="-500" max="500" value="-100" oninput="updateCameraPosition()">
|
|
|
105 |
document.getElementById('scene-container').innerHTML = ''; // 既存のcanvasを削除
|
106 |
document.getElementById('scene-container').appendChild(renderer.domElement);
|
107 |
|
108 |
+
updateSceneBackgroundColor(); // シーンの背景色を初期設定
|
109 |
createCubesFromImage();
|
110 |
animate();
|
111 |
}
|
|
|
162 |
create3DScene();
|
163 |
}
|
164 |
|
165 |
+
function updateSceneBackgroundColor() {
|
166 |
const color = document.getElementById('bgColorPicker').value;
|
167 |
+
scene.background = new THREE.Color(color); // シーンの背景色を更新
|
168 |
}
|
169 |
|
170 |
function updateCameraPosition() {
|