@itk-viewer/viewer
Advanced tools
Comparing version 0.2.8 to 0.2.9
# @itk-viewer/viewer | ||
## 0.2.9 | ||
### Patch Changes | ||
- cc64b6a: Fix orientation of view-2d | ||
## 0.2.8 | ||
@@ -4,0 +10,0 @@ |
import { assign, enqueueActions, fromPromise, setup, } from 'xstate'; | ||
import { reset2d } from './camera.js'; | ||
import { quat, vec3 } from 'gl-matrix'; | ||
const viewContext = { | ||
@@ -51,3 +52,9 @@ slice: 0.5, | ||
const { pose: currentPose, verticalFieldOfView } = camera.getSnapshot().context; | ||
const pose = reset2d(currentPose, verticalFieldOfView, bounds, aspect); | ||
// rotate so +Z goes into screen and +Y is down on screen | ||
const withAxis = { ...currentPose }; | ||
const axis = vec3.fromValues(1, 0, 0); | ||
const rotation = quat.create(); | ||
quat.setAxisAngle(rotation, axis, Math.PI); | ||
withAxis.rotation = rotation; | ||
const pose = reset2d(withAxis, verticalFieldOfView, bounds, aspect); | ||
camera.send({ | ||
@@ -54,0 +61,0 @@ type: 'setPose', |
{ | ||
"name": "@itk-viewer/viewer", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"description": "Multi-dimensional web-based image, mesh, and point set viewer", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -16,2 +16,3 @@ import { | ||
import { ViewportActor } from './viewport.js'; | ||
import { quat, vec3 } from 'gl-matrix'; | ||
@@ -93,3 +94,9 @@ const viewContext = { | ||
camera.getSnapshot().context; | ||
const pose = reset2d(currentPose, verticalFieldOfView, bounds, aspect); | ||
// rotate so +Z goes into screen and +Y is down on screen | ||
const withAxis = { ...currentPose }; | ||
const axis = vec3.fromValues(1, 0, 0); | ||
const rotation = quat.create(); | ||
quat.setAxisAngle(rotation, axis, Math.PI); | ||
withAxis.rotation = rotation; | ||
const pose = reset2d(withAxis, verticalFieldOfView, bounds, aspect); | ||
camera.send({ | ||
@@ -96,0 +103,0 @@ type: 'setPose', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
153225
2464