public Matrix4d getRepeatTransform ( int repeat ) { Matrix4d transform = new Matrix4d ( ) ; transform . setIdentity ( ) ; int [ ] counts = getAxisCounts ( repeat ) ; for ( int t = counts . length - 1 ; t >= 0 ; t -- ) { if ( counts [ t ] == 0 ) continue ; Matrix4d axis = new Matrix4d ( axes . get ( t ) . getOperator ( ) ) ; for ( int i = 0 ; i < counts [ t ] ; i ++ ) { transform . mul ( axis ) ; } } return transform ; }
Return the transformation that needs to be applied to a repeat in order to superimpose onto repeat 0 .