Spaces:
Running
Running
Update viewer.js
Browse files
viewer.js
CHANGED
|
@@ -18,16 +18,6 @@
|
|
| 18 |
};
|
| 19 |
})();
|
| 20 |
|
| 21 |
-
//convertie les hex en vec rgb
|
| 22 |
-
function hexToRgb(hex) {
|
| 23 |
-
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
| 24 |
-
return result ? {
|
| 25 |
-
r: parseInt(result[1], 16),
|
| 26 |
-
g: parseInt(result[2], 16),
|
| 27 |
-
b: parseInt(result[3], 16)
|
| 28 |
-
} : null;
|
| 29 |
-
}
|
| 30 |
-
|
| 31 |
let pc;
|
| 32 |
export let app = null;
|
| 33 |
let cameraEntity = null;
|
|
@@ -42,7 +32,6 @@ let modelX, modelY, modelZ, modelScale, modelRotationX, modelRotationY, modelRot
|
|
| 42 |
let presentoirScaleX, presentoirScaleY, presentoirScaleZ;
|
| 43 |
|
| 44 |
let sogsUrl, glbUrl, presentoirUrl;
|
| 45 |
-
let color_bg_hex, color_bg;
|
| 46 |
|
| 47 |
// --- Log user agent and page location ---
|
| 48 |
console.log("%c[VIEWER DEBUG] User Agent:", "color: #0074D9;", navigator.userAgent);
|
|
@@ -79,10 +68,6 @@ export async function initializeViewer(config, instanceId) {
|
|
| 79 |
presentoirScaleY = (config.presentoirScaleY !== undefined) ? parseFloat(config.presentoirScaleY) : 0;
|
| 80 |
presentoirScaleZ = (config.presentoirScaleZ !== undefined) ? parseFloat(config.presentoirScaleZ) : 0;
|
| 81 |
|
| 82 |
-
color_bg_hex = (config.canvas_background !== undefined) ? config.canvas_background : "#DDD4D5";
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
const cameraX = (config.cameraX !== undefined) ? parseFloat(config.cameraX) : 0;
|
| 87 |
const cameraY = (config.cameraY !== undefined) ? parseFloat(config.cameraY) : 2;
|
| 88 |
const cameraZ = (config.cameraZ !== undefined) ? parseFloat(config.cameraZ) : 5;
|
|
|
|
| 18 |
};
|
| 19 |
})();
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
let pc;
|
| 22 |
export let app = null;
|
| 23 |
let cameraEntity = null;
|
|
|
|
| 32 |
let presentoirScaleX, presentoirScaleY, presentoirScaleZ;
|
| 33 |
|
| 34 |
let sogsUrl, glbUrl, presentoirUrl;
|
|
|
|
| 35 |
|
| 36 |
// --- Log user agent and page location ---
|
| 37 |
console.log("%c[VIEWER DEBUG] User Agent:", "color: #0074D9;", navigator.userAgent);
|
|
|
|
| 68 |
presentoirScaleY = (config.presentoirScaleY !== undefined) ? parseFloat(config.presentoirScaleY) : 0;
|
| 69 |
presentoirScaleZ = (config.presentoirScaleZ !== undefined) ? parseFloat(config.presentoirScaleZ) : 0;
|
| 70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
const cameraX = (config.cameraX !== undefined) ? parseFloat(config.cameraX) : 0;
|
| 72 |
const cameraY = (config.cameraY !== undefined) ? parseFloat(config.cameraY) : 2;
|
| 73 |
const cameraZ = (config.cameraZ !== undefined) ? parseFloat(config.cameraZ) : 5;
|