Spaces:
Running
Running
Update index_3.js
Browse files- index_3.js +4 -1
index_3.js
CHANGED
@@ -40,6 +40,7 @@
|
|
40 |
// Read configuration values from the JSON file.
|
41 |
const gifUrl = config.gif_url;
|
42 |
const plyUrl = config.ply_url;
|
|
|
43 |
const minZoom = parseFloat(config.minZoom || "0");
|
44 |
const maxZoom = parseFloat(config.maxZoom || "20");
|
45 |
const minAngle = parseFloat(config.minAngle || "0");
|
@@ -302,6 +303,9 @@
|
|
302 |
const renderer = new SPLAT.WebGLRenderer(canvas);
|
303 |
const scene = new SPLAT.Scene();
|
304 |
|
|
|
|
|
|
|
305 |
// Construct the camera (no custom position since it's no longer in the JSON).
|
306 |
const camera = new SPLAT.Camera();
|
307 |
|
@@ -324,7 +328,6 @@
|
|
324 |
initialCameraPosition = camera.position.clone();
|
325 |
initialCameraRotation = camera.rotation.clone();
|
326 |
|
327 |
-
// The canvas background is now controlled by CSS.
|
328 |
controlsInstance.maxZoom = maxZoom;
|
329 |
controlsInstance.minZoom = minZoom;
|
330 |
controlsInstance.minAngle = minAngle;
|
|
|
40 |
// Read configuration values from the JSON file.
|
41 |
const gifUrl = config.gif_url;
|
42 |
const plyUrl = config.ply_url;
|
43 |
+
const canvasBg = config.canvas_background || "#FEFEFD";
|
44 |
const minZoom = parseFloat(config.minZoom || "0");
|
45 |
const maxZoom = parseFloat(config.maxZoom || "20");
|
46 |
const minAngle = parseFloat(config.minAngle || "0");
|
|
|
303 |
const renderer = new SPLAT.WebGLRenderer(canvas);
|
304 |
const scene = new SPLAT.Scene();
|
305 |
|
306 |
+
// Set the canvas background from JSON.
|
307 |
+
canvas.style.background = canvasBg;
|
308 |
+
|
309 |
// Construct the camera (no custom position since it's no longer in the JSON).
|
310 |
const camera = new SPLAT.Camera();
|
311 |
|
|
|
328 |
initialCameraPosition = camera.position.clone();
|
329 |
initialCameraRotation = camera.rotation.clone();
|
330 |
|
|
|
331 |
controlsInstance.maxZoom = maxZoom;
|
332 |
controlsInstance.minZoom = minZoom;
|
333 |
controlsInstance.minAngle = minAngle;
|