ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

以某特定点缩放

2022-05-12 10:33:36  阅读:190  来源: 互联网

标签:origin object point 缩放 yf Scaling 特定 Fixed


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

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有