Spaces:
Running
Running
Update viewer.js
Browse files
viewer.js
CHANGED
|
@@ -95,7 +95,8 @@ export async function initializeViewer(config, instanceId) {
|
|
| 95 |
const cameraYPhone = (config.cameraYPhone !== undefined) ? parseFloat(config.cameraYPhone) : cameraY;
|
| 96 |
const cameraZPhone = (config.cameraZPhone !== undefined) ? parseFloat(config.cameraZPhone) : (cameraZ * 1.5);
|
| 97 |
|
| 98 |
-
color_bg_hex = (config.canvas_background !== undefined) ? config.canvas_background : "#A1D4D2";
|
|
|
|
| 99 |
color_bg = hexToRgbaArray(color_bg_hex);
|
| 100 |
|
| 101 |
console.log("color bg : ", color_bg);
|
|
@@ -234,7 +235,7 @@ export async function initializeViewer(config, instanceId) {
|
|
| 234 |
app.root.addChild(presentoirEntity);
|
| 235 |
|
| 236 |
cameraEntity = new pc.Entity('camera');
|
| 237 |
-
cameraEntity.addComponent('camera', { clearColor: new pc.Color(
|
| 238 |
cameraEntity.setPosition(chosenCameraX, chosenCameraY, chosenCameraZ);
|
| 239 |
cameraEntity.lookAt(modelEntity.getPosition());
|
| 240 |
cameraEntity.addComponent('script');
|
|
|
|
| 95 |
const cameraYPhone = (config.cameraYPhone !== undefined) ? parseFloat(config.cameraYPhone) : cameraY;
|
| 96 |
const cameraZPhone = (config.cameraZPhone !== undefined) ? parseFloat(config.cameraZPhone) : (cameraZ * 1.5);
|
| 97 |
|
| 98 |
+
//color_bg_hex = (config.canvas_background !== undefined) ? config.canvas_background : "#A1D4D2";
|
| 99 |
+
color_bg_hex = "#A1D4D2";
|
| 100 |
color_bg = hexToRgbaArray(color_bg_hex);
|
| 101 |
|
| 102 |
console.log("color bg : ", color_bg);
|
|
|
|
| 235 |
app.root.addChild(presentoirEntity);
|
| 236 |
|
| 237 |
cameraEntity = new pc.Entity('camera');
|
| 238 |
+
cameraEntity.addComponent('camera', { clearColor: new pc.Color(color_bg) });
|
| 239 |
cameraEntity.setPosition(chosenCameraX, chosenCameraY, chosenCameraZ);
|
| 240 |
cameraEntity.lookAt(modelEntity.getPosition());
|
| 241 |
cameraEntity.addComponent('script');
|