Skip to content

Conversation

@jadh4v
Copy link
Collaborator

@jadh4v jadh4v commented Dec 2, 2025

Context

The transformation matrices of each glyph should undergo the same shift-scale transform as the input points array of the Glyph3DMapper. However, this transform was being incorrectly calculated in Glyph3DMapper. This issue was fixed by ensuring that there is a single source (function) for the calculation of the shift-scale matrix (or its inversion).

Results

The glyphs are now again visible in the ResliceCursorWidget example.
image

Changes

  • Documentation and TypeScript definitions were updated to match those changes

PR and Code Checklist

  • semantic-release commit messages
  • Run npm run reformat to have correctly formatted code

Testing

  • This change adds or fixes unit tests
  • Tested environment:
    • vtk.js:
    • OS:
    • Browser:

@jadh4v jadh4v requested review from finetjul and sankhesh December 2, 2025 01:34
@jadh4v jadh4v marked this pull request as ready for review December 2, 2025 01:34
Copy link
Collaborator

@sankhesh sankhesh left a comment

Choose a reason for hiding this comment

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

LGTM

@sankhesh sankhesh requested a review from Copilot December 2, 2025 04:14
Copilot finished reviewing on behalf of sankhesh December 2, 2025 04:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in Glyph3DMapper where the shift-scale transformation was being incorrectly applied to glyph transformation matrices. The fix consolidates the shift-scale matrix calculation into a single source function and uses proper matrix multiplication instead of component-wise operations.

Key Changes:

  • Replaced incorrect component-wise shift-scale application with proper matrix multiplication in Glyph3DMapper
  • Refactored computeInverseShiftAndScaleMatrix into a shared helper function
  • Fixed GUI controller reference in ResliceCursorWidget example to use lil-gui API

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
Sources/Rendering/OpenGL/Glyph3DMapper/index.js Removed incorrect applyShiftScaleToMat function and replaced with proper matrix multiplication using computeInverseShiftAndScaleMatrix helper
Sources/Rendering/OpenGL/CellArrayBufferObject/helpers.js Added computeInverseShiftAndScaleMatrix as an exported helper function with necessary gl-matrix imports
Sources/Rendering/OpenGL/CellArrayBufferObject/index.js Refactored to import computeInverseShiftAndScaleMatrix from helpers module, removing duplicate implementation
Sources/Widgets/Widgets3D/ResliceCursorWidget/example/index.js Updated GUI controller reference to store and use lil-gui controller object instead of DOM element

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@finetjul finetjul left a comment

Choose a reason for hiding this comment

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

LGTM
It would have been good to explain in git commit message why the transform was previously incorrect.

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.

[Bug] ResliceCursorWidgetExample is obscured by axis colors

3 participants