Pre and Post

Of course, these are just the tip of the iceberg. There are several more that may prove to be useful to you. Each of them also has a pre and a post version. These enable you to do more than one transformation at a time in sequence. For instance, you could do a preScale and then setRotate or a setScale and then postRotate. Changing the order of when they occur could yield vastly different results depending on the operations performed. Figure 3-11 shows the results of the following two method calls.

matrix.setScale(1.5f, 1);

matrix.postRotate(15,bmp.getWidth()/2,bmp.getHeight()/2);

matrix.setScale(1.5f, 1);

matrix.postRotate(15,bmp.getWidth()/2,bmp.getHeight()/2);

Matrix Postrotate
Figure 3-11. Scaled and rotated

Was this article helpful?

0 0

Post a comment