Skip to content

Reset to crop - #506

Open
frasercl wants to merge 2 commits into
mainfrom
feat/reset-to-crop
Open

frasercl wants to merge 2 commits into
mainfrom
feat/reset-to-crop

Conversation

@frasercl

@frasercl frasercl commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Review time: small (~10-15min)

Resolves AllenCell/vole-app#496: by default, resetCamera now resets to look at the center of the clipped subregion, not the center of the volume's bounding box

Steps to verify:

  • Open the test app
  • Open "clipping box" in the top-right control panel
  • Shrink the clipping box by some arbitrary amount
  • Optional: click "Bounds" for an extra visual indicator
  • Click "ResetCam." The camera should reset to the center of the clipping box, not the center of the bounds.
  • Switch to the orthographic views (X/Y/Z) and repeat

@frasercl
frasercl requested a review from a team as a code owner November 5, 2026 23:48
Comment thread src/VolumeDrawable.ts
const scale = normPhysicalSize.clone().multiply(normRegionSize).multiply(this.settings.scale);
// center of the clip bounds, in the volume's normalized [-0.5, 0.5] local space
const boundsCenter = this.settings.bounds.bmin.clone().add(this.settings.bounds.bmax).multiplyScalar(0.5);
return boundsCenter.multiply(scale).add(this.childObjectsGroup.position);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add childObjectsGroup here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it meant to be a proxy for the volume center?

@interim17 interim17 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also curious about Peyton's question, but seems good!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reset camera resets to unclipped volume

3 participants