亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Understanding Transformations(理解變換)

發布時間:2020-03-13 18:55:29 來源:網絡 閱讀:376 作者:萌谷王 欄目:游戲開發

周一到周五,每天一篇,北京時間早上7點準時更新~

If you think about it, most 3D graphics aren’t really 3D(用腎想象一下都知道,實際上3D圖像并不是真3D). We use 3D concepts and terminology to describe what something looks like; then this 3D data is “squished” onto a 2D computer screen(我們使用3D的概念和技術來描述事物看起來如何,然后俺們就把這樣的3D數據給"干"到了2D顯示器上). We call the process of squishing 3D data down into 2D data projection(我們把3D數據變成2D數據的操作叫投影). We refer to the projection whenever we want to describe the type of transformation (orthographic or perspective) that occurs during vertex processing, but projection is only one of the types of transformations that occur in OpenGL(我們在這里講到的投影是指發生在頂點處理階段的OpenGL中的那些變換中的一個). Transformations also allow you to rotate objects around; move them about; and even stretch, shrink, and warp them(變換同樣的允許你可以旋轉物體、移動物體、揉、捏、掐等等都是可以的。反正就是讓物體發生他們本來命運里就安排好的操作)

Coordinate Spaces in OpenGL(OpenGL中的坐標系)

A series of one or more transforms can be represented as a matrix, and multiplication by that matrix effectively moves a vector from one coordinate space to another(一系列的操作可以用一個矩陣來表達,并且用向量乘以一個矩陣后,還能將向量從一個空間轉到另一個空間). Several coordinate spaces are commonly used in OpenGL programming(OpenGL里用到了很多常見的坐標系). Any number of geometric transformations can occur between the time you specify your vertices and the time they appear on the screen, but the most common are modeling, viewing, and projection(幾何形體的變換可以在你定義頂點數據之后到他們顯示到熒幕上之前來做,但通通常主要涉及的是模型、視口、投影). In this section, we examine each of the coordinate spaces commonly used in 3D computer graphics (and summarized in Table 4.1)(在本章節,俺們主要來講講在3D圖形學里常用的幾個坐標系,在表4.1里列出來了), and the transforms used to move vectors between them(那些變換就是把向量在這些坐標系之間來回折騰,想想也是過的很慘的日子,為什么人們要互相傷害)
Understanding Transformations(理解變換)
A matrix that moves coordinates from one space to another is normally named for those spaces(一個般來講,我們矩陣的名字就代表著他們干了什么事,比如把物體的頂點從模型坐標系轉到視口坐標系的矩陣就叫模型視口矩陣). For example, a matrix that transforms an object’s vertices from model space into view space is commonly referred to as a model–view matrix

Object Coordinates(模型坐標系)

Most of your vertex data will typically begin life in object space, which is also commonly known as model space(大多數頂點數據都是在模型坐標系下定義滴,在模型坐標系里,所有的位置都是相對于模型坐標系的原點來定義滴). In object space, positions of vertices are interpreted relative to a local origin. Consider a spaceship model. The origin of the model is probably going to be somewhere logical, such as the tip of the craft’s nose, at its center of gravity, or where the pilot might sit(比如一個宇宙灰船,闊能,它的原點在飛行器鼻尖兒上,也有可能在重心處,還有可能在飛行員坐的位置,然并卵). In a 3D modeling program, returning to the origin and zooming out sufficiently should show you the whole spaceship. The origin of a model is often the point about which you might rotate it to place it into a new orientation(在3D建模軟件里,返回原點,然后放大縮小應該要讓你看見飛船的全身,太羞恥了,沒事就想著看別人全身). It wouldn’t make sense to place the origin far outside the model, because rotating the object about that point would apply significant translation as well as rotation(王法在哪里?因此,把原點放在模型外面,感覺是沒什么卵用的。因為繞原點旋轉物體的時候,會增加一個相當大的偏移,這樣會讓人很蛋疼)

World Coordinates(世界坐標系)

The next common coordinate space is world space. This is where coordinates are stored relative to a fixed, global origin(下一個坐標系就是世界坐標系了,世界坐標系里的東西都是參考相對固定的世界坐標系的原點來的). To continue the spaceship analogy, this could be the center of a play-field or other fixed body such as a nearby planet. Once in worldspace, all objects exist in a common frame(還是以那個可憐的飛船為例, 世界坐標系的原點通常是在它玩耍的那個空間的某處,比如什么行星的某個固定的地方). Often, this is the space in which lighting and physics calculations are performed(通常情況下,這是進行光照計算和物理模擬的地方)

