Page 4 - Computer Graphics Handout
P. 4
2.5.1 RGB Color .......................................................................................................................................................... 57
2.5.2 Indexed Color .................................................................................................................................................... 58
2.5.3 Setting of Color Attributes ................................................................................................................................ 59
2.6 VIEWING .................................................................................................................................................................. 59
2.6.1 The Orthographic View ..................................................................................................................................... 59
2.6.2 Two-Dimensional Viewing ................................................................................................................................ 62
2.7 CONTROL FUNCTIONS.............................................................................................................................................. 62
2.7.1 Interaction with the Window System ............................................................................................................... 63
2.7.2 Aspect Ratio and Viewports .............................................................................................................................. 63
2.7.3 The main, display, and init Functions ............................................................................................................... 64
2.7.4 Program Structure ............................................................................................................................................ 66
2.8 THE GASKET PROGRAM ........................................................................................................................................... 66
2.8.1 Rendering the Points ........................................................................................................................................ 66
2.8.2 The Vertex Shader ............................................................................................................................................ 67
2.8.3 The Fragment Shader ........................................................................................................................................ 67
2.8.4 Combining the Parts ......................................................................................................................................... 68
2.8.5 The initShader Function .................................................................................................................................... 68
2.9 POLYGONS AND RECURSION ................................................................................................................................... 69
2.10 THE THREE-DIMENSIONAL GASKET ....................................................................................................................... 70
2.10.1 Use of Three-Dimensional Points ................................................................................................................... 71
2.10.2 Use of Polygons in Three Dimensions ............................................................................................................. 72
2.11 ADDING INTERACTION ........................................................................................................................................... 76
2.11.1 Using the Pointing Device ............................................................................................................................... 76
2.11.2 Window Events ............................................................................................................................................... 78
2.11.3 Keyboard Events ............................................................................................................................................. 78
2.11.4 The Idle Callback ............................................................................................................................................. 79
2.11.5 Double Buffering ............................................................................................................................................. 80
2.11.6 Window Management .................................................................................................................................... 80
2.12 MENUS ................................................................................................................................................................... 81
2.13 Scan Conversion and Drawing Algorithms ............................................................................................................. 82
2.13.1 Line Drawing Algorithms (DDA, Bresenham) .................................................................................................. 82
2.13.2 Circle and Curve Drawing ................................................................................................................................ 82
2.13.3 Anti-Aliasing Techniques ................................................................................................................................. 83
4

