๋ณธ ๊ธ€์€ 360 ์ด๋ฏธ์ง€๋ฅผ 2์ฐจ์›์— ๋งคํ•‘ํ•˜๋Š” ๋ฐฉ์‹์ธ Gnomonic Projection(์‹ฌ์‚ฌ๋„๋ฒ•)์— ๋Œ€ํ•ด ์ •๋ฆฌํ•œ ๊ธ€ ์ž…๋‹ˆ๋‹ค. ์ง€์ ์€ ์–ธ์ œ๋‚˜ ํ™˜์˜์ž…๋‹ˆ๋‹ค :)

6 minute read

๋ณธ ๊ธ€์€ 360 ์ด๋ฏธ์ง€๋ฅผ 2์ฐจ์›์— ๋งคํ•‘ํ•˜๋Š” ๋ฐฉ์‹์ธ Gnomonic Projection(์‹ฌ์‚ฌ๋„๋ฒ•)์— ๋Œ€ํ•ด ์ •๋ฆฌํ•œ ๊ธ€ ์ž…๋‹ˆ๋‹ค. ์ง€์ ์€ ์–ธ์ œ๋‚˜ ํ™˜์˜์ž…๋‹ˆ๋‹ค :)

ํ‘œ๊ธฐ: longitude๋Š” $\theta \in [-\pi, \pi]$๋กœ, latitude๋Š” $\phi \in [-\pi/2, \pi/2]$๋กœ ํ‘œ๊ธฐํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.


Gnomonic Projection


By Strebe - Own work, CC BY-SA 3.0, Link

360 ์ด๋ฏธ์ง€๋ฅผ 2์ฐจ์›์— ๋งคํ•‘ํ•˜๋Š” ๋Œ€ํ‘œ์ ์ธ ๊ธฐ๋ฒ•์ธ Gnomonic Projection์— ๋Œ€ํ•ด ์‚ดํŽด๋ณด์ž. Gnomonic Projection์„ ๋ฒˆ์—ญํ•˜๋ฉด ์‹ฌ์‚ฌ๋„๋ฒ•(ๅฟƒๅฐ„ๅœ–ๆณ•)์ด๋ผ๊ณ  ํ•œ๋‹ค. ๋•Œ๋•Œ๋กœ Gnomonic Projection์„ Rectilinear Projection์ด๋ผ๋Š” ์ด๋ฆ„์œผ๋กœ ๋ถ€๋ฅด๊ธฐ๋„ ํ•œ๋‹ค.

Gnomonic Projection์—์„œ ์ฃผ์˜ํ•  ์ ์€ ๋ฐ˜๊ตฌ ํ•˜๋‚˜์˜ ๋ฒ”์œ„๋งŒ์„ ๋งคํ•‘ํ•  ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ์ด๋‹ค. ์ฆ‰, ๋ฐ˜๊ตฌ ์ด์ƒ์˜ ๋ฒ”์œ„๋Š” Gnomonic Projection์œผ๋กœ ๋งคํ•‘ํ•  ์ˆ˜ ์—†๋‹ค.

Azimuthal projection

surface์˜ ๊ธฐ์ค€์ ์— tangentํ•œ ํ‰๋ฉด์„ ์žก์•„ projection ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ Azimuthal projection์ด๋ผ๊ณ  ํ•œ๋‹ค. ๊ทธ๋ž˜์„œ Gonomonic projection์€ Azimuthal projection์˜ ๋ฐฉ๋ฒ• ์ค‘ ํ•˜๋‚˜์ด๋‹ค.

๋˜๋‹ค๋ฅธ Azimuthal projection์˜ ์˜ˆ๋กœ๋Š” Stereographic projection๊ณผ Fisheye projection์ด ์žˆ๋‹ค.


How to map with Gnomonic Projection?

์ด์ œ Gnomonic Projection์„ ์–ด๋–ป๊ฒŒ ์ˆ˜ํ–‰ํ•˜๋Š”์ง€ ์‚ดํŽด๋ณด์ž.

๋จผ์ € ๋งคํ•‘์˜ ์ค‘์•™์— ์œ„์น˜ํ•  ์  $S=(\theta_0, \phi_0)$๋ฅผ ์ •ํ•œ๋‹ค.

์ด์ œ ์  $S$๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๋ฐ˜๊ตฌ ์ƒ์˜ ์ ๋“ค์„ ๋งคํ•‘ํ•ด๋ณด์ž.

