컴퓨터그래픽스

[23-1 컴퓨터그래픽스 정리] Camera

begong 2023. 7. 13. 21:56
반응형
본 글은 국민대학교 김준호 교수님의 "컴퓨터 그래픽스" 강의자료 정리 목적으로 만들었습니다.
글 자료의 모든 권한은 김준호 교수님께 있습니다.

 

Synthetic Camera

Camera Specification - Projection types

Perspective projection

  • 투사되는 점이 한 점일때.
  • 우리의 눈이 이렇게 되어있음 =>구현 복잡
  • 3차원에서는 평행하지만 이미지에서는 그렇지 않음

Orthographic projection

  • 평행한 부분은 평행하게 그리자
  • perspective projection의 cop을 무한히 뒤로 미룸 => 평행해짐
  • 풍경화와 가까움
    Screenshot 2023-04-22 at 8 26 14 PMProjection types
  • Perspective projection
  • Parallel lines -> Vanishing point (소실점이 생긴다.)Orthographic projection
  • Parallel lines -> Parallel lines

Camera Specification - Clipping Planes

Clipping

Physically, a camera cannot "see" the whole world

  • objects that are not within the view volume are said to be clipped out of the scene
  • 4 clipping planes : left/ right / top/ bottomIn openGL, there are two additional clipping planes
  • 6 clipping planes : left / right / top / bottom + front / back
  • Computer cannot process infinitely many objects
  • 너무 먼 데이터는 무의미하고, 너무 가까운 데이터는 화면에서 너무 큰부분을 차지하기 때문에 표현을 안할 수 있다.

Camera Specification - Extrinsic parameters

Extrinsic parameters : 6 degrees of freedom (DOF)

Position : 3 DOF

  • Center of projection (Cop) : position of center of lens(x,y,z)Orientation : 3 DOF
  • pitch(끄덕) - yaw(도리) - Roll(갸웃)In OpenGL, extrinsic parameters are handled by cvamera transformations
  • 카메라 위치 (position), 카메라의 각도(Orientation)에 따라서 맺히는 상이 다름

Screenshot 2023-04-22 at 8 40 40 PM

6 DOF로 구성하지 않고 9개의 파라미터를 받음

  • pitch로 구현할때 너무 어려워서
    (부정확)
    1. at z 에서 eye z를 빼서 방향을 구한다. 2. y와z로 x를 구한다 3. z와 y로 x를 구한다.

Camera Specification - Intrinsic parameters

Intrinsic parameters

Focal length

  • Physical distance : lens - camera sensor
  • Zoom-in / Zoom-out

Screenshot 2023-04-22 at 8 46 52 PM

현실에서는 렌즈와 센서의 거리로 조절을 하지만, 가상이기때문에 angle만 고려하면 된다.

Focal length

  • In OpenGL, there is no physical meaningField of view(FOV)
  • in OpenGL, zoom-in/-out is handled by changing the field of view

Screenshot 2023-04-22 at 8 50 08 PM

Perspective projection

Screenshot 2023-04-22 at 8 51 17 PM

삼각함수를 써서 계산해서 위치가 나온다.

Orthograpic projection

Screenshot 2023-04-22 at 8 52 58 PM

Camera Specification - Viewport

상의 크기를 어떻게 설정할 것인가?

Viewport

Similar to the size of photo printing

  • A film -> Photos of different sizesA rectangular area of the display window : x(좌),y(하단),w(우),h(상단)
  • (x,y) : the lower-left corner of the viewport
  • w,h : the width and height of the viewport
  • 풀 스크린 창으로 보고있으면 w,h가 모니터의 해상도와 같아짐

Aspect ratio

width / height

넓이,높이 비율을 결정
일반적으로 필름에 담을 때 비율과 동일하게 설정 (안그럼 왜곡이 생길 수 있음)
일반적으로 화면이나 창의 크기로 맞춤
  • For aspect ratio, absolute sizes of width & height are meaningless
  • Aspect ratio of display window is important
반응형