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

坐标转换 计算机图形学

什么是转型? (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

翻译自: https://www.includehelp.com/computer-graphics/types-of-transformations.aspx

坐标转换 计算机图形学

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/378567.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

win2003 IIS6配置PHP 5.3.3(fastCGI方式+eAccelerator)+ASP.NET 4.0(MVC3)

win2003 IIS6配置PHP 5.3.3(fastCGI方式eAccelerator)ASP.NET 4.0(MVC3) 直入正题。 这个环境的部署很有讲究,折腾了一天,大概说一下思路: 自从哪个PHP的版本开始(5.2也不知道多少),就分了thread-safe版和n…

03-图像特效

一、灰度处理 方法一:imread方法 彩色图的颜色通道为3,即RGB;而灰度图只有一个颜色通道。 import cv2 img0 cv2.imread(E:\Jupyter_workspace\study\data/cat.png,0) img1 cv2.imread(E:\Jupyter_workspace\study\data/cat.png,1) print…

解析linux根文件系统的挂载过程

------------------------------------------ 本文系本站原创,欢迎转载!转载请注明出处:http://ericxiao.cublog.cn/------------------------------------------ 一:前言前段时间在编译kernel的时候发现rootfs挂载不上。相同的root选项设置旧版的image却可以。为了…

SIFT讲解(SIFT的特征点选取以及描述是重点)

目录SIFT是什么?尺度空间理论SIFT特征点提取SIFT特征点描述SIFT是什么? SIFT ,即尺度不变特征变换( Scale-invariant feature transform,SIFT) ,一种特征描述方法。具有 尺度鲁棒性 旋转鲁棒性 光照鲁棒性 SIFT本身包括了特征点筛选及特征点…

操作系统多线程实现_操作系统中的线程实现

操作系统多线程实现Each process has an address space. There is one thread of control in every traditional OS. Sometimes, it is viable to have multiple threads of control in the similar address space which is running in quasi-parallel. Though they were separ…

mysql怎么消除冗余,mysql剔除冗余数据

mysql删除冗余数据-- -- 1. 查询冗余数据SELECT t.id FROM t_lifeservice_orders t WHERE t.orderStatus 2 GROUP BY t.channelCode, t.orderNum, t.orderStatus HAVING COUNT(t.orderStatus) > 1;-- -- 2. 定义删除冗余数据存储过程DROP PROCEDURE IF EXISTS proc_delete_…

04-图像的形状绘制

一、线段绘制 cv2.line(dst,(100,100),(400,400),(0,0,255),2,cv2.LINE_AA) 参数一:目标图片数据 参数二:当前线段绘制的起始位置(也就是两点确定一条直线) 参数三:当前线段绘制的终止位置(也就是两点确定…

(1-e^(-j5w))/(1-e^(-jw))=e^(-j2w)*sin(5w/2)/sin(w/2)的证明过程

问题出现:《数字信号处理第三版》第90页刘顺兰版 最后一步怎么得到的? 思路:观察答案,有一个自然对数项。关键就是如何提取出这一项。 我的证明过程如下: 参考链接: 【和差化积】

php 移植 arm 精简,php5.4.5移植到arm-linux摘要,lighttpd配置

php5.4.5移植到arm-linux摘要.因为有嵌入WEB服务的需求,再常识了N多的开源的嵌入服务后最终选择了lighttpd.Apache太大支了,而且在arm上对swf的支持不好.其他的都不怎么理想.lighttpd的移植过程就省略了。这里只摘要了PHP移植,采用fastcgi与lighttpd 协作…

05-图像的美化

一、彩色图片直方图 cv2.calcHist([image],[0],None,[256],[0.0,255.0]) 该方法的所有参数都必须用中括号括起来!!! 参数一:传入的图片数据 参数二:用于计算直方图的通道,这里使用的是灰度直方图&#xff…

java 检查目录是否存在_如何检查Java目录是否存在?

java 检查目录是否存在We are using the File class that is an abstract representation of file and directory path. To check if a directory exists we have to follow a few steps: 我们正在使用File类 ,它是文件和目录路径的抽象表示。 要检查目录是否存在&a…

Eclipse for android 中设置java和xml代码提示功能(转)

1、设置 java 文件的代码提示功能 打开 Eclipse 依次选择 Window > Preferences > Java > Editor - Content Assist > Auto activation triggers for Java ,设置框中默认是一个点, 现在将它改为: 以下为引用内容: .a…

MySQL 定时器EVENT学习

MySQL 定时器EVENT学习 MySQL从5.1开始支持event功能,类似oracle的job功能。有了这个功能之后我们就可以让MySQL自动的执行数据汇总等功能,不用像以前需要操作的支持了。如linux crontab功能 。 创建测试表CREATE TABLE t( v VARCHAR(100) NOT NULL…

如何利用FFT(基2时间以及基2频率)信号流图求序列的DFT

直接用两个例子作为模板说明: 利用基2时间抽取的FFT流图计算序列的DFT 1、按照序列x[k]序号的偶奇分解为x[k]和x2[k],即x1[k]{1,1,2,1}, x2[k]{-1,-1,1,2} 2、画出信号流图并同时进行计算 计算的时候需要参考基本蝶形单元: 关键在于 (WN) k…

matlab4.0,matlab 4.0

4.1fort-9:0.5:9if(t>0)y-(3*t^2)5;fprintf(y%.2ft%.2f\n,y,t);elsey(3*t^2)5;fprintf(y%.2ft%.2f\n,y,t);endend编译结果:y248.00t-9.00y221.75t-8.50y197.00t-8.00y173.75t-7.50y152.00t-7.00y131.75t-6.50y113.00t-6.00y95.75t-5.50y80.00t-5.00y65.75t-4.50y…

图形学 射线相交算法_计算机图形学中的阴极射线管

图形学 射线相交算法阴极射线管 (Cathode Ray Tube) Ferdinand Barun of Strasbourg developed the cathode ray tube in the year 1897. It used as an oscilloscope to view and measure some electrical signals. But several other technologies exist and solid state mov…

Constructor总结

一个类如果没有构造那么系统为我们在背后创建一个0参数的构造,但是一旦我们创建了但参数的构造,那么默认的构造就没了。 View Code 1 using System;2 using System.Collections.Generic;3 using System.Linq;4 using System.Text;5 6 namespace Console…

Python连接MySQL及一系列相关操作

一、首先需要安装包pymysql(python3所对应) 我使用的是Anaconda全家桶,打开cmd,进入Anaconda下的Scripts文件夹下输入命令:pip install pymysql进行下载安装 二、我使用的编译器为Anaconda所带的Jupyter Notebook 1,在mysql中…

微机原理—可编程计数器/定时器8253概念详解

目录前言【1】定时处理方法1、定时的方法:2、定时和计数器【2】8253计数/定时器1、特点:2、芯片引脚以及电路:3、连接方式:4、工作原理:5、寄存器配置a、初始化操作(三个通道单独初始化)b、读出…

php静态分析工具window,window_SpeedPHP框架核心调试工具,在日常的编程开发当中,开发 - phpStudy...

SpeedPHP框架核心调试工具在日常的编程开发当中,开发者经常会使用到对变量的调试,而sp框架提供的变量调试输出函数——dump正好满足了变量调试的需求。下面来介绍一下dump函数的使用方法。dump —— 变量格式化输出函数用法:dump($vars, $out…