其他分享
首页 > 其他分享> > 以某特定点缩放

以某特定点缩放

作者:互联网

Fixed Point Scaling in Easy Steps with Important Example
March 17, 2021 / Computer Graphics, Computer Science, Gate preparation, UGC-NET preparation / Leave a Comment
The Scaling that we were performing up till now is actually 2D Scaling about the origin. We can also perform Fixed-Point Scaling. That is scaling about a point other than the origin. Fixed-Point Scaling can be performed easily with the help of a sequence of operations.

Suppose the Fixed-Point is ( xf, yf ). Then
Philadelphia's Magic Gardens. This place was so cool!

Translate the whole object such that the fixed point coincides with the origin. That is you have to shift each and every vertex of the object by the factor xf, yf. If we are moving it towards the left then the sign will be negative. So, we can express it as :
O’ = T ( -xf, -yf ) . O

Philadelphia's Magic Gardens. This place was so cool!

  1. Now, we will perform scaling about origin. And remember that origin and fixed-point are actually same at this instant. Since we have shifted the whole object.

O” = S ( sx, sy ) . O’
Philadelphia's Magic Gardens. This place was so cool!

  1. We can not keep the object where it is. We will shift it back to its original position. If we are moving it towards right then translation factors will be positive.

O”’ = T( xf, yf) . O”
Philadelphia's Magic Gardens. This place was so cool!
fixed point scaling
We can arrange all these matrices and then we can perform the composite transformation. Remember to perform all the transformations from right to left. Left-most being the object matrix. Also, remember Matrix multiplication is associative but not commutative.
Philadelphia's Magic Gardens. This place was so cool!

This fixed-point may be inside the object which we are going to scale. It may be outside also. Now, we are ready to solve a numerical on fixed point scaling. We can also derive a composite matrix by multiplying all these matrices and then we just have to put the values in that matrix.

•There is a triangle ABC A(4,6) B(2,2)C(6,2). Scale the image thrice as large about the point (4,4).

Solution: We have

xf=4 yf=4

sx=3 sy=3

1.Translate to origin T(-4,-4).

  1. Then Scale S(3,3)

3.Translate back to original position T(4,4)

Philadelphia's Magic Gardens. This place was so cool!

Fixed point scaling solution
Fixed Point Scaling

标签:origin,object,point,缩放,yf,Scaling,特定,Fixed
来源: https://www.cnblogs.com/ultramanX/p/16261356.html