View Coordinates(視口坐標系)

An important concept throughout this chapter is that of view coordinates, also often referred to as camera or eye coordinates(另一個重要的概念就是視口坐標系,有人也叫它攝像機或者眼睛坐標系). View coordinates are relative to the position of the observer (hence the terms “camera” and “eye”) regardless of any transformations that may occur;(眼睛通常就代表的是觀察者,你可以把觀察者想象成一個絕對坐標) you can think of them as “absolute” coordinates. Thus, eye coordinates represent a virtual fixed coordinate system that is used as a common frame of reference. Figure 4.7 shows the view coordinate system from two viewpoints(圖4.7從兩個視角來看視口坐標系). On the left, the view coordinates are represented as seen by the observer of the scene (that is, perpendicular to the monitor)(左邊的這個展示的是觀察者看到的場景). On the right, the view coordinate system is rotated slightly so you can better see the relation of the z axis(右邊這個圖里,視口坐標系稍微的進行了一點旋轉,這樣你能更好的看到它與z軸的關系). Positive x and y are pointed right and up, respectively, from the viewer’s perspective(從觀察者的視角來看,x、y的正方向指向了右邊和上面). Positive z travels away from the origin toward the user, and negative z values travel farther away from the viewpoint into the screen. The screen lies at the z coordinate 0(z軸的正方向從原點指向觀察者,z軸負方向從觀察者指向屏幕里面,屏幕處的z坐標是0)
Understanding Transformations(理解變換)
When you draw in 3D with OpenGL, you use the Cartesian coordinate system. In the absence of any transformations, the system in use is identical to the eye coordinate system just described(在你用OpenGL畫畫的時候,你使用的是笛卡爾坐標系,在沒有任何變換的時候,這個坐標系只能在剛才描述的那個視口坐標系下工作)

Clip and Normalized Device Space(剪裁和NDC坐標系)

Clip space is the coordinate space in which OpenGL performs clipping(剪裁坐標系是OpenGL執行剪裁的地方). When your vertex shader writes to gl_Position, this coordinate is considered to be in clipspace(當你在vertex shader中給gl_Position賦值之后,這個坐標被認為是在剪裁空間中). This is always a four-dimensional homogenous coordinate(這個坐標永遠是一個四元齊次坐標). Upon exiting clip space, all four of the vertex’s components are divided through by the w component(到離開剪裁空間的時候,所有的頂點的元素都會被w分量除). Obviously, after this, w becomes equal to 1.0. If w is not 1.0 before this division, the x, y, and z components are effectively scaled by the inverse of w(很明顯,在這波操作后,w變成了1,如果w在除法操作之前不是1,則x、y、z就會被縮放). This allows for effects such as perspective foreshortening and projection(這種操作就可以產生透視、投影這樣的效果). The result of the division is considered to be in normalized device coordinate space (NDC space)(這個操作結束后,坐標變到了NDC坐標系下,Normalized Device Coordinate的縮寫). Clearly, if the resulting w component of a clip space coordinate is 1.0, then clip space and NDC space become identical.(很明顯,如果在剪裁空間中的w分量是1.0,那么剪裁空間中的坐標和NDC空間中的坐標是一樣的)

本日的翻譯就到這里,明天見,拜拜~~

第一時間獲取最新橋段,請關注東漢書院以及圖形之心公眾號

東漢書院,等你來玩哦

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

台安县| 屯门区| 无棣县| 会东县| 阳东县| 磐安县| 麟游县| 团风县| 若羌县| 简阳市| 遂川县| 玛曲县| 青田县| 渑池县| 潮州市| 温宿县| 容城县| 青冈县| 桑植县| 德庆县| 始兴县| 怀远县| 金坛市| 东乌珠穆沁旗| 墨竹工卡县| 阿尔山市| 凤台县| 孟连| 凤冈县| 长泰县| 运城市| 尚义县| 红河县| 始兴县| 阜康市| 蚌埠市| 班戈县| 历史| 邵东县| 神池县| 张家港市|