@inweb/viewer-three 26.7.2 → 26.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1844,7 +1844,6 @@ class CameraComponent {
1844
1844
  }));
1845
1845
  if (sceneCamera) {
1846
1846
  this.viewer.camera = sceneCamera.clone();
1847
- this.viewer.camera.up.set(0, 0, 1);
1848
1847
  this.viewer.camera.scale.set(1, 1, 1);
1849
1848
  }
1850
1849
  const camera = this.viewer.camera;
@@ -4607,13 +4606,17 @@ class Viewer extends EventEmitter2 {
4607
4606
  this.addEventListener("optionschange", (event => this.syncOptions(event.data)));
4608
4607
  this.scene = new Scene;
4609
4608
  this.helpers = new Scene;
4609
+ this.target = new Vector3;
4610
4610
  const pixelRatio = window.devicePixelRatio;
4611
4611
  const rect = canvas.parentElement.getBoundingClientRect();
4612
4612
  const width = rect.width || 1;
4613
4613
  const height = rect.height || 1;
4614
4614
  const aspect = width / height;
4615
4615
  this.camera = new PerspectiveCamera(45, aspect, .01, 1e3);
4616
- this.camera.up.set(0, 0, 1);
4616
+ this.camera.up.set(0, 1, 0);
4617
+ this.camera.position.set(0, 0, 1);
4618
+ this.camera.lookAt(this.target);
4619
+ this.camera.updateProjectionMatrix();
4617
4620
  this.renderer = new WebGLRenderer({
4618
4621
  canvas: canvas,
4619
4622
  antialias: true,