Skip to content

Commit

Permalink
Camera Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamil-Prakash committed Sep 20, 2023
1 parent 97a5e72 commit 9246c82
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3,611 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ build/Release
# Dependency directories
node_modules/
jspm_packages/
dist/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
Expand Down
3,607 changes: 0 additions & 3,607 deletions dist/assets/index-44c1cef1.js

This file was deleted.

4 changes: 2 additions & 2 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.4.0/gsap.min.js"></script>
<meta name="description" content="Drag-and-drop preview tool for glTF 2.0 3D models.">
<link rel="canonical" href="https://gltf-viewer.donmccurdy.com/">
<link rel="shortcut icon" href="/dist/favicon.ico">
<link rel="shortcut icon" href="/gltfviewer/favicon.ico">

<link href="https://fonts.googleapis.com/css?family=Raleway:300,400" rel="stylesheet">

<script type="module" crossorigin src="/dist/assets/index-44c1cef1.js"></script>
<script type="module" crossorigin src="/dist/assets/index-9b539244.js"></script>
<link rel="stylesheet" href="/dist/assets/index-da00f828.css">
</head>
<body>
Expand Down
9 changes: 7 additions & 2 deletions src/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,15 @@ export class Viewer {
this.controls.enabled = true;
this.activeCamera = this.defaultCamera;
} else {
this.controls.enabled = false;

// this.controls.enabled = false;
this.content.traverse((node) => {
if (node.isCamera && node.name === name) {
this.activeCamera = node;

this.defaultCamera.position.set(node.position.x, node.position.y, node.position.z);
this.defaultCamera.rotation.set(node.rotation.x, node.rotation.y, node.rotation.z);
this.controls.update();
// this.activeCamera = node;
}
});
}
Expand Down

0 comments on commit 9246c82

Please sign in to comment.