计算机图形z轴缩放_缩放计算机图形学

计算机图形z轴缩放

计算机图形学| 缩放比例 (Computer Graphics | Scaling)

Scaling is a process of modifying or we can say changing the size of objects. It is a type of transformation through which we can zoom in or zoom out any particular object or shape.

缩放是修改的过程,或者可以说是更改对象的大小。 这是一种变换类型,通过它我们可以放大或缩小任何特定的对象或形状。

We can say that it is the process of expanding or compressing the dimension of an object. There are two factors used in scaling transformation i.e. Sx and Sy, where Tx is a scale factor for the co-ordinates, and Ty is the scale factor for the Y coordinates. Whereas, scaling changes the size of an object and involves two scale factors, Sx and Sy for the x- and y- coordinates respectively.

我们可以说这是扩展或压缩对象尺寸的过程。 在比例转换中使用两个因子,即SxSy ,其中Tx是坐标的比例因子,Ty是Y坐标的比例因子。 而缩放会改变对象的大小,并涉及两个比例因子,分别为x和y坐标SxSy

If Sx and Sy are equal it is also called Uniform Scaling, If not equal then it is called Differential Scaling.

如果SxSy相等,则也称为均匀缩放;如果不相等,则称为差分缩放。

Points to remember:

要记住的要点:

Scales are about the origin.

尺度与原点有关。

We can write them as

我们可以写成

    X' = sx • Xold
    Y' = sy • Yold

In matrix form it is written as follows:

以矩阵形式编写如下:

    P' = S • P 

scaling

Suppose if scaling factors with values less than one will move the object closer to co-ordinate origin, while a value higher than one will move co-ordinate position farther from the origin.

假设如果缩放因子的值小于1,则对象将移动到更靠近坐标原点的位置,而值大于1的值将使坐标位置移动到更远离原点的位置。

Now let's understand with the help of a figure.

现在让我们借助人物来理解。

scaling

More accurately we can say that scaling can be used to increase or decrease which is reduce the size of the object. Scaling subjects to the co-ordinate points of the original object are to be changed. Here scaling factor determines whether the size of the object is to be increase or decrease.

更准确地说,我们可以说缩放可用于增加或减少,即减小对象的大小。 缩放对象到原始对象的坐标点将被更改。 在此,缩放因子确定对象的大小是要增加还是要减小。

One thing which we should keep in mind and which is going to make scaling easier for us to remember:

我们应该牢记的一件事将使缩放更容易记住:

  • If the scaling factor > 1, then the object size is increased, i.e., we zoom in.

    如果缩放因子> 1,则将增加对象大小,即我们放大。

  • If the scaling factor < 1, then the object size is decreased, i.e. we zoom out.

    如果比例因子<1,则对象尺寸减小,即缩小。

Now let's see the same with the help of an example:

现在,借助示例,我们看到相同的内容:

Example:

例:

Problem Statement: Given a square object with co-ordinate points A (0, 3), B (3, 3), C (3, 0), D (0, 0). Apply the scaling parameter 2 towards X axis and 3 towards Y axis and obtain the new co-ordinates of the object.

问题陈述:给定具有坐标点A(0,3),B(3,3),C(3,0),D(0,0)的正方形对象。 将缩放参数2应用于X轴,将3应用于Y轴,并获得对象的新坐标。

Solution:

解:

Given,

鉴于

  • Old corner coordinates of the square = A (0, 3), B (3, 3), C (3, 0), D (0, 0)

    正方形的旧角坐标= A(0,3),B(3,3),C(3,0),D(0,0)

  • Scaling factor along X axis = 2

    沿X轴的缩放比例= 2

  • Scaling factor along Y axis = 3

    沿Y轴的缩放系数= 3

For the Coordinate A (0, 3):

对于坐标A(0,3):

Let the new coordinates of corner A after scaling = (Xnew, Ynew).

缩放后让角A的新坐标=(X new ,Y new )。

When we apply the scaling equation, we get,

当我们应用比例方程时,我们得到,

Xnew = Xold x Sx = 0  x 2 = 0
Ynew = Yold x Sy = 3 x 3 = 9

X = X x S x = 0 x 2 = 0
Y = Y x S y = 3 x 3 = 9

Thus, the new coordinates of corner A after scaling = (0, 9).

因此,缩放后角A的新坐标=(0,9)。

For the Coordinate B (3, 3):

对于坐标B(3,3):

Let the new coordinates of corner B after scaling = (Xnew, Ynew).

缩放后让角B的新坐标=(X new ,Y new )。

When we apply the scaling equation, we get-

当我们应用比例方程时,我们得到-

Xnew = Xold x Sx = 3  x 2 = 6
Ynew = Yold x Sy = 3 x 3 = 9

X = X x S x = 3 x 2 = 6
Y = Y x S y = 3 x 3 = 9

Thus, the new coordinates of corner B after scaling = (6, 9).

因此,缩放后角B的新坐标=(6,9)。

For the Coordinate C (3, 0):

对于坐标C(3,0):

Let the new coordinates of corner C after scaling = (Xnew, Ynew).

缩放后让角C的新坐标=(X new ,Y new )。

When we apply the scaling equation, we get-

当我们应用比例方程时,我们得到-

Xnew = Xold x Sx = 3 x 2 = 6
Ynew = Yold x Sy = 0 x 3 = 0

X = X x S x = 3 x 2 = 6
Y = Y x S y = 0 x 3 = 0

Thus, the new coordinates of corner C after scaling = (6, 0).

因此,缩放后角C的新坐标=(6,0)。

 For the Coordinate D (0, 0):

对于坐标D(0,0):

Let the new coordinates of corner D after scaling = (Xnew, Ynew).

缩放后让角D的新坐标=(X new ,Y new )。

When we apply the scaling equation, we get-

当我们应用比例方程时,我们得到-

Xnew = Xold x Sx = 0  x 2 = 0
Ynew = Yold x Sy = 0 x 3 = 0

X = X x S x = 0 x 2 = 0
Y = Y x S y = 0 x 3 = 0

Thus, the new coordinates of corner D after scaling = (0, 0).

因此,缩放后角D的新坐标=(0,0)。

Thus, New coordinates of the square after Aaplying the scaling parameter 2 towards X axis and 3 towards Y axis are = A (0, 9), B (6, 9), C (6, 0), D (0, 0).

因此,在将缩放参数2朝向X轴和3朝向Y轴适应后,正方形的新坐标为= A(0,9),B(6,9),C(6,0),D(0,0) 。

翻译自: https://www.includehelp.com/computer-graphics/scaling.aspx

计算机图形z轴缩放

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值