$$ \begin{aligned} x &= \frac{\cos{\phi} \sin{(\theta - \theta_0)}}{\sin{\phi_0}\sin{\phi} + \cos{\phi_0}\cos{\phi}\cos(\theta-\theta_0)} \\ \\ y &= \frac{\cos{\phi_0}\sin{\phi} - \sin{\phi_0}\cos{\phi}\cos{(\theta-\theta_0)}}{\sin{\phi_0}\sin{\phi} + \cos{\phi_0}\cos{\phi}\cos(\theta-\theta_0)} \end{aligned} $$

์œ„์˜ ๊ณต์‹์—์„œ $x$์™€ $y$์˜ ๋ถ„๋ชจ์— ๊ณตํ†ต์ ์ธ ๋ถ€๋ถ„์ด ๋“ฑ์žฅํ•œ๋‹ค ์ด๊ฒƒ์„ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ‘œํ˜„ํ•ด๋ณด์ž.

$$\cos{c} = \sin{\phi_0}\sin{\phi} + \cos{\phi_0}\cos{\phi}\cos(\theta-\theta_0)$$

$\cos{c}$์—์„œ $c$๋Š” ๋งคํ•‘๋œ ํ‰๋ฉด์—์„œ ์›์ ๊ณผ $(x, y)$์ด ์ด๋ฃจ๋Š” ๊ฐ์„ ๋งํ•œ๋‹ค.

๊ณต์‹์—์„œ ๋ณผ ์ˆ˜ ์žˆ๋“ฏ longitude๋Š” $\theta - \theta_0$๋ฅผ ํ†ตํ•ด ๊ทธ ๊ฐ’์„ ๋ณด์ •ํ•˜๋Š” ๋ฐ˜๋ฉด, latitude $\phi$์—๋Š” longitude ๊ฐ™์€ ๋ณด์ •์ด ์—†๋‹ค. ๋˜ํ•œ ๋งคํ•‘์œผ๋กœ ์–ป์€ $x$์™€ $y$๋Š” $x^2 + y^2 \le 1$์˜ unit disk ๋‚ด๋ถ€์˜ ์ ์ด๋‹ค.

Inverse mapping

Gnomonic map์„ ๋‹ค์‹œ equirectangular์˜ ์ขŒํ‘œ๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

$$ \begin{aligned} \phi &= \sin^{-1} {\left( \cos c \sin \phi_0 + \frac{y \sin c \cos \phi_0}{\rho}\right)}\\ \theta &= \theta_0 + \tan^{-1} {\left( \frac{x \sin c}{\rho \cos \phi_0 \cos c - y \sin \phi_0 \sin c} \right)} \\ & \textrm{where, } \rho = \sqrt{x^2 + y^2} \textrm{ and } c=\tan^{-1}{\rho} \end{aligned} $$

๊ณต์‹์—์„œ $(\theta_0, \phi_0) = (0, 0)$์œผ๋กœ ์„ค์ •ํ•œ๋‹ค๋ฉด, gnomonic map์€ equirectangular์˜ ์ค‘์‹ฌ ๋ถ€๋ถ„์— ์œ„์น˜ํ•˜๊ฒŒ ๋œ๋‹ค.


Field of View(FOV) & Rectilinear projection

FOV in video games.svg

By Hugo Locurcio - Own work, CC0, Link

1

Field of View, ์ค„์—ฌ์„œ FOV2๋Š” ๊ตฌ์˜ ํ‘œ๋ฉด์„ Gnomonic projection์œผ๋กœ ๋งคํ•‘ํ•œ ๋ฒ”์œ„๋ฅผ ๋งํ•œ๋‹ค. ํ†ต์ƒ FOV๋Š” radian ๋‹จ์œ„๊ฐ€ ์•„๋‹Œ degree ๋‹จ์œ„๋กœ ํ‘œ๊ธฐํ•œ๋‹ค.

Gnomonic projection์—์„œ FOV๋Š” ์ตœ๋Œ€ 180ยฐ์˜ ๋ฒ”์œ„๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ๋‹ค. ์™œ๋ƒํ•˜๋ฉด Gnomonic projection์€ ๋ฐ˜๊ตฌ ํ•˜๋‚˜ ๋งŒํผ์˜ ์˜์—ญ๋งŒ ๋งคํ•‘ํ•  ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค.

