Chap 1. Graphics Systems and Models 동의대학교멀티미디어공학과 Hyoungseok B. Kim
Computer Graphics definition all technologies related to producing pictures or images using a computer 40년정도의역사 CRT characters photo-realistic images.,,..,,. :XXXX,XXXX:.SSSSSSS' 'XXXXXXXXX'.SSSSSSSS,WW:,.''':,. ':XXXXX:'.SSSSSSSSSS:WWW:, '::, 'XXX'.SSSSSSSSS,WWW<*>WW '::, '//// ':' SSSSSSSSSSSS'WWWWWWD '::,////,. SSSSSSS(((SSSWWWWW',WW//:.'.W.,((() 'SSSSSS(((WWWWWWWWWW) //'W,:WWWW',(((((() 'SSSSSS((WWWWWWWWWW) // 'WWW,WWW.,(((((((()) 'SSSSWWWWWWWWWWW' //.WWWWW:,.,((((((((((())), SSWWWWWWWWWW' //,WWWW' ':,.,((((((((((((((())))),.,,,,WWWWWWWWWW:, //,WWWWW' ': '((((((((((((((((((((()))))WWWWWWWWWWWWWVVVV//WWWWW:,.,WWWWW' : ((((((((((((((((((()))(WWWWWWWWWWWWWWVVVVVVWWWWWWWWWWWWW' ' ((((((((((((((((()))(WWWWWWWWWWWWWVVVVVVVWWWWWWWWWWWW' (((((((((((((())(()(WWWWWWWWW.VVVVVVVWWWWWWWWWWW:' ((((((((())) ()(WWWWWW.VVVVVVV'WWWWWWW''.,,..,,. ((((())) ((WW,VVVVVVVVV'WWWWWWWWW :XXXX,XXXX: WVVVVVVVVVV'WWWWWWWW:' 'XXXXXXXXX'.,,..,,. VVVVVVVVV'WWWWWWWWWW ':XXXXX:' :XXXX,XXXX:.WVVVVVVV'WWWWWWWWWWWW 'XXX' 'XXXXXXXXX'.WWW''''',WWWWWWWWWWWW: ':' ':XXXXX:' (())))WWWWWWWWWWWWWWWWW' 'XXX' ((())))))WWWWWWWWWWWWWW' ':' ((()))))))))WWWWWWWWWWW' ()WWWWWW)))))))))))))))) :WWWWWWWWW)))))))))))))).,,..,,. WWWWWWWWWWW)))))))WWWWW. :XXXX,XXXX: :WWWWWWWWWW')))))WWWWWWWW. 'XXXXXXXXX' WWWWWWWWWW' 'WWWWWWWWWWWW ':XXXXX:'.,,:WWWW:,WWWWWWWWW' 'WWWWWWWWWWW 'XXX',WWWWWWWWWWWWWWWWWW' 'WWWWWWWWW ':',WWWWWWWWWWWWWWWWWW' 'WWWWWWWW, WWWWWWW' '':WWW:' 'WWWWWWWW.WWWWWWW'.WWWWWWWWW ''W'W'WW,WWWWWWWWW'.,,..,,. '',WWWWWWWW' :XXXX,XXXX:.,,..,,..WWWWWW:' 'XXXXXXXXX' :XXXX,XXXX:.WWWWWWW' ':XXXXX:' 'XXXXXXXXX' WWWWWW' 'XXX' ':XXXXX:' WWWWW' ':' 'XXX' WWWW. ':' 'WWWWW, '' '' 40 years! 1
.,;;;;;;;,.,;;;;;;;,/;;;;.,aa###########@a;;;;;/;;;,//;;;..,,,.,aa##################@a;//;;;,//;;;,;;;;;;;o#####oo##############ooo###a,/;;;;'.;;//,;;;o####ooo##########ooo####ooo#####a'.;;/,;;/;oo##oo#######################ooo####. ;;;/,;;//OO#######OOO###########OOO###########. `;;//,;,OOO#########OO#########OO##############. ;. ``````OOO#####;;;;;;OO#####OO;;;;;;######O####..;;, OOO###O;;' ~`;##OOOOO##;' ~`;;O#####OO### ;;;;, OOO##O;;;,.,;O#########O;,.,;;;O####OO###, `;;',;; OOO##OO;;;;OOO(???????)OOO;;;;OO####OO###%, `\ ;;; `OOO#####OOOO##\?????/##OOOO#######O####%O@a \,`;' `OOO####OOO######;######OOO###########%O###,.,\ `OO####OO"#####;#####"OO##########%oO###O#;,;;;; \.::::OO##OOOaaa###aaaOOO#######',;OO##OOO##;,.;;'' \:::.OOaa`###OO#######OO###'::aOO.:;;OO###OO;::. '.::\.OO####O#::;;;;;;;;;;;;::O#O@OO.::::::::://::.:::.O\########O#O::;;;::O#OO#O###@OO.:;;;;;;;;//:,.:/;:.OO#\#########OO#OO#OO########@OO.:;;;;;;;;;//:.://;;.OO###\##########O#############@OO.:;;;;;;;;//:. ;//;;;;.O'//;;;;;;\##################@OO.:;;;;;;;;//:.. ;//:;;;;:.//;;;;;;;;;#################@OO.:;;;;;;;;;//.. ;;//:;;;:://;;;;;;;;;################@OO.:/;;;;;;;;;//.. `;;;;;:::::::ooooooo#\############@ooo.;;//;;;;;;;;;//.o,.;,,,.ooooo############\#######@ooo.;;;//;;;;;;;;;;//;.oo, //;;.oo##################@\ooo.;;;;;;;;;;;;;;;;;;;;//;.oo#o, //;;;;O##############@OOO=;;;;//;;;;;;;;;;;;;;;;;;;//;.oO##Oo //::;;O#########@OOOOO=;;;;;;;//;;;;;;;;;;;;;;;////;.oO####OO.n.n.n.n`;O########@OOOOO=;;;;;;;;;;///;;;;////////';oO########OO.%%%%%%%%%,;;########@=;;;;=;;;;///////////////':::::::::.a######@ /%%%%%%%%%%.;;;;""""=:://:::::::::::::::::\::::::::::::://:.####@' /%%%%%%%%%//.;' =:://:::::::::::::::::::\::::::::::://:.###@' /%%%%%%%%//' =:://::::::::;:::::::::::\:::::::://:.##@' /%%%%%%/ =:://:::;;:::::::::::::::\::::::::' '''' '''''' ''''''''''''''''\'''' \.,,..,,. :XXXX,XXXX:.SSSSSSS' 'XXXXXXXXX'.SSSSSSSS,WW:,.''':,. ':XXXXX:'.SSSSSSSSSS:WWW:, '::, 'XXX'.SSSSSSSSS,WWW<*>WW '::, '//// ':' SSSSSSSSSSSS'WWWWWWD '::,////,. SSSSSSS(((SSSWWWWW',WW//:.'.W.,((() 'SSSSSS(((WWWWWWWWWW) //'W,:WWWW',(((((() 'SSSSSS((WWWWWWWWWW) // 'WWW,WWW.,(((((((()) 'SSSSWWWWWWWWWWW' //.WWWWW:,.,((((((((((())), SSWWWWWWWWWW' //,WWWW' ':,.,((((((((((((((())))),.,,,,WWWWWWWWWW:, //,WWWWW' ': '((((((((((((((((((((()))))WWWWWWWWWWWWWVVVV//WWWWW:,.,WWWWW' : ((((((((((((((((((()))(WWWWWWWWWWWWWWVVVVVVWWWWWWWWWWWWW' ' ((((((((((((((((()))(WWWWWWWWWWWWWVVVVVVVWWWWWWWWWWWW' (((((((((((((())(()(WWWWWWWWW.VVVVVVVWWWWWWWWWWW:' ((((((((())) ()(WWWWWW.VVVVVVV'WWWWWWW''.,,..,,. ((((())) ((WW,VVVVVVVVV'WWWWWWWWW :XXXX,XXXX: WVVVVVVVVVV'WWWWWWWW:' 'XXXXXXXXX'.,,..,,. VVVVVVVVV'WWWWWWWWWW ':XXXXX:' :XXXX,XXXX:.WVVVVVVV'WWWWWWWWWWWW 'XXX' 'XXXXXXXXX'.WWW''''',WWWWWWWWWWWW: ':' ':XXXXX:' (())))WWWWWWWWWWWWWWWWW' 'XXX' ((())))))WWWWWWWWWWWWWW' ':' ((()))))))))WWWWWWWWWWW' ()WWWWWW)))))))))))))))) :WWWWWWWWW)))))))))))))).,,..,,. WWWWWWWWWWW)))))))WWWWW. :XXXX,XXXX: :WWWWWWWWWW')))))WWWWWWWW. 'XXXXXXXXX' WWWWWWWWWW' 'WWWWWWWWWWWW ':XXXXX:'.,,:WWWW:,WWWWWWWWW' 'WWWWWWWWWWW 'XXX',WWWWWWWWWWWWWWWWWW' 'WWWWWWWWW ':',WWWWWWWWWWWWWWWWWW' 'WWWWWWWW, WWWWWWW' '':WWW:' 'WWWWWWWW.WWWWWWW'.WWWWWWWWW ''W'W'WW,WWWWWWWWW'.,,..,,. '',WWWWWWWW' :XXXX,XXXX:.,,..,,..WWWWWW:' 'XXXXXXXXX' :XXXX,XXXX:.WWWWWWW' ':XXXXX:' 'XXXXXXXXX' WWWWWW' 'XXX' ':XXXXX:' WWWWW' ':' 'XXX' WWWW. ':' 'WWWWW, '' '' 2
3
4
5
6
7
8
9
10
11
12
2 개의접근방법 디자인관점에서 미술도구로서사용 얼마나미학적인가? 공학 / 전산학적접근 프로그램의개발 얼마나효율적인가? 13
이 course 의접근방법 공학 / 전산학적으로 programmer의입장에서 graphics program 개발방법? OpenGL the graphics library graphics application 개발용 de facto standard 이 course에서중점적으로사용 14
1.1 Applications of Computer Graphics
Computer Graphics 응용분야들 computer graphics 의발달 사용자요구 : 고기능, 더편리 서로상승작용 h/w, s/w의발달 대표적인응용분야들 display of information design simulation user interface 16
Display of Information architectural drawings CAD (computer-aided design) geographical information GIS (geographic information system) mathematical graphs computer plotting packages X-ray CT, MRI, PET super computer + graphics scientific visualization 17
Design, User Interface design CAD iterative process 에대한획기적인해결책 computer graphics 를제안한최초의이유 user interfaces window, icon, menu, pointing device GUI (graphical user interface) Xerox Macintosh X windows Microsoft windows 18
Simulation simulation graphics system에서 real-time image 생성이가능해지면서 simulation 가능 : flight simulator 또다른응용분야 : computer games computer animation photo-realistic image 생성이가능해지면서 VR : virtual reality graphics + interface 기술 19
1.2 A Graphics System
Computer Graphics System 근본적으로, computer system processor, memory frame buffer : graphics system의특징 output devices, input devices 21
Raster system 용어정의 image raster pixel : picture element raster : an array of pixels frame buffer : pixel 저장용 memory area 바둑판모델 22
Raster System 의개념 1:1 대응관계 y for (y = 0; y < LINES; y++) for (x = 0; x < PIXELS; x++) display one pixel; frame buffer x display processor 화면출력 비디오카드 23
Output Devices CRT : cathode-ray tube 음극선관 frame buffer (in memory) raster system frame buffer의모든pixel을 CRT에서순서대로출력 24
Input Devices keyboard, mouse, joystick, data tablet 25
1.3 Images: Physical and Synthetic
Image 생성과정 궁극적으로는 real world를 simulate camera 또는 human visual system이어떻게작동하는지를그대로 simulate 주로, camera를 simulate real world 3차원공간 물체들 object camera viewer 필요한기술? geometry, trigonometry 27
Camera System computer graphics : 3D 2D 로의 mapping object : 3D viewer : 3D (= camera) image : 2D (camera의 film) viewer object image 28
Camera System with a light source light : 3D 에서정의됨 light source light object viewer object 의표면결정 light object shadow 그림자생성 29
Light, Optics light : electro-magnetic radiation light, color 는 modern optics에서해석 graphics 에서는대부분 geometric optics 사용 computer graphics : 반사, 굴절, 회절을해석해야 30
1.4 The Human Visual System
Human Visual System rod ( 간상체杆狀體 ) : night vision cones ( 원추체圓錐體 ) : day vision human visual system back-end에 brain 이있기때문에, simulation 거의불가능 반응곡선 32
1.5 The Pinhole Camera
Pinhole Camera 바늘구멍사진기 가장간단한 geometric model (x, y, z) : 3D point (x p, y p, z p ) : projection x y z p p p x = z / d y = z / d = d 34
용어정의 projection of the point (x, y, z) (x p, y p, d) : film 상의좌표 FOV : field of view (= angle of view) 화면을보는최대각 θ = 1 2 tan h 2d DOF : depth of field focus 가맞는거리 pinhole camera는 infinite DOF 35
1.6 The Synthetic-Camera Model
The Synthetic Camera Model graphics 에서사용하는 camera model object 정의는 viewer와는독립적 object 정의 function을별도로독립 image 생성시에는 trigonometry 계산필요 projection plane film을 center of projection 보다앞으로 37
Projection plane, Clipping window projection plane : 계산의편의 clipping rectangle projection plane 상에서실제로보이는부분 38
1.7 The Programmer s Interface
Why Programming? graphics system을사용하는방법? CAD, animation tool mouse로 interaction 누구나다한다 someone should develop the graphics program! 단순사용자도자신만의 code 필요 예 : 3DS, MAYA 의 plug-in graphics library : 개발용 function 들 40
API application programmer s interface graphics library graphics library의함수들을쓰는방법 popular API s OpenGL, Direct3D, Java3D, API 기본구성 object 정의 viewer 정의 light source, materials, etc. 41
API 구성 object 정의 OpenGL 구현예 glbegin(gl_polygon); glvertex3f(0.0, 0.0, 0.0); glvertex3f(0.0, 1.0, 0.0); glvertex3f(0.0, 0.0, 1.0); glend( ); GL_POLYGON, GL_LINE_STRIP, GL_POINTS, 42
API 구성 camera 정의 position orientation focal length film plane light source API location strength color direction 43
Example : Wire-frame 44
Example : Flat Shading 45
Example : Sophisticated Shading 46
Example : Texture, Shadow 47
1.8 Graphics Architecture
Modeling-Rendering Paradigm 가장간단한 graphics architecture modeler, renderer 가별도의 program 예 : Pixar s RenderMan Interface modeler / renderer 연결은 file 로 AutoCAD, 3DS, MAYA, etc. RenderMan, BMRT, etc. 49
Single CPU Model 초기의 computer 에서사용 CPU 에너무많은부하가걸린다 Intel x86 : SSE (streaming SIMD extension) single CPU model을위한지원책 50
Display Processor Model DPU : display processor graphics 처리전용의 CPU를추가 pipeline architecture로넘어가는과도기 51
Pipeline Architecture 가장진보된형태 VLSI 기술의발달로가능 SGI (Silicon Graphics Inc.) IRIS series nvidia GeForce chips graphics 처리를몇단계로나누어서각각을별도의 VLSI chip이처리 52
Pipeline Architecture transformation 좌표변환을위한 4 4 matrix multiplication clipping projection plane 상에서불필요한부분제거 projection 3D object 2D image 로의 mapping rasterization image 를 frame buffer에저장하는과정 53
Suggested Readings Foley, van Dam, Feiner, and Hughes, Computer Graphics, 2 nd Ed., C version, Addison-Wesley, 1996. graphics encyclopedia Hearn & Baker, Computer Graphics, 2 nd Ed., C version, Prentice-Hall, 1994. good introduction to computer graphics for undergraduate students 54