Detailed explanation of the calling sequence of set, pre and post of matrix

When matrix calls a series of set, pre and post methods, it can be regarded as inserting these methods into a queue. Of course, the execution is called from beginning to end in the queue.

Where pre means to insert a method at the head of the queue, and post means to insert a method at the end of the queue. Set means to empty the current queue, and it is always in the middle of the queue. After a set is executed: the pre method is always inserted into the front of the queue at the front of the set, and the post method is always inserted into the back of the queue at the back of the set.

Example 1:

Only m.settranslate (80,80) is valid because m.setrotate (45); Is cleared

Example 2:

Execute m.settranslate (80,80) first; After that, execute m.postrotate (45);

Example 3:

Execute m.settranslate (80,80) first; Execute M. prerotate (45) after;

Example 4:

Execution sequence: m.pretranslate (50F, 20f) - > m.prescale (2f, 2f) - > m.postscale (0.2f, 0.5f) - > m.posttranslate (20f, 20f)

Note: m.pretranslate (50F, 20f) executes before m.prescale (2f, 2f) because it finds the front end of the queue

Example 5:

Execution order: m.pretranslate (0.5f, 0.5f) - > m.setscale (0.8f, 0.8f) - > m.postscale (3F, 3f)

Note: m.setscale (0.8f, 0.8f) clears the previous m.posttranslate (20,20) and m.prescale (0.2f, 0.5f);

The above detailed explanation of the calling sequence of set, pre and post of the matrix is all the content shared by Xiaobian. I hope it can give you a reference and support more programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>