๋ช‡๋ช‡ ๊ฒฝ์šฐ์—์„œ๋Š” FOV ๋ฐฉ์‹์œผ๋กœ Gnomonic projection์„ ํ•  ๋•Œ, Rectilinear projection์ด๋ผ๋Š” ํ‘œํ˜„์„ ์“ด๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ๋งคํ•‘์ด ์ด๋ฃจ์–ด์ง€๋Š” ์›๋ฆฌ ์ž์ฒด๋Š” ๋™์ผํ•˜๋‹ค. ์ผ๋ฐ˜์ ์œผ๋กœ ์ „์ฒด๊ฐ€ ์•„๋‹Œ 120ยฐ ์ดํ•˜์˜ FOV๋ฅผ ๊ฐ€์งˆ ๋•Œ Rectilinear projeection์ด๋ผ๋Š” ํ‘œํ˜„์„ ์„ ํ˜ธํ•˜๋Š” ๊ฒƒ ๊ฐ™๋‹ค. ๋ณธ ๊ธ€์—์„œ๋Š” FOV<=120ยฐ์ธ ๊ฒฝ์šฐ๋ฅผ ํŠน๋ณ„ํžˆ Rectilinear projection์œผ๋กœ ์ง€์นญํ•˜๊ฒ ๋‹ค!

Rectilinear projection์œผ๋กœ ๋งคํ•‘ํ•œ ๊ฒฐ๊ณผ๋Š” ์ผ๋ฐ˜ ์ด๋ฏธ์ง€๋ฅผ ๋ณด๋Š” ๊ฒƒ๊ณผ ๊ฐ™์€ ์™œ๊ณก ์—†๋Š”(undisorted) ์ด๋ฏธ์ง€๋ฅผ ์–ป๊ฒŒ ๋œ๋‹ค. ์ด๊ฒƒ์€ FOV๋ฅผ 120ยฐ ์ดํ•˜๋กœ ์ œํ•œํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ง์„ ์ด ์ง์„ ์œผ๋กœ ๋‚จ๊ฒŒ ๋˜๊ธฐ ๋•Œ๋ฌธ์ด๋ผ๊ณ  ํ•œ๋‹ค.

์•ž์˜ Gnomonic projection์€ ๋ฐ˜๊ตฌ๋ฅผ ์›ํ˜•์œผ๋กœ ๋งคํ•‘ํ•˜๋Š” ๊ฒฐ๊ณผ๋ฅผ ๋ณด์—ฌ์คฌ๋‹ค๋ฉด, Rectilinear projection์€ ์ฃผ๋กœ ์‚ฌ๊ฐํ˜•์˜ ์ด๋ฏธ์ง€๋กœ ๊ตฌ์˜ ํ‘œ๋ฉด์„ ๋งคํ•‘ํ•œ๋‹ค.

์ด๋ฅผ ์œ„ํ•ด Rectilinear projection์€ hFOV์™€ vFOV3 ๊ฐ’์ด ํ•„์š”ํ•˜๋‹ค. ์ด๋•Œ hFOV๋Š” longitude $\theta$์˜ ๋ฒ”์œ„๋ฅผ vFOV๋Š” latitude $\phi$์˜ ๋ฒ”์œ„๋ฅผ ์ œ์‹œํ•œ๋‹ค. ๊ทธ๋ž˜์„œ ์•ž์˜ Gnomonic projection ๊ณต์‹์„ ๋ฒ”์œ„์™€ ํ•จ๊ป˜ ์•„๋ž˜์™€ ๊ฐ™์ด ๋‹ค์‹œ ์“ธ ์ˆ˜ ์žˆ๋‹ค.

$$ \textrm{for } \theta \in \left[-\frac{\textrm{hFOV}}{2}, \frac{\textrm{hFOV}}{2} \right] \textrm{ and } \phi \in \left[-\frac{\textrm{vFOV}}{2}, \frac{\textrm{vFOV}}{2} \right]\\ \begin{aligned} x &= \frac{\cos{\phi} \sin{(\theta - \theta_0)}}{\sin{\phi_0}\sin{\phi} + \cos{\phi_0}\cos{\phi}\cos(\theta-\theta_0)} \\ y &= \frac{\cos{\phi_0}\sin{\phi} - \sin{\phi_0}\cos{\phi}\cos{(\theta-\theta_0)}}{\sin{\phi_0}\sin{\phi} + \cos{\phi_0}\cos{\phi}\cos(\theta-\theta_0)} \end{aligned} $$

