Computer Graphics Using Java™ 2D and 3D
Total Page:16
File Type:pdf, Size:1020Kb
COMPUTER GRAPHICS USING JAVA™ 2D AND 3D Hong Zhang Y. Daniel Liang Armstrong Atlantic State University PEARSON Upper Saddle River, NJ 07458 CONTENTS Chapter 1 Overview of Computer Graphics 1 1.1 Introduction 2 1.2 Evolution of Computer Graphics Programming 3 1.3 Java Programming Language 16 1.4 Java 2D 20 1.5 Java 3D 23 1.6 Related Fields 26 1.7 Resources 27 Chapter 2 2D Graphics: Basics 31 2.1 Introduction 32 2.2 2D Rendering Process 32 2.3 2D Geometry and Coordinate Systems 33 2.4 The Graphics2D Class 35 2.5 Graphing Equations 38 2.6 Geometric Models ' 40 2.7 Constructive Area Geometry 49 2.8 General Path 51 Chapter 3 2D Graphics: Rendering Details 59 3.1 Introduction 60 3.2 Colors and Paints 60 3.3 Strokes 67 3.4 Affine Transformation 70 3.5 Compositions of Transformations 78 3.6 Transparency and Compositing Rules 81 3.7 Clipping 85 3.8 Text and Font 87 Chapter 4 2D Graphics: Advanced Topics (Optional) 97 4.1 Introduction 98 4.2 Spline Curves 98 4-3 Custom Primitives 104 4-4 Image Processing 107 4.5 Creating Fractal Images 115 4.6 Animation 118 4.7 Printing 127 Chapter 5 Basic 3D Graphics 135 5.1 Introduction 136 5.2 3D Rendering Process 136 5.3 Java 3D API Overview 138 5.4 Java 3D Scene Graphs 141 5.5 The Superstructure 144 5.6 The Nodes 145 5.7 The Node Components 149 5.8 The Structure of a Java 3D Program 150 5.9 Backgrounds and Bounds 154 5.10 Compiling Scene Graphs and Capability Bits 160 Chapter 6 Graphics Contents 169 6.1 Introduction 170 6.2 Points and Vectors 170 6.3 Geometry 172 6.4 Geometrylnfo 185 6.5 Primitives 193 6.6 Fonts and Texts 196 6.7 Appearance and Attributes , 197 Chapter 7 Geometric Transformation 209 7.1 Introduction 210 7.2 3D Affine Transformations 210 7.3 Transformations in Scene Graphs 225 7.4 Composite Transforms 229 7.5 Constructing Geometries with Transformations 234 Chapter 8 Views 247 8.1 Introduction 248 8.2 Projections 248 8.3 Specification of a View 251 8.4 Java 3D View Model 253 8.5 Picking 265 8.6 Head Tracking 271 Chapter 9 Lighting and Texturing 28i 9.1 Introduction 282 9.2 Lights 282 9.3 Illumination Models 288 9.4 Java 3D Lighting Models 290 9.5 Atmospheric Attenuation and Depth Cueing 294 9.6 Texture Mapping 297 Chapter 10 Behavior and Interaction 315 10.1 Introduction 316 10.2 Behavior 316 10.3 Interaction 323 10.4 Behavior and Picking 334 Chapter 11 Animation 345 I I.I Introduction 346 11.2 Alpha Objects 346 11.3 Interpolators 350 11.4 Morphing 361 11.5 LOD 366 11.6 Billboard 370 Chapter 12 Additional 3D Topics 379 12.1 Introduction 380 12.2 3D Curves 380 12.3 Surfaces 384 12.4 Sound - 390 12.5 Shadows 394 12.6 Geometry Change 399 12.7 Off Screen Rendering 405 12.8 3D Textures 409 APPENDIXES Appendix A 419 Appendix B 443 Index 455 .