Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Matrix in css3

2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

Most people do not understand the knowledge points of this article "how to use matrices in css3", so the editor summarizes the following contents, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to use matrices in css3" article.

The change of css3 matrix. The application format is:

Transform: matrix (a _

It corresponds to:

The transformations in practical applications are:

Where:

Ax+cy+e = Abscissa

Bx+dy+f = ordinate

Why is there an extra 0 01? Because, in order to put together the parameters.

Translate matrix

The basic format is:

Transform: matrix (1,0,0,1, X, Y); / / X Transverse Translation, Y Longitudinal Translation

Scale matrix

The scale matrix is also quite simple.

/ / scale the X axis A times / / scale the Y axis B times matrix (A, 0P 0, B, 0 P 0)

Of course, if you write a number in the last two digits, it means zoom and then pan.

/ / get: X axis = 0.3cm x + 100ppm / get: y axis = 0.2cm x + 200matrix (0.3jing0jing0meme 0.2100200)

Rotate matrix

Rotate actually has a lot to do with trigonometric functions. First, determine your rotation angle (clockwise). Then, sin θ and cos θ are calculated. The final matrix formula is:

Matrix (cos θ, sin θ,-sin θ, cos θ, 0meme0) / / is cs-sc

Skew matrix

The skew (stretch) matrix is also a trigonometric function, but tan θ is used. The format is:

/ / tilt the Y axis to the X axis A °/ / tilt the X axis to the Y axis B °matrix (1Magi tan (A), tan (B), 1J 0J 0)

3D transformation matrix

The 3 D transformation is a matrix of 4 to 4. It is similar to 2D, except that it has an extra Z. / / this is a scaled 3D matrix.

The corresponding css is written as follows:

Transform: matrix3d (sx, 0,0,0,0, sy, 0,0,0,0, sz, 0,0,0,0,1) above is about the content of this article "how to use matrices in css3". I believe you all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report