计算机图形学图形旋转_计算机图形学翻译
計算機圖形學圖形旋轉
計算機圖形學| 翻譯 (Computer Graphics | Translations)
Transformation techniques mean to modify the current shape or object in a particular manner. Changing of an object after creation, in terms of position or even size is known as translation. Here, we will be studying about how 2D translation is performed in computer graphics.
轉換技術意味著以特定方式修改當前形狀或對象。 創(chuàng)建后根據(jù)位置甚至大小更改對象的過程稱為平移。 在這里,我們將研究如何在計算機圖形學中執(zhí)行2D翻譯。
2D翻譯 (2D Translation)
The translation is the movement in a straight line of an object from one position to another.
平移是對象從一個位置到另一位置沿直線的移動。
The movement of objects without deforming the shape of the object is Translation. Here the object is shifted from one position to another position and from one co-ordinate location to another.
在不變形對象形狀的情況下移動對象就是平移。 在這里,對象從一個位置移動到另一位置,并從一個坐標位置移動到另一位置。
The translating polygon i.e. all vertex of the polygon is converted to a new position. Similarly, curved objects are translated. To change the position of the circle or ellipse its center coordinates are transformed, then the object is drawn using the new co-ordinates.
平移多邊形(即多邊形的所有頂點)將轉換到新位置。 同樣,彎曲的對象也可以平移。 要更改圓形或橢圓形的位置,請變換其中心坐標,然后使用新的坐標繪制對象。
Translation of point:
點的翻譯:
To translate a point from coordinate position (x, y) to another (x, y), we add algebraically the translation distances Tx & Ty to the original co-ordinates.
為了將一個點從坐標位置(x,y)轉換到另一個(x,y) ,我們將代數(shù)轉換距離Tx & Ty代入原始坐標。
Translation equation:
翻譯等式:
x1 = x + Txy1 = y + Ty (The translation pair (Tx, Ty) is called as shift vector)Example:
例:
In the following image you can see that after applying translation, point C gets shifted to C'.
在下圖中,您可以看到在應用平移之后,點C移至C' 。
Example:
例:
Given a square with coordinate points A (0, 3), B (3, 3), C (3, 0), D (0, 0). Apply the translation with distance 1 towards X axis and 1 towards Y axis. We have to find the new co-ordinates of the square.
給定一個具有坐標點A(0,3),B(3,3),C(3,0),D(0,0)的正方形。 將平移應用到X軸,距離1到Y軸。 我們必須找到正方形的新坐標。
Solution:? Given-
解決方案:給定-
Old co-ordinates 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)
Translation vector = (Tx, Ty) = (1, 1)
翻譯向量=(Tx,Ty)=(1,1)
對于坐標A(0,3) (For Coordinates A (0, 3))
?Let the new coordinates of corner A = (Xnew, Ynew).
設角A的新坐標=(X new ,Y new )。
Applying the translation equations, we have-
應用平移方程式,我們有-
Xnew= Xold?+ Tx?= 0 + 1 = 1
X 新 = X 舊 + T x = 0 + 1 = 1
Ynew= Yold?+ Ty?= 3 + 1 = 4
Y 新 = Y 舊 + T y = 3 +1 = 4
Thus, New coordinates of corner A = (1, 4).
因此,角A的新坐標=(1,4)。
For Coordinates B (3, 3)
對于坐標B(3,3)
Let the new coordinates of corner B = (Xnew, Ynew).
令角B的新坐標=(X new ,Y new )。
Applying the translation equations, we have-
應用平移方程式,我們有-
Xnew= Xold?+ Tx?= 3 + 1 = 4
X 新 = X 舊 + T x = 3 +1 = 4
Ynew= Yold?+ Ty?= 3 + 1 = 4
Y 新 = Y 舊 + T y = 3 +1 = 4
Thus, New coordinates of corner B = (4, 4).
因此,角B的新坐標=(4,4)。
For Coordinates C (3, 0)
對于坐標C(3,0)
Let the new coordinates of corner C = (Xnew, Ynew).
令角的新坐標C =(X new ,Y new )。
Applying the translation equations, we have-
應用平移方程式,我們有-
Xnew= Xold?+ Tx?= 3 + 1 = 4
X 新 = X 舊 + T x = 3 +1 = 4
Ynew= Yold?+ Ty?= 0 + 1 = 1
Y 新 = Y 舊 + T y = 0 + 1 = 1
Thus, New coordinates of corner C = (4, 1).
因此,角C的新坐標=(4,1)。
For Coordinates D (0, 0)
對于坐標D(0,0)
Let the new coordinates of corner D = (Xnew, Ynew).
令角的新坐標D =(X new ,Y new )。
Applying the translation equations, we have-
應用平移方程式,我們有-
Xnew= Xold?+ Tx?= 0 + 1 = 1
X 新 = X 舊 + T x = 0 + 1 = 1
Ynew= Yold?+ Ty?= 0 + 1 = 1
Y 新 = Y 舊 + T y = 0 + 1 = 1
Thus, New coordinates of corner D = (1, 1).
因此,角D的新坐標=(1,1)。
翻譯自: https://www.includehelp.com/computer-graphics/translations.aspx
計算機圖形學圖形旋轉
總結
以上是生活随笔為你收集整理的计算机图形学图形旋转_计算机图形学翻译的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: stl向量_如何在C ++ STL中将数
- 下一篇: 类中函数模板 typeof_Julia中