How does concatenation of matrices makes sense when defining operators? Why are there even 3 dimensional matrices when we are dealing with 2 dimensions? I feel really stupid asking this but I lack any kind of information about this even though I'm quite familiar with vector analysis and algebra... Why aren't just the transformation or scaling matrices multiplied and then applied as an operator to the coordinates?
I'm trying to make a zoom-to-mouse feature to my already translatable-by-mouse grid and for 2 days I just can't. Is there a way to use setTranslate or setScale on the transformer without resetting the already existing operator? How does the composition of concatenation work?
EDIT Finally I got the zoom-to-and-from-a-point algorithm right... The trick is to apply translations that are dependent on the zoomLevel itself before you apply anything else, while saving the previous operator: (In case someone is interested in this..)
AffineTransform savedTransform = new AffineTransform(transformer);
AffineTransform tempTransform = new AffineTransform();
tempTransform.translate(-0.25*(mouseX-transOfGridXD-game.curWS*sF*sqSize/2), -0.25*(mouseY-transOfGridYD-game.curWS*sF*sqSize/2)); //sF is the zoom level, game.curWS*sqSize is the grid size in pixels, transOfGrid is the translation of the transform
tempTransform.concatenate(savedTransform);
transformer.setTransform(tempTransform );
transformer.translate(-(game.curWS)*sqSize*0.125, -(game.curWS)*sqSize*0.125);
transformer.scale(1.25, 1.25);