博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
坐标转换 计算机图形学_计算机图形学的转换类型
阅读量:2532 次
发布时间:2019-05-11

本文共 3695 字,大约阅读时间需要 12 分钟。

坐标转换 计算机图形学

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

Transformation refers 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:

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

  1. Translation

    翻译

  2. Rotation

    回转

  3. Scaling

    缩放比例

  4. Reflection

    反射

  5. 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

翻译自:

坐标转换 计算机图形学

转载地址:http://brxzd.baihongyu.com/

你可能感兴趣的文章
实验二
查看>>
shell——按指定列排序
查看>>
crash 收集
查看>>
507 LOJ 「LibreOJ NOI Round #1」接竹竿
查看>>
UI基础--烟花动画
查看>>
2018. 2.4 Java中集合嵌套集合的练习
查看>>
精通ASP.NET Web程序测试
查看>>
vue 根据不同属性 设置背景
查看>>
51Nod1601 完全图的最小生成树计数 Trie Prufer编码
查看>>
Codeforces 1110D. Jongmah 动态规划
查看>>
android驱动在win10系统上安装的心酸历程
查看>>
优雅的程序员
查看>>
oracle之三 自动任务调度
查看>>
Android dex分包方案
查看>>
ThreadLocal为什么要用WeakReference
查看>>
删除本地文件
查看>>
FOC实现概述
查看>>
base64编码的图片字节流存入html页面中的显示
查看>>
这个大学时代的博客不在维护了,请移步到我的新博客
查看>>
GUI学习之二十一——QSlider、QScroll、QDial学习总结
查看>>