Presentation is loading. Please wait.

Presentation is loading. Please wait.

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Overview of Computer Graphics.

Similar presentations


Presentation on theme: "Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Overview of Computer Graphics."— Presentation transcript:

1 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Overview of Computer Graphics

2 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 2 Objectives F To understand the basic objectives and scope of computer graphics F To identify computer graphics applications F To understand the basic structures of 2D and 3D graphics systems F To understand evolution of graphics programming environments F To identify common graphics APIs F To understand the roles of Java language, Java 2D and Java 3D packages F To identify computer graphics related fields

3 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 3 Computer Graphics Modeling: Creating a virtual world. Rendering: Generating a visual image of a scene.

4 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 4 Graphics System: Components and Functions F Modeler F Renderer F Hardware device F Virtual World F View F Geometry F Transformation F Illumination F Interaction F Animation

5 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 5 Applications F User interface F Computer Aided Design F Medical systems F Video games F Movies F …

6 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 6 Graphics Programming Environment Hardware (direct register/video buffer programming) OS (WIN32, X, Mac OS) Graphics Standard (GKS, PHIGS, OpenGL) Platform Independent (Java 3D)

7 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 7 Hardware Level Determination of the pixels on a circle. From the current pixel, the next pixel will be either to the “east” or to the “southeast”. F Program the graphics hardware directly F Typically written in low-level languages F Manipulate the hardware registers and video buffers F Highly machine-dependent F Example: MS-DOS graphics program Source

8 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 8 Operating System Level F Program through OS graphics support F Do not directly manipulate graphics hardware F Portable on the same platform F Example: WIN32 SourceRun hdc = BeginPaint (hwnd, &ps); GetClientRect (hwnd, &rc); cx = (rc.left + rc.right)/2; cy = (rc.top + rc.bottom)/2; if (rc.bottom - rc.top < rc.right - rc.left) r = (rc.bottom - rc.top) / 2 - 20; else r = (rc.right - rc.left) / 2 - 20; Ellipse(hdc, cx-r, cy-r, cx+r, cy+r); EndPaint (hwnd, &ps);

9 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 9 GKS and PHIGS Graphics Kernel System Programmer’s Hierarchical Interactive Graphics System F International standard (ISO 7942 1985) F 2D graphics F Common language binding: FORTRAN F Example: A FORTRAN GKS program to draw a circle F ISO 9592 1991 F 3D graphics Source

10 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 10 OpenGL Source F Popular 2D/3D graphics API F over 200 functions F Common language binding: C F Example: An OpenGL program to draw a circle GLU GLUT GL Run

11 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 11 OpenGL Source 3D Example: A spinning sphere Run

12 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 12 Java Java 3D OpenGL Java APIs Display driver Graphics card Display Graphics application Java VM OS Java 3D based graphics systems

13 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 13 Java Programming Languages F Simple F Object Oriented (OOP) F Write once, run anywhere F Multithreaded Java graphics: AWT / Swing AWT Example Source Run

14 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 14 JOGL F OpenGL Java language binding F No OOP modeler Source Run 1.Create a GLCanvas or GLJPanel object through the GLDrawableFactory class. 2.Add a GLEvent listener to the canvas object. 3.Implement the listener by implementing the four methods: init, display, reshape, and displayChanged.

15 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 15 Java 2D F Standard package of Java 2 platform F Improvements over AWT F Graphics2D class Source Run

16 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 16 Java 3D F High-level API F Scene graph F Modeler/Renderer F Java Integration Source Run

17 Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 17 Other Fields Related to Graphics F Image processing F Computer vision F Mathematics –Analytic geometry –Linear algebra


Download ppt "Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Overview of Computer Graphics."

Similar presentations


Ads by Google