计算机图形学图形旋转

计算机图形学| 回转 (Computer Graphics | Rotation)

Rotation is a type of transformation that is very often used in computer graphics and image processing. Rotation is a process of rotating an object concerning an angle in a two-dimensional plane.

旋转是计算机图形和图像处理中经常使用的一种转换类型。 旋转是使物体在二维平面中旋转一定角度的过程。

It is a process of changing the angle of the object which can be clockwise or anticlockwise, while we have to specify the angle of rotation and rotation point. A rotation point is also called a pivot point.

这是改变对象角度的过程,可以顺时针或逆时针旋转,同时我们必须指定旋转角度和旋转点。 旋转点也称为枢轴点。

There are two types of rotations according to the direction of the movement of the object. These are:

根据对象运动的方向,有两种旋转类型。 这些是:

  • Anti-clockwise rotation

    逆时针旋转

  • Clockwise rotation

    顺时针旋转

The positive value of the rotation angle rotates an object in an anti-clockwise direction while the negative value of the rotation angle rotates an object in a clockwise direction. When we rotate any object, then every point of that object is rotated by the same angle. For example, a straight line is rotated by the endpoints with the same angle and the line is re-drawn between the new endpoints. Also, the polygon is rotated by shifting every vertex with the help of the same rotational angle. Same for circle also, it can be obtained by center position by the specified angle.

旋转角的正值使物体沿逆时针方向旋转,而旋转角的负值使物体沿顺时针方向旋转。 当我们旋转任何对象时,该对象的每个点都旋转相同的角度。 例如,一条直线由端点以相同的角度旋转,并且在新端点之间重新绘制该线。 同样,通过在相同旋转角度的帮助下移动每个顶点来旋转多边形。 圆也一样,可以通过中心位置指定角度来获得。

Let's now consider a point object O which has to be rotated from one angle to another.

现在考虑必须从一个角度旋转到另一个角度的点对象O。

  • Initial co-ordinates of the object O = (Xold, Yold)

    对象的初始坐标O =(X old ,Y old )

  • Initial angle of the object O with respect to origin = Φ

    物体O相对于原点的初始角度=Φ

  • Rotation angle = θ

    旋转角度=θ

  • New co-ordinates of the object O after rotation = (Xnew, Ynew)

    旋转后对象O的新坐标=(X new ,Y new )

In order to rotate an object, we need to rotate each vertex of the figure individually. More clearly let us assume a point P, on rotating a point P(x, y) by an angle A about the origin we get a point P' (x', y'). The calculation of values of x' and y' are as follows,

为了旋转对象,我们需要分别旋转图形的每个顶点。 更清楚地让我们假设一个点P ,将点P(x,y)绕原点旋转角度A ,我们得到一个点P'(x',y')x'y'的值的计算如下:

We know that,

我们知道,

    x   = r cosB, y = r sinB
x'  = r cos ( A + B)
= r ( cosA cosB – sinA sinB )
= r cosB cosA – r sinB sinA
= x cosA – y sinA
y'  = r sin ( A + B )
= r ( sinA cosB + cosA sinB )
= r cosB sinA + r sinB cosA
= x sinA + y cosA

It's representation in matrix form will be as follows,

它以矩阵形式表示如下,

Now let's understand this by using an example,

现在让我们通过一个例子来理解这一点,

Problem Statement: Given a triangle with corner coordinates (0, 0), (1, 0) and (1, 1). Rotate the triangle by 90 degrees anticlockwise direction and find out the new coordinates.

问题陈述:给定一个三角形,其角坐标为(0,0),(1、0)和(1,1)。 将三角形逆时针旋转90度,找出新坐标。

Solution:
We always rotate a polygon by rotating each of its vertexes with the same rotation angle.

解:
我们总是通过以相同的旋转角度旋转多边形的每个顶点来旋转多边形。

Given,

鉴于

  • Old corner coordinates of the triangle = A (0, 0), B (1, 0), C (1, 1)

    三角形的旧角坐标= A(0,0),B(1,0),C(1,1)

  • Rotation angle = θ = 90º

    旋转角度=θ=90º

