Skip to content

Commit

Permalink
fix(view-2d): orient K slice view with +Y/J down screen
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHax committed Jun 4, 2024
1 parent d8fb549 commit 82463a3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/viewer/src/view-2d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ const toRotation = (direction: Float64Array, axis: AxisType) => {
if (axis == Axis.I) {
quat.setAxes(rotation, x, z, y);
} else if (axis == Axis.J) {
quat.setAxes(rotation, y, x, z); // negate z?
quat.setAxes(rotation, y, x, z);
} else {
vec3.negate(z, z);
vec3.negate(y, y); // +y points down on screen
quat.setAxes(rotation, z, x, y);
}
return rotation;
Expand Down Expand Up @@ -220,14 +220,15 @@ export const view2d = setup({

const pose = reset2d(withAxis, verticalFieldOfView, pointsToFit, aspect);

console.log('resetCameraPose', pose);
camera.send({
type: 'setPose',
pose,
});
camera.send({
type: 'setEnableRotation',
enable: false,
});
// camera.send({
// type: 'setEnableRotation',
// enable: false,
// });
},
},
}).createMachine({
Expand Down

0 comments on commit 82463a3

Please sign in to comment.