Spaces:
Running
Running
Update viewer.js
Browse files
viewer.js
CHANGED
|
@@ -239,13 +239,19 @@ export async function initializeViewer(config, instanceId) {
|
|
| 239 |
app.root.addChild(glbEntity);
|
| 240 |
}
|
| 241 |
|
| 242 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 243 |
let matSol = new pc.StandardMaterial();
|
| 244 |
matSol.blendType = pc.BLEND_NORMAL;
|
| 245 |
matSol.emissivve = new pc.Color(color_bg);
|
| 246 |
matSol.emissiveIntensity = 1;
|
| 247 |
matSol.update();
|
| 248 |
|
|
|
|
|
|
|
| 249 |
/*traverse(glbEntity, node => {
|
| 250 |
if (node.render && node.render.meshInstances) {
|
| 251 |
for (let mi of node.render.meshInstances) {
|
|
@@ -254,10 +260,6 @@ export async function initializeViewer(config, instanceId) {
|
|
| 254 |
}
|
| 255 |
});*/
|
| 256 |
}
|
| 257 |
-
|
| 258 |
-
const presentoirEntity =assets.presentoir.resource.instantiateRenderEntity();
|
| 259 |
-
presentoirEntity.setLocalScale(presentoirScaleX, presentoirScaleY, presentoirScaleZ);
|
| 260 |
-
app.root.addChild(presentoirEntity);
|
| 261 |
|
| 262 |
cameraEntity = new pc.Entity('camera');
|
| 263 |
cameraEntity.addComponent('camera', { clearColor: new pc.Color(color_bg) });
|
|
|
|
| 239 |
app.root.addChild(glbEntity);
|
| 240 |
}
|
| 241 |
|
| 242 |
+
const presentoirEntity =assets.presentoir.resource.instantiateRenderEntity();
|
| 243 |
+
presentoirEntity.setLocalScale(presentoirScaleX, presentoirScaleY, presentoirScaleZ);
|
| 244 |
+
app.root.addChild(presentoirEntity);
|
| 245 |
+
|
| 246 |
+
if(config.presentoirUrl == undefined){
|
| 247 |
let matSol = new pc.StandardMaterial();
|
| 248 |
matSol.blendType = pc.BLEND_NORMAL;
|
| 249 |
matSol.emissivve = new pc.Color(color_bg);
|
| 250 |
matSol.emissiveIntensity = 1;
|
| 251 |
matSol.update();
|
| 252 |
|
| 253 |
+
presentoirEntity.material = matSol;
|
| 254 |
+
|
| 255 |
/*traverse(glbEntity, node => {
|
| 256 |
if (node.render && node.render.meshInstances) {
|
| 257 |
for (let mi of node.render.meshInstances) {
|
|
|
|
| 260 |
}
|
| 261 |
});*/
|
| 262 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 263 |
|
| 264 |
cameraEntity = new pc.Entity('camera');
|
| 265 |
cameraEntity.addComponent('camera', { clearColor: new pc.Color(color_bg) });
|