https://open.gl/transformations
Translation
Scaling
Rotation
โ rotation about y-axis is heading/yaw
โ rotation about x-axis is pitch/elevation
โ rotation about z-axis is roll/bank
Combining transformations is demonstrated by the multiplication of matrices.
ex) Mtranslate * Mscale
Transformations in OpenGL
Model Matrix
Ojbect coordinates (position in model) -> World coordinates (position in world)
์์น, ํฌ๊ธฐ, ํ์ ์ ๋จ์ ๋ณํฉ
์ ์ด์ world coordinates์ผ๋ก ๊ตฌ์ฑ๋์ด ์๋ค๋ฉด ์ด ๋งคํธ๋ฆญ์ค๋ ๊ฐ๋จํ identity matrix๋ก ์ธํ ๋๋ค.
View Matrix
OpenGL์์์ ์นด๋ฉ๋ผ๋ ์์ง์ผ ์ ์์ผ๋ฉฐ, (0, 0, 0)์ ๊ณ ์ ๋์ด -Z ๋ฐฉํฅ์ ๋ฐ๋ผ๋ณด๊ณ ์๋ค.
๋ฐ๋ผ์ ๋ชจ๋ ์์ง์์ ์นด๋ฉ๋ผ๊ฐ ์์ง์ด๋ ๋์ world๊ฐ ๋ฐ๋๋ก ์์ง์ฌ ๊ฐ์ ํจ๊ณผ๋ฅผ ๋ธ๋ค. (inverse transformation)
Projection Matrix
Clip coordinates ์ผ๋ก ๋ณํํด์ฃผ๋ ๊ณผ์ .
Perspective projection์ ๊ฒฝ์ฐ DCN(Device Coordinates Normalization)์ด ํ์ํ๋ค.
์ ๊ณผ์ ์์ ํฌ์ ํ๋ ฌ์ 4ํ์ 1์ด ์๋ ๊ฐ์ ๊ฐ๋ w๊ฐ ๋ฐ๋์ ํ์ํ๋ค.
w ๊ฐ์ ์นด๋ฉ๋ผ์์ ์ผ๋ง๋ ๋จ์ด์ ธ ์๋์ง๋ฅผ ๊ฐ๋ ํ๋ค.
xclip / wclip, yclip/wclip ์ผ๋ก normalized๋ ๊ฐ์ -1~1์ range๋ฅผ ๊ฐ๋๋ค. zclip/wclip์ depth ๊ฐ์ด ๋๋ค.
์์ ๊ณผ์ ์ด ๋ชจ๋ ํฉ์ณ์ ์๋์ ๊ฐ์ ์ฐ์ฐ์ ์ํํ๋ค.
์ผ๋ฐ์ ์ผ๋ก vertex shader์์ ์ํ๋๋ฉฐ gl_Position์ผ๋ก ์ ์ธ๋์ด clipping coordinates ๊ฐ์ ๋ฐํํ๋ค.
'ํ๋ก๊ทธ๋๋ฐ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
STL map class (0) | 2015.03.25 |
---|---|
[tbd] Deformation Transfer for Triangle Meshes (2004) (0) | 2015.03.23 |
๋ฆฌ๋ ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ฒฝ๋ก ์ถ๊ฐ Linux library path setting (0) | 2015.03.20 |
ํ์ค ํ ํ๋ฆฟ ๋ผ์ด๋ธ๋ฌ๋ฆฌ STL; Standard Template Library (0) | 2015.03.18 |
๋ฆฌ๋ ์ค ๋ช ๋ น์ด Linux Commands (0) | 2015.03.16 |