Skip to content

Commit

Permalink
small
Browse files Browse the repository at this point in the history
  • Loading branch information
slimbuck committed Nov 6, 2024
1 parent d020015 commit ed8506f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/file-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,14 @@ const loadCameraPoses = async (url: string, filename: string, events: Events) =>
});
ave.mulScalar(1 / json.length);

json.forEach((pose: any, i: number) => {
// sort entries by trailing number if it exists
const sorter = (a: any, b: any) => {
const avalue = a.img_name?.match(/\d*$/)?.[0];
const bvalue = b.img_name?.match(/\d*$/)?.[0];
return (avalue && bvalue) ? parseInt(avalue, 10) - parseInt(bvalue, 10) : 0;
};

json.sort(sorter).forEach((pose: any, i: number) => {
if (pose.hasOwnProperty('position') && pose.hasOwnProperty('rotation')) {
const p = new Vec3(pose.position);
const z = new Vec3(pose.rotation[0][2], pose.rotation[1][2], pose.rotation[2][2]);
Expand Down
3 changes: 1 addition & 2 deletions src/ui/scss/camera-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

> .camera-panel-list-container {
width: 100%;
min-height: 180px;
max-height: 220px;
height: 300px;

padding: 4px 0px;

Expand Down

0 comments on commit ed8506f

Please sign in to comment.