MikaFil commited on
Commit
8d133f4
·
verified ·
1 Parent(s): c81bc73

Update viewer.js

Browse files
Files changed (1) hide show
  1. viewer.js +4 -19
viewer.js CHANGED
@@ -239,22 +239,6 @@ export async function initializeViewer(config, instanceId) {
239
  matSol.useLighting = false;
240
  matSol.update();
241
 
242
- /*const bgPlane = new pc.Entity("Plane");
243
- bgPlane.addComponent("model", { type: "plane" });
244
- bgPlane.setLocalPosition(0, -0.1, 0);
245
- bgPlane.setLocalScale(11, 1, 5.5);
246
- // Simple material for the banner
247
- const mat = new pc.StandardMaterial();
248
- mat.diffuse = new pc.Color(1, 1, 1);
249
- mat.diffuseMap = bgTex;
250
- mat.emissive = new pc.Color(1, 1, 1);
251
- mat.emissiveMap = bgTex;
252
- mat.emissiveIntensity = 1;
253
- mat.useLighting = false;
254
- mat.update();
255
- bgPlane.model.material = mat;
256
- app.root.addChild(bgPlane);*/
257
-
258
  traverse(presentoirEntity, node => {
259
  if (node.render && node.render.meshInstances) {
260
  for (let mi of node.render.meshInstances) {
@@ -274,9 +258,10 @@ export async function initializeViewer(config, instanceId) {
274
 
275
  cameraEntity = new pc.Entity('camera');
276
  cameraEntity.addComponent('camera',
277
- { clearColor: new pc.Color(color_bg)},
278
-
279
- );
 
280
  cameraEntity.setPosition(chosenCameraX, chosenCameraY, chosenCameraZ);
281
  cameraEntity.lookAt(modelEntity.getPosition());
282
  cameraEntity.addComponent('script');
 
239
  matSol.useLighting = false;
240
  matSol.update();
241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  traverse(presentoirEntity, node => {
243
  if (node.render && node.render.meshInstances) {
244
  for (let mi of node.render.meshInstances) {
 
258
 
259
  cameraEntity = new pc.Entity('camera');
260
  cameraEntity.addComponent('camera',
261
+ { clearColor: new pc.Color(color_bg),
262
+ nearClip: 0.01,
263
+ farClip: 100
264
+ });
265
  cameraEntity.setPosition(chosenCameraX, chosenCameraY, chosenCameraZ);
266
  cameraEntity.lookAt(modelEntity.getPosition());
267
  cameraEntity.addComponent('script');