์ด๋•Œ์˜ $x$, $y$์˜ ๋ฒ”์œ„๋Š” $x \in [-\tan{\left(\textrm{hFOV}/2\right)}, \tan{\left(\textrm{hFOV}/2\right)}]$, $y \in [-\tan{\left(\textrm{vFOV}/2\right)}, \tan{\left(\textrm{vFOV}/2\right)}]$๊ฐ€ ๋œ๋‹ค.

inverse mapping์—์„œ๋„ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ $x$, $y$์˜ ๋ฒ”์œ„๋ฅผ ์ œํ•œํ•œ ํ›„ ๋งคํ•‘ํ•˜๋ฉด equirectangular ์ƒ์˜ ์˜์—ญ์„ ๋‹ค์‹œ ์–ป์„ ์ˆ˜ ์žˆ๋‹ค.

Cubmap mapping

Cubmap mapping์€ ๊ตฌ๋ฅผ 6๊ฐœ์˜ 90ยฐ FOV ์ด๋ฏธ์ง€๋กœ ๋งคํ•‘ํ•˜๋Š” ๋ฐฉ์‹์ด๋‹ค.

๋งคํ•‘์˜ ๋ฐฉ์‹์€ Rectilinear projection์„ FOV=90ยฐ์œผ๋กœ ๋‘๊ณ  6๋ฒˆ์„ ์ง„ํ–‰ํ•˜๋Š” ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— ์ž์„ธํ•œ ์„ค๋ช…์„ ์ƒ๋žตํ•˜๊ฒ ๋‹ค.


๋งบ์Œ๋ง

๊ตฌ์˜ ํ‘œ๋ฉด์„ 2D๋กœ ๋งคํ•‘ํ•˜๋Š” ๋ฐฉ์‹์€ ์†Œ๊ฐœํ•œ Gnomonic projection ์™ธ์—๋„ ๋‹ค์–‘ํ•œ ๋ฐฉ๋ฒ•์ด ์กด์žฌํ•œ๋‹ค. ํ•˜์ง€๋งŒ Gnomonic projection์˜ ๊ฐ€์žฅ ๊ธฐ๋ณธ์ด ๋˜๋ฉด์„œ ๋„๋ฆฌ ์“ฐ์ด๋Š” ๋งคํ•‘ ๋ฐฉ์‹์ด๋ฏ€๋กœ ๋ฐ˜๋“œ์‹œ ์ˆ™์ง€ํ•ด์•ผ ํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•œ๋‹ค.


์ฐธ๊ณ ๋ฌธํ—Œ


  1. ์•ž์˜ Gnomonic projection์˜ ๊ตฌ ํ‘œ๋ฉด์„ ์™ธ๋ถ€์˜ tangent ํ‰๋ฉด์— ๋งคํ•‘์„ ํ–ˆ๋‹ค. ์ด ๊ทธ๋ฆผ์—์„  ์›์˜ ๋‚ด๋ถ€์—์„œ ๊ตฌ ํ‘œ๋ฉด์„ ๋ฐ”๋ผ๋ณธ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ๊ตฌ ํ‘œ๋ฉด์„ ์™ธ๋ถ€์— ๋งคํ•‘ํ•˜๋Š” ๊ฒƒ๊ณผ ๋‚ด๋ถ€์—์„œ ๋ฐ”๋ผ๋ณด๋Š” ๊ฒƒ์€ ์™„์ „ํžˆ ๋™์น˜์ธ ์ƒํ™ฉ์ด๋‹ค!ย 

  2. Normal FOV(NFOV)๋กœ ํ‘œํ˜„ํ•˜๋Š” ์ž๋ฃŒ๋„ ์žˆ๋‹ค.ย 

  3. wFOV์™€ hFOV๋กœ ํ‘œํ˜„ํ•˜๋Š” ๊ณณ๋„ ์žˆ์–ด ํ˜ผ๋™ํ•˜๊ธฐ ์‰ฝ๋‹ค. ์ด๋•Œ์˜ ์ •์˜๋Š” width FOV, height FOV๊ฐ€ ๋˜๋ฏ€๋กœ ์ฃผ์˜ํ•˜์ž!ย