2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > 坐标转换 计算机图形学_计算机图形学的转换类型

坐标转换 计算机图形学_计算机图形学的转换类型

时间:2019-09-04 22:13:49

相关推荐

坐标转换 计算机图形学_计算机图形学的转换类型

坐标转换 计算机图形学

什么是转型? (What is Transformation?)

Transformationrefers to the mathematical operations or rules that are applied on a graphical image consisting of the number of lines, circles, and ellipses to change its size, shape, or orientation. It can also reposition the image on the screen.

转换是指应用于图形图像的数学运算或规则,这些图形由线,圆和椭圆的数量组成,以更改其大小,形状或方向。 它还可以将图像重新放置在屏幕上。

Transformations play a very crucial role in computer graphics.

转换在计算机图形学中起着至关重要的作用。

转换类型 (Types of Transformations)

There are various types of transformations in computer graphics through which an image can be processed, edited ad altered. Some basic and most commonly used types of these transformations are:

计算机图形学中有各种类型的转换,可以通过这些转换来处理图像,编辑和更改图像。 这些转换的一些基本且最常用的类型是:

Translation

翻译

Rotation

回转

Scaling

缩放比例

Reflection

反射

Shearing

剪力

翻译 (Translation)

Translation refers to a technique in which a point is shift from one place to another, whose distance is known.

翻译是指一种技术,在该技术中,一个点从一个位置移动到另一个位置,该位置的距离是已知的。

Consider a point A(x1, y1) be shifted to another point B (x2, y2). Now we only know the shifting distance tx along x-axis and ty along y-axis.

考虑将点A(x 1 ,y 1 )移到另一个点B(x 2 ,y 2 )。 现在我们只知道沿x轴和叔ÿ沿y轴的换档距离t X。

Now, the new coordinates (x2, y2) can be calculated as:

现在,新的坐标(x 2 ,y 2 )可以计算为:

x2 = x1 + tx

x 2 = x 1 + t x

y2 = y1 + ty

y 2 = y 1 + t y

For example:

例如:

Suppose we want to shift a point with coordinates at A(30,100) and distance along x-axis is 10 units and 20 units along y-axis.

假设我们要移动一个坐标为A(30,100)的点,并且沿x轴的距离为10个单位,沿y轴的距离为20个单位。

Using translation:

使用翻译:

Here tx = 10 ;

这里t x = 10;

and ty = 20

且y = 20

New coordinates A’ (x2, y2):

新坐标A ' (x 2 ,y 2 ):

x2 = 30 + 10 = 130

x 2 = 30 + 10 = 130

y2 = 100 + 20 = 120

y 2 = 100 + 20 = 120

The point will be shifted to A’ (130, 120 ).

该点将移至A ' (130,120)。

回转 (Rotation)

Rotation refers to mathematical operation in which the graphical object is rotated about an angle (θ) to the axis.

旋转是指数学操作,其中图形对象相对于轴旋转角度(θ)。

Rotation is of two types: anti-clockwise and clockwise rotation.

旋转有两种类型:逆时针旋转和顺时针旋转。

Suppose we want to rotate a point with coordinates A (x1, y1) clockwise through an angle θ about the origin

假设我们要绕着原点将坐标A(x 1 ,y 1 )的点顺时针旋转角度θ

Then the new coordinates A’ (x2, y2):

然后,新坐标A ' (x 2 ,y 2 ):

x2 = x1 cosθ + y1 sinθ

×2 = X 1 +COSθY 1SINθ

y2 = x1 sinθ - y1 cosθ

Y 2 = X 1SINθ - Y 1个 COSθ

缩放比例 (Scaling)

Scaling refers to a mathematical rule applied to change the size of the image.

缩放是指用于更改图像大小的数学规则。

If the value of scaling factors is negative, the size is decreased and when the value is positive, the size of the image is increased.

如果缩放因子的值为负,则减小大小,而当值为正时,增大图像的大小。

Suppose the point with coordinates A (x1, y1) is to be scaled by a factor sx along the x-axis and sy along the y-axis.

假设坐标为A(x 1, y 1 )的点沿x轴缩放系数s x,沿y轴缩放y。

Hence the new coordinates after scaling will be:

因此,缩放后的新坐标将为:

x2 = x1 x sx

x 2 = x 1 xs x

y2 = y1 x sy

y 2 = y 1 xs y

Translation, rotation and scaling are termed as basic translations.

平移,旋转和缩放称为基本平移。

其他转变 (Other Transformations)

The other two transformation techniques are as follows,

其他两种转换技术如下:

反射 (Reflection)

Reflection refers to the mirror image of the original graphical object. It is an 180o rotation operation.

反射是指原始图形对象的镜像。 这是一个180 o的旋转操作。

Reflection can be done about following ways:

可以通过以下方式进行反思:

x-axis

X轴

y-axis

y轴

the origin and

起源和

A plane perpendicular to the origin

垂直于原点的平面

剪力 (Shearing)

Shearing is a transformation in which the shape of the object is slanted about the axis.

剪切是一种变换,其中对象的形状围绕轴倾斜。

In y-shearing:

在y剪切中:

The new-coordinates will be:

新的坐标将是:

x' = x

X' = x

y' = y + sy x

' = y + s y x

In x-shearing:

在x剪切中:

The new-coordinates will be:

新的坐标将是:

x' = x + sx y

x ' = x + s x y

y' = y

y'= y

翻译自: /computer-graphics/types-of-transformations.aspx

坐标转换 计算机图形学

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。