Chapter 1 Overview of Computer Graphics

17
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Overview of Computer Graphics Chapter1 O verview ofCom puterG raphics Chapter2 2D G raphics:Basics Chapter4 2D G raphics:A dvanced Topics Basic conceptsofcom putergraphics, system s, program m ing platform s, and standards Chapter3 2D G raphics:Rendering D etails

description

Chapter 1 Overview of Computer Graphics. Objectives. To understand the basic objectives and scope of computer graphics To identify computer graphics applications To understand the basic structures of 2D and 3D graphics systems To understand evolution of graphics programming environments - PowerPoint PPT Presentation

Transcript of Chapter 1 Overview of Computer Graphics

Page 1: Chapter 1 Overview of Computer Graphics

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

Chapter 1 Overview of Computer Graphics

Chapter 1 Overview of Computer Graphics

Chapter 2 2D Graphics: Basics

Chapter 4 2D Graphics: Advanced Topics

Basic concepts of computer graphics, systems, programming platforms, and standards

Chapter 3 2D Graphics: Rendering Details

Page 2: Chapter 1 Overview of Computer Graphics

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

Objectives To understand the basic objectives and scope of

computer graphics To identify computer graphics applications To understand the basic structures of 2D and 3D

graphics systems To understand evolution of graphics programming

environments To identify common graphics APIs To understand the roles of Java language, Java 2D and

Java 3D packages To identify computer graphics related fields

Page 3: Chapter 1 Overview of Computer Graphics

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.

Rendering

Virtual world model Image of a scene

Page 4: Chapter 1 Overview of Computer Graphics

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

Graphics System:Components and Functions

Modeler Renderer Hardware device Virtual World View

Geometry Transformation Illumination Interaction Animation

Page 5: Chapter 1 Overview of Computer Graphics

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

Applications

User interface Computer Aided Design Medical systems Video games Movies …

Page 6: Chapter 1 Overview of Computer Graphics

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)

Page 7: Chapter 1 Overview of Computer Graphics

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”.

E

SE

Program the graphics hardware directly Typically written in low-level languages Manipulate the hardware registers and video buffers Highly machine-dependent Example: MS-DOS graphics program

SourceSource

Page 8: Chapter 1 Overview of Computer Graphics

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

Operating System Level Program through OS graphics support Do not directly manipulate graphics hardware Portable on the same platform Example: WIN32

SourceSource RunRun

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);

Page 9: Chapter 1 Overview of Computer Graphics

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

GKS and PHIGSGraphics Kernel System

Programmer’s Hierarchical Interactive Graphics System

International standard (ISO 7942 1985) 2D graphics Common language binding: FORTRAN Example: A FORTRAN GKS program to draw a circle

ISO 9592 1991 3D graphics

SourceSource

Page 10: Chapter 1 Overview of Computer Graphics

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

OpenGL

SourceSource

Popular 2D/3D graphics API over 200 functions Common language binding: C Example: An OpenGL program to draw a circle

GLU

GLUT

GLRunRun

Page 11: Chapter 1 Overview of Computer Graphics

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

OpenGL

SourceSource

3D Example: A spinning sphere

RunRun

Page 12: Chapter 1 Overview of Computer Graphics

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

Page 13: Chapter 1 Overview of Computer Graphics

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

Java Programming Languages

Simple Object Oriented (OOP) Write once, run anywhere Multithreaded

Java graphics: AWT / Swing

AWT ExampleSourceSource

RunRun

Page 14: Chapter 1 Overview of Computer Graphics

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

JOGL

OpenGL Java language binding No OOP modeler

SourceSource

RunRun

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.

Page 15: Chapter 1 Overview of Computer Graphics

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

Java 2D

Standard package of Java 2 platform Improvements over AWT Graphics2D class

SourceSource

RunRun

Page 16: Chapter 1 Overview of Computer Graphics

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

Java 3D High-level API Scene graph Modeler/Renderer Java Integration

SourceSource

RunRun

TG

Rotator

Appearance

Texture2D

Background

Bounds Sphere

Geometry

Texture coordinates

TG

Appearance Text3D

L

BG

L

S

Material

View

Branch

Page 17: Chapter 1 Overview of Computer Graphics

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

Other Fields Related to Graphics

Image processing Computer vision Mathematics

– Analytic geometry– Linear algebra