@inweb/viewer-three 26.7.1 → 26.7.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inweb/viewer-three",
3
- "version": "26.7.1",
3
+ "version": "26.7.6",
4
4
  "description": "JavaScript library for rendering CAD and BIM files in a browser using Three.js",
5
5
  "homepage": "https://cloud.opendesign.com/docs/index.html",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -35,10 +35,10 @@
35
35
  "docs": "typedoc"
36
36
  },
37
37
  "dependencies": {
38
- "@inweb/client": "~26.7.1",
39
- "@inweb/eventemitter2": "~26.7.1",
40
- "@inweb/markup": "~26.7.1",
41
- "@inweb/viewer-core": "~26.7.1"
38
+ "@inweb/client": "~26.7.6",
39
+ "@inweb/eventemitter2": "~26.7.6",
40
+ "@inweb/markup": "~26.7.6",
41
+ "@inweb/viewer-core": "~26.7.6"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/three": "^0.173.0",
@@ -154,14 +154,19 @@ export class Viewer
154
154
 
155
155
  this.scene = new Scene();
156
156
  this.helpers = new Scene();
157
+ this.target = new Vector3();
157
158
 
158
159
  const pixelRatio = window.devicePixelRatio;
159
160
  const rect = canvas.parentElement.getBoundingClientRect();
160
161
  const width = rect.width || 1;
161
162
  const height = rect.height || 1;
162
163
  const aspect = width / height;
164
+
163
165
  this.camera = new PerspectiveCamera(45, aspect, 0.01, 1000);
164
- this.camera.up.set(0, 0, 1);
166
+ this.camera.up.set(0, 1, 0);
167
+ this.camera.position.set(0, 0, 1);
168
+ this.camera.lookAt(this.target);
169
+ this.camera.updateProjectionMatrix();
165
170
 
166
171
  this.renderer = new WebGLRenderer({
167
172
  canvas,
@@ -53,7 +53,6 @@ export class CameraComponent implements IComponent {
53
53
  });
54
54
  if (sceneCamera) {
55
55
  this.viewer.camera = sceneCamera.clone();
56
- this.viewer.camera.up.set(0, 0, 1);
57
56
  this.viewer.camera.scale.set(1, 1, 1); // <- Visualize fix
58
57
  }
59
58