Skip to content

Commit

Permalink
feat(examples): add Y+ option
Browse files Browse the repository at this point in the history
  • Loading branch information
shawn0326 committed Jul 12, 2024
1 parent 380593b commit f2017a4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 8 additions & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import { OrbitControls } from 't3d/addons/controls/OrbitControls.js';
import { SplatLoader, PLYLoader } from 't3d-gaussian-splatting';

import { GUI } from './libs/lil-gui.esm.min.js';

let width = window.innerWidth || 2;
let height = window.innerHeight || 2;

Expand Down Expand Up @@ -80,7 +82,7 @@
const url = './resources/bonsai-7k-mini.splat';
let mesh;

const splatLoader = new SplatLoader(loadingManager);
const splatLoader = new SplatLoader(loadingManager); // or new PLYLoader(loadingManager);
splatLoader.loadAsync(url).then(({ buffer, node }) => {
mesh = node;
scene.add(mesh);
Expand Down Expand Up @@ -114,12 +116,17 @@
}
});

const params = { 'Y+': false };
const gui = new GUI();
gui.add(params, 'Y+');

function loop(count) {
requestAnimationFrame(loop);

controller.update();

if (mesh) {
mesh.euler.x = params['Y+'] ? -Math.PI / 2 : 0;
mesh.update(camera, width, height);
}

Expand Down
Loading

0 comments on commit f2017a4

Please sign in to comment.