For the Co-ordinate A (0, 0)

对于坐标A(0,0)

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

令旋转后角A的新坐标=(X new ,Y new )。

When we apply the rotation equation, we get-

当我们应用旋转方程式时,我们得到-

Xnew = Xold x cosθ – Yold x sinθ

X = X xcosθ– Y xsinθ

= 0 x cos90º – 0 x sin90º

= 0 xcos90º– 0 xsin90º

= 0 + 0

= 0 + 0

= 0

= 0

Ynew = Xold x sinθ + Yold x cosθ

Y new = X old xsinθ+ Y old xcosθ

= 0 x sin90º + 0 x cos90º

= 0 xsin90º+ 0 xcos90º

= 0 + 0

= 0 + 0

= 0

= 0

Thus, the new co-ordinates of corner A we get after rotation is = (0, 0).

因此,旋转后我们得到的角A的新坐标为=(0,0)。

For the Coordinate B (1, 0)

对于坐标B(1、0)

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

令旋转后角B的新坐标=(X new ,Y new )。

Xnew = Xold x cosθ – Yold x sinθ

X = X xcosθ– Y xsinθ

= 1 x cos90º – 0 x sin90º

= 1 xcos90º– 0 xsin90º

= 0 – 0

= 0 – 0

= 0

= 0

Ynew = Xold x sinθ + Yold x cosθ

Y new = X old xsinθ+ Y old xcosθ

= 1 x sin90º + 0 x cos90º

= 1 xsin90º+ 0 xcos90º

= 1 + 0

= 1 + 0

= 1

= 1

Thus, the new co-ordinates of corner B that we get after rotation are = (0, 1).

因此,旋转后得到的角B的新坐标为=(0,1)。

For the Coordinate C (1, 1)

对于坐标C(1,1)

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

令旋转后角C的新坐标=(X new ,Y new )。

Xnew = Xold x cosθ – Yold x sinθ

X = X xcosθ– Y xsinθ

= 1 x cos90º – 1 x sin90º

= 1 xcos90º– 1 xsin90º

= 0 – 1

= 0 – 1

= -1

= -1

Ynew = Xold x sinθ + Yold x cosθ

Y new = X old xsinθ+ Y old xcosθ

= 1 x sin90º + 1 x cos90º

= 1 xsin90º+ 1 xcos90º

= 1 + 0

= 1 + 0

= 1

= 1

Thus, the new co-ordinates of corner C we get after rotation is = (-1, 1).

因此,旋转后得到的角C的新坐标为=(-1,1)。

Thus, the new co-ordinates of the triangle after rotation are = A (0, 0), B (0, 1), C (-1, 1).

因此,旋转后三角形的新坐标为= A(0,0),B(0,1),C(-1,1)。

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

计算机图形学图形旋转

计算机图形学图形旋转_计算机图形学中的旋转相关推荐

  1. 计算机图形学图形旋转_计算机图形学中的平板显示

    计算机图形学图形旋转 平板显示器 (Flat Panel Display) It is generally known as FPD, the flat-panel display is such a ...

  2. 计算机图形学图形旋转_计算机图形学翻译

    计算机图形学图形旋转 计算机图形学| 翻译 (Computer Graphics | Translations) Transformation techniques mean to modify th ...

  3. 计算机图形学有很多应用,计算机图形学的论文_计算机图形学有很多应用_计算机科学与技术的论文...

    本人数学系,想考计算机图形学的研究生,请问我毕业论文改选下面哪项(无... 图形学里用到的数学知识主要是微积分(必备基础),线性代数(模型变换的基础),最优化理论与方法(写论文做研究的基础),微分几何 ...

  4. 视觉传达设计怎么利用计算机思维,图形创意在视觉传达设计中的运用策略

    柴凯旋 摘要:进入二十一世纪以来,我国的科学技术水平不断进步,目前,图形属于视觉传达设计中的基本要素,其主要就是将图形的形式作为信息传递载体,最终以艺术的形式将信息表现出来.图形创意相对比较新颖,其与 ...

  5. 计算机体系结构:嵌入式方法_计算机考研——计算机二级学科详解

    在考研选择专业的时候,可以看到"计算机科学与技术"是一级学科,下面还有三个二级学科,分别叫"计算机系统结构" "计算机软件与理论" &quo ...

  6. 计算机组成原理哈工大期末_计算机组成原理(哈工大)——课程知识点总结

    问题:电路是如何组成计算机的? 一.计算机的体系结构 冯诺依曼提出:计算机必须有输入.输出.存储器.运算器和控制器五个组成部分.还提出"二进制"和"程序存储" ...

  7. 计算机二级mysql难度_计算机二级科目怎么选 科目难度排名

    计算机二级考试是计算机等级考试中,重要的一个级别考试.通过了二级考试是有很多好处的.计算机二级包括很多科目,该怎么选择科目们? 计算机二级科目怎么选 (1)作为一个非计算机专业的在校生,建议在VF和V ...

  8. opengl正方形绕点旋转_中考热点:再说旋转动点问题中的最值问题之提分攻略

    初中几何三大解题思想:平移.对称.旋转.旋转算是其中最高阶的解题思想,用到压轴的几何题中,难度最大,尤其旋转动点问题中的最值问题更是与众不同,一般题目有一定难度,解题方法灵活多变.从选择到填空.解答的 ...

  9. 有关计算机组成原理知识的论文,关于计算机组成原理的论文_计算机组成原理_图灵机的组成...

    懂计算机组成原理的朋友进,帮帮我啊! 2演示<闪速存储器及技术>.首先是多媒体的组成,图声字,二是计算机的组成,主板,CPU,内存.三电脑读文件的过程 CPU将多媒体文件有硬盘调入内存,再 ...

最新文章

  1. 【Qt】QCloseEvent的使用小结
  2. h5引入不同的js文件怎样让第二个js使用第一个js文件中的函数_px2rem-loader使用及注意事项...
  3. MySQL之父直播公开课来了!与腾讯云CDB专家天团联袂分享
  4. java中负数取整_Java取整,固定保留两位小数,适配负数、金融数字。
  5. 安装、部署DPM 2012 R2服务器
  6. html5发布原文,HTML5 第二份草案发布
  7. vSAN 6.7培训_第1章-Virtual SAN各版本功能介绍
  8. xx云网络实施方案案例
  9. PostgreSQL数据库的安装与配置
  10. wxnativecallback.php,ectouch开发 | 糊涂虫
  11. 关于NLPIR在MAC上的使用
  12. 会计从业人员管理系统_湖南省会计从业人员网上服务大厅
  13. 【UI】常见基础知识整理
  14. 学生学号判断专业班级
  15. 如何屏蔽掉某网址不能访问
  16. 关于matlab兼容性win10系统,详解win10系统运行不了matlab10软件的办法
  17. specCPU 2006 备忘
  18. 综述:人类电生理的脑连接组学
  19. 波轮普通洗衣机的构成和基本工作原理
  20. fastboot 模式下刷入Recovery

热门文章

  1. 计算机开机启动过程详解
  2. 什么是云虚拟主机_云虚拟主机有什么用
  3. 实验四 手写数字识别的神经网络算法设计与实现
  4. 机器学习笔记 - JigsawNet论文解读
  5. 深度Linux 安装英伟达闭源驱动,deepin20 安装英伟达闭源驱动的步骤详解
  6. 驰骋BPM系统-表单引擎-流程引擎 页面更换
  7. 基于角色管理的系统访问控制
  8. 美通社企业新闻汇总 | 2019.2.27 | 中国大学名次在世界大学排名中继续攀升;吉利2021年发布支持5G量产车型...
  9. 江湖笑(2006[神雕侠侣]片尾主题曲)铃声 江湖笑(2006[神雕侠侣...
  10. 适合大学生查答案的公众号