Skip to content

Commit

Permalink
Merge pull request #191 from mkkellogg/dev
Browse files Browse the repository at this point in the history
Release v0.3.7: Updated visualization modes
  • Loading branch information
mkkellogg authored Apr 5, 2024
2 parents 13d4407 + b5ae580 commit 0f5b839
Show file tree
Hide file tree
Showing 12 changed files with 600 additions and 198 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,20 @@ Keyboard
- Ratio of rendered splats to total splats
- Last splat sort duration

- `P` Toggles a debug object that shows the orientation of the camera controls. It includes a green arrow representing the camera's orbital axis and a white square representing the plane at which the camera's elevation angle is 0.
- `U` Toggles a debug object that shows the orientation of the camera controls. It includes a green arrow representing the camera's orbital axis and a white square representing the plane at which the camera's elevation angle is 0.

- `Left arrow` Rotate the camera's up vector counter-clockwise

- `Right arrow` Rotate the camera's up vector clockwise

- `P` Toggle point-cloud mode, where each splat is rendered as a filled circle

- `=` Increase splat scale

- `-` Decrease splat scale

- `O` Toggle orthographic mode

<br>

## Building from source and running locally
Expand Down Expand Up @@ -262,8 +270,8 @@ const viewer = new GaussianSplats3D.Viewer({
'webXRMode': GaussianSplats3D.WebXRMode.None,
'renderMode': GaussianSplats3D.RenderMode.OnChange,
'sceneRevealMode': GaussianSplats3D.SceneRevealMode.Instant,
`antialiased`: false,
`focalAdjustment`: 1.0
'antialiased': false,
'focalAdjustment': 1.0
});
viewer.addSplatScene('<path to .ply, .ksplat, or .splat file>')
.then(() => {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "git",
"url": "https://github.com/mkkellogg/GaussianSplats3D"
},
"version": "0.3.6",
"version": "0.3.7",
"description": "Three.js-based 3D Gaussian splat viewer",
"module": "build/gaussian-splats-3d.module.js",
"main": "build/gaussian-splats-3d.umd.cjs",
Expand Down
5 changes: 5 additions & 0 deletions src/OrbitControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,11 @@ class OrbitControls extends EventDispatcher {

};

this.clearDampedRotation = function() {
sphericalDelta.theta = 0.0;
sphericalDelta.phi = 0.0;
};

//
// internals
//
Expand Down
6 changes: 5 additions & 1 deletion src/SceneHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,17 @@ export class SceneHelper {

const tempPosition = new THREE.Vector3();
const tempMatrix = new THREE.Matrix4();
const toCamera = new THREE.Vector3();

return function(position, camera, viewport) {
tempMatrix.copy(camera.matrixWorld).invert();
tempPosition.copy(position).applyMatrix4(tempMatrix);
tempPosition.normalize().multiplyScalar(10);
tempPosition.applyMatrix4(camera.matrixWorld);
this.focusMarker.position.copy(tempPosition);
toCamera.copy(camera.position).sub(position);
const toCameraDistance = toCamera.length();
this.focusMarker.position.copy(position);
this.focusMarker.scale.set(toCameraDistance, toCameraDistance, toCameraDistance);
this.focusMarker.material.uniforms.realFocusPosition.value.copy(position);
this.focusMarker.material.uniforms.viewport.value.copy(viewport);
this.focusMarker.material.uniformsNeedUpdate = true;
Expand Down
Loading

0 comments on commit 0f5b839

Please sign in to comment.