File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
Sources/Rendering/OpenGL/ImageResliceMapper Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -514,16 +514,9 @@ function vtkOpenGLImageResliceMapper(publicAPI, model) {
514
514
// Set the world->texture matrix
515
515
if ( program . isUniformUsed ( 'WCTCMatrix' ) ) {
516
516
const image = model . currentInput ;
517
- mat4 . identity ( model . tmpMat4 ) ;
518
- const bounds = image . getBounds ( ) ;
519
- const sc = [
520
- bounds [ 1 ] - bounds [ 0 ] ,
521
- bounds [ 3 ] - bounds [ 2 ] ,
522
- bounds [ 5 ] - bounds [ 4 ] ,
523
- ] ;
524
- const o = [ bounds [ 0 ] , bounds [ 2 ] , bounds [ 4 ] ] ;
525
- const q = [ 0 , 0 , 0 , 1 ] ;
526
- mat4 . fromRotationTranslationScale ( model . tmpMat4 , q , o , sc ) ;
517
+ const dim = image . getDimensions ( ) ;
518
+ mat4 . copy ( model . tmpMat4 , image . getIndexToWorld ( ) ) ;
519
+ mat4 . scale ( model . tmpMat4 , model . tmpMat4 , dim ) ;
527
520
mat4 . invert ( model . tmpMat4 , model . tmpMat4 ) ;
528
521
if ( inverseShiftScaleMatrix ) {
529
522
mat4 . multiply ( model . tmpMat4 , model . tmpMat4 , inverseShiftScaleMatrix ) ;
You can’t perform that action at this time.
0 commit comments