11
Computer Graphics Apurva A. Desai

Computer Graphics - content.kopykitab.com · 1.1 Historical Background of Computer Graphics2 1.2 Applications of Computer Graphics 4 1.2.1 Entertainment 4 1.2.2 Advertisement 4 1.2.3

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Computer Graphics - content.kopykitab.com · 1.1 Historical Background of Computer Graphics2 1.2 Applications of Computer Graphics 4 1.2.1 Entertainment 4 1.2.2 Advertisement 4 1.2.3

Computer GraphicsComputer Graphics

Apurva A. Desai

Page 2: Computer Graphics - content.kopykitab.com · 1.1 Historical Background of Computer Graphics2 1.2 Applications of Computer Graphics 4 1.2.1 Entertainment 4 1.2.2 Advertisement 4 1.2.3

���������� ��

������� ��� ������������� �� ���

������������������������������� ����� ������������ ���������

����

���� ���� !!"""!����

Page 3: Computer Graphics - content.kopykitab.com · 1.1 Historical Background of Computer Graphics2 1.2 Applications of Computer Graphics 4 1.2.1 Entertainment 4 1.2.2 Advertisement 4 1.2.3

�� ���� �������������� �� ���

������������������� ����� ������ � ���������� ! �� � � �!�������������"������"#� �! ���""$���� ��� ����"��%��� �� ���� #"���� ��� � ��"����!� "�� ���� "�!��� ������� � �!"��� ���� �� "� �� �� � ��� #�"�� �!�� ��� �!��

����������������������

&!�� �'�"��� � �!��� "#� �! �� �""$� ���� ������� �" � �� � �!� �!�� ��� �!��

��� �!��� ��� ��"$�� (� )!"�!�� ���� ����� ��� �� ����� � � ����� *+,-�� ."�����!�� . �%������� � ! +//���/� ���� �� ����� ��� 0�1$��� � 2 �%�� %� ������� 3+456,�� )&� (���� � 0"��������� � � ������ � ! +//��44

Page 4: Computer Graphics - content.kopykitab.com · 1.1 Historical Background of Computer Graphics2 1.2 Applications of Computer Graphics 4 1.2.1 Entertainment 4 1.2.2 Advertisement 4 1.2.3

��������� �

�� ��� � �� ����� ����

��� �� �� ������

�� ����� �����

����� ��� �� ���

�� �� ��� ����

����� �������

�� ����� ��� �� ��� ����

�����

�� ��� ���� ��� ��� ����� ��

���

��� � �� �� �� � ����!��!��"

��� ��� ���� � �� ����� �� �� ��

Page 5: Computer Graphics - content.kopykitab.com · 1.1 Historical Background of Computer Graphics2 1.2 Applications of Computer Graphics 4 1.2.1 Entertainment 4 1.2.2 Advertisement 4 1.2.3
Page 6: Computer Graphics - content.kopykitab.com · 1.1 Historical Background of Computer Graphics2 1.2 Applications of Computer Graphics 4 1.2.1 Entertainment 4 1.2.2 Advertisement 4 1.2.3

v

CONTENTS

Foreword ...................................................................................................... ixPreface .......................................................................................................... xiAcknowledgements ...................................................................................... xv

1. Overview of Computer Graphics .......................................... 1–301.1 Historical Background of Computer Graphics 21.2 Applications of Computer Graphics 4

1.2.1 Entertainment 41.2.2 Advertisement 41.2.3 Simulation Modelling 51.2.4 Architecture 51.2.5 Information Visualization and Processing 61.2.6 Virtual Reality 61.2.7 Image Processing 71.2.8 Miscellaneous 7

1.3 Some Popular Graphics Softwares 81.4 Pixel Graphics vs. Vector Graphics 91.5 Hard Copy Graphics Devices 10

1.5.1 Dot Matrix Printers 101.5.2 Inkjet Printer 111.5.3 Laser Printer 131.5.4 Plotters 14

1.6 Computer Display Devices 151.6.1 Early Days of Imaging Technology 161.6.2 Cathode Ray Tube (CRT) 171.6.3 Liquid Crystal Display (LCD) 19

1.7 Input Devices 201.7.1 Text Input Devices 201.7.2 Pointing Devices 211.7.3 Image and Video Input Devices 24

Summary 26Exercises 27Suggested Readings and Bibliography 27

2. Mathematical Foundation for Computer Graphics ......... 31–702.1 Basic Geometry 31

2.1.1 Straight Line and Line Segment 322.1.2 Circle 392.1.3 Ellipse 412.1.4 Conic Sections 43

2.2 3-Dimensional Geometry 462.3 Trigonometry 49

Page 7: Computer Graphics - content.kopykitab.com · 1.1 Historical Background of Computer Graphics2 1.2 Applications of Computer Graphics 4 1.2.1 Entertainment 4 1.2.2 Advertisement 4 1.2.3

vi Contents

2.4 Matrix Algebra 522.4.1 Some Special Types of Matrices 532.4.2 Matrix Operations 55

Summary 67Exercises 67Suggested Readings and Bibliography 69

3. Graphics Primitives ............................................................ 71–1043.1 Line Drawing Algorithms 72

3.1.1 VECGEN Algorithm 733.1.2 Brasenham Line Drawing Algorithm 75

3.2 Circle Generating Algorithms 813.2.1 Parametric Circle Drawing Algorithm 823.2.2 Brasenham Circle Drawing Algorithm 83

3.3 Different Line Styles 863.3.1 Thick Line 873.3.2 Line Caps 893.3.3 Thick Line Joints 903.3.4 Pens and Brushes 91

3.4 Curves 913.4.1 DDA Approach for Drawing a Circular Arc 92

3.5 Text and Character Attributes 943.6 Anti-aliasing 97Summary 99Exercises 100Programming Problems 100Suggested Readings and Bibliography 102

4. Polygons .............................................................................. 105–1404.1 Polygon 1054.2 Polygon Inside Tests 109

4.2.1 Even–Odd Method 1094.2.2 Winding Number Method 1144.2.3 Some Other Methods for Performing Inside Test 118

4.3 Polygon Area Filling 1204.3.1 Flood Fill Method 1204.3.2 Scan-line Fill Method 1234.3.3 Boundary Fill 1314.3.4 Filling Polygon with Patterns 134

Summary 136Review Questions 136Programming Problems 137Suggested Readings and Bibliography 139

5. Geometric Transformations ......................................... 141–1725.1 Basic Transformation 141

5.1.1 Scaling 1425.1.2 Translation 1445.1.3 Rotation 145

5.2 Homogeneous Coordinates 1485.3 Rotation Relative to an Arbitrary Point 1525.4 Some Other Transformations 155

5.4.1 Reflection 1555.4.2 Shearing 161

Page 8: Computer Graphics - content.kopykitab.com · 1.1 Historical Background of Computer Graphics2 1.2 Applications of Computer Graphics 4 1.2.1 Entertainment 4 1.2.2 Advertisement 4 1.2.3

Contents vii

5.5 Coordinate Transformation 1655.6 Inverse Transformation 1665.7 Affine Transformation 1665.8 Raster Transformation 1665.9 Transforming Polygon with Pattern 168Summary 170Exercises 170Programming Problems 171Suggested Readings and Bibliography 171

6. Viewing in Two Dimensions ............................................ 173–2096.1 Window and Viewport 1736.2 Viewing Transformation 1756.3 Clipping 179

6.3.1 Point Clipping 1806.3.2 Line Clipping 181

6.4 Polygon Clipping 2006.4.1 Sutherland–Hodgman Polygon Clipping Algorithm 200

6.5 Text Clipping 2036.6 Interior and Exterior Clipping 2056.7 Multiple Windowing 2056.8 Generalized Clipping 206Summary 207Exercises 207Programming Problems 208Suggested Readings and Bibliography 208

7. Graphics in Three Dimensions ........................................ 210–2487.1 Displays in Three Dimensions 2107.2 3-D Transformation 2127.3 Rotation of a 3-Dimensional Object 214

7.3.1 Rotation Transformation about an Arbitrary Axis 2177.4 3-Dimensional Viewing 225

7.4.1 Viewing Parameters 2257.4.2 Projection 2287.4.3 Perspective Projection 2347.4.4 Types of Perspective Projections 237

7.5 Clipping in Three Dimensions 240Summary 243Exercises 243Programming Problems 244Further Readings and Bibliography 245

8. Hidden Surfaces ................................................................. 249–2678.1 Back Face Removal Algorithm 2508.2 Z-Buffer Method 2538.3 A-Buffer Algorithm 2558.4 Scan-line Algorithm 2568.5 Painter’s Algorithm 2568.6 Warnock’s Algorithm 2598.7 Binary Space Partition (BSP) Method 2618.8 Ray Casting Algorithm 265

Page 9: Computer Graphics - content.kopykitab.com · 1.1 Historical Background of Computer Graphics2 1.2 Applications of Computer Graphics 4 1.2.1 Entertainment 4 1.2.2 Advertisement 4 1.2.3

viii Contents

Summary 265Exercises 265Programming Problems 266Further Readings and Bibliography 266

9. Colours and Shading ........................................................ 268–2929.1 Light Sources 2689.2 Illumination 2709.3 Shading 272

9.3.1 Constant Shading 2739.3.2 Gouraud Shading 2749.3.3 Phong Shading 274

9.4 Transparency 2759.5 Shadow 2779.6 Colours 279

9.6.1 RGB Colour Model 2819.6.2 CMY Colour Model 2849.6.3 HSV Colour Model 285

Summary 288Exercises 288Programming Problems 289Further Readings and Bibliography 289

10. Graphics Standards ........................................................... 293–31110.1 Graphics Kernel System (GKS) 29410.2 PHIGS 29710.3 OpenGL 29910.4 Graphics File Formats 301

10.4.1 Bitmap File Format 30210.4.2 JPEG 30510.4.3 GIF 306

Summary 309Exercises 309Programming Problems 310Further Readings and Bibliography 310

11. Introduction to Advanced Graphics Techniques ......... 312–34011.1 Computer Animation 31211.2 Morphing 31611.3 Digital Image Processing 318

11.3.1 Image Restoration and Enhancement Methods 31811.4 Fractals 322

11.4.1 Hilbert’s Curve 32311.4.2 Koch Snowflake Curve 32411.4.3 Fractal Surface 326

11.5 Ray Tracing 330Summary 333Exercises 333Further Readings and Bibliography 334

Index .......................................................................................... 341–347

Page 10: Computer Graphics - content.kopykitab.com · 1.1 Historical Background of Computer Graphics2 1.2 Applications of Computer Graphics 4 1.2.1 Entertainment 4 1.2.2 Advertisement 4 1.2.3

��

�����

*� ��� ���� *��������� ���? ��� ����� �� ����������� ������ ��������.�� ��������� ������������� ���&� � ���� ��� �� ��������� �����#������� ���� @�����& ���� ��� -���� �� ������� ��� .����? �������?����? ��� ������� .& .��� ������ ��� *����� �"����� �� �#�? ��� ����������� ������ ������ ���� �� ��� ����� �� ������ �����? ���������� ������� �� �� ��#��������� �� ����#��� ��� @�����& �� ���������� ������� ��������������

0� ��� ���� ��� ����� � ���? ������� ������ �� .���� #�� �� ����� ���� ��� ���� �� #����� ��������� .����� �� ��� ����������� ����#��� ���� ��� �� ������������? ��#�������? ��������? �������?����������? ��� 5�? .���� �� ��� ������ ��������? �� �� �&� �� ���������� �� � .��� ���� ���� �� ��� ����� �� ��� *����� �������� ��������� ��� ��.8�� ���� ��� ������������ �� ��� ������ ��#��������� ������������� �������

&�� ����� '� !�� .& ������� ���#� �� '���� ��� ��� �� ����������� ���� �� ���� ��� ������ �������

,�� .��� �� ������ �� #�& ��� ��������? ������+ ��� �� ��� �������������+ ���? ��� ������� � ���� �� ������ �� ������ ������? ��� ���� ���������� ,������ ���� ��� �������� ��� ��������� ������ ����� ������? ���� ��"� �� ������ ������ �� � ���� ����� ����� �������� �� ��� �� ��� ���������

,�� .��� �#�� ��� ��� ��������� ��� ����#�.�� ������ �� ������������� *� ����& ���������� ���� '����:� ��+����� ������������ �� �����.8�� ��� ������ ��� �� ��� #��� �"������ �� ������� ��� ����� �������� ������������

,�� ����� ����� ���� .� ��� �������� �� ��6�A��,���? -�6�A-�,���?��� ��� -��� �������� ������� ����� �� ��� ���������� �� ������������ ��� *��������� ,�������&? �� ��� �� ��� �������� �� ��� ���-�� ������

Page 11: Computer Graphics - content.kopykitab.com · 1.1 Historical Background of Computer Graphics2 1.2 Applications of Computer Graphics 4 1.2.1 Entertainment 4 1.2.2 Advertisement 4 1.2.3

Computer Graphics

Publisher : PHI Learning ISBN : 9788120335240 Author : DESAI, APURVA A.

Type the URL : http://www.kopykitab.com/product/7375

Get this eBook

25%OFF