1 by dr. hany elsalamony. 2 3 computer graphics generally means creation, storage and manipulation...

66
1 By Dr. Hany Elsalamony

Upload: antonia-morgan

Post on 11-Jan-2016

217 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

1By Dr. Hany Elsalamony

Page 2: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

2By Dr. Hany Elsalamony

Page 3: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

3

Computer graphics generally means creation, storage and manipulation of models and images

Such models come from diverse and expanding set of fields including physical, mathematical, artistic, biological, and even conceptual (abstract) structures

Frame from animation by William Latham, shown at SIGGRAPH 1992. Latham uses rules that govern patterns of natural forms to create his artwork.

By Dr. Hany Elsalamony

Page 4: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Examples: OpenGL™, DirectX™, Windows Presentation Foundation™ (WPF), RenderMan™

Primitives (chars, lines, polygons, meshes,…) Attributes

• color• line style• material properties for 3D

Lights Transformations Immediate mode vs. retained mode

• immediate mode: no stored representation, package holds only attribute state, and application must completely draw each frame

• retained mode: library compiles and displays from scene graph that it maintains, a complex DAG. It is a display-centered extract of the Application Model

4By Dr. Hany Elsalamony

Page 5: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

5By Dr. Hany Elsalamony

Page 6: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

6By Dr. Hany Elsalamony

Page 7: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Computer graphics – process of producing a picture or image using the computer

Computer interfaces popular on personal computers

Desktop publishing Realistic images generated using

mathematical and physical methods

7By Dr. Hany Elsalamony

Page 8: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Creating a model Perform necessary transformation Lighting and rendering the object The goal is the creation of an image

by writing a program instead of taking a picture with a camera

There exists an analogy between writing graphical programs and taking pictures by a camera

8By Dr. Hany Elsalamony

Page 9: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Pixel or “Picture element” is the simplest element in computer graphics

Single location on the computer screen or printout

Value of each pixel is the range from white to black or range of intensities of red, green, blue (RGB) colors.

9By Dr. Hany Elsalamony

Page 10: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

The pixels of an image are organized into two dimensional grid – frame buffer

Multiple frame buffers can be stored in computer memory

Double buffering – first image is drawn into frame buffer and sent to display. While the user is looking on the display, the next picture is drawing to the second buffer.

10By Dr. Hany Elsalamony

Page 11: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Image don’t fill the entire screen but is drawn into a window

Pixels are adressed within the window based on their location

Relative position of each pixel enables moving the window and change its size

11By Dr. Hany Elsalamony

Page 12: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Calculating pixel values to create impression of a realistic picture

Simulation of objects from the real word

Approximation of physical properties of objects

Limitations given by computing time and memory space

12By Dr. Hany Elsalamony

Page 13: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Modeling – creates an internal representation of the objects in the scene

Rendering – converts the screen description into image

Display – shows the image on the output device

13By Dr. Hany Elsalamony

Page 14: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Object Specification

Model

TransformationScene Description

Scene Description Model

TransformationView and Light Specification

Clipping and Hidden Surface Removal

Shading Image

14By Dr. Hany Elsalamony

Page 15: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Display TransformationImage Output

15By Dr. Hany Elsalamony

Page 16: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

1. Display of information2. Design3. Simulation and animation4. User interfaces

16By Dr. Hany Elsalamony

Page 17: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Display of information• Maps • GIS (geographic information system)• CT (computer tomography)• MRI (magnetic resonance imaging) • PET (positron-emission tomography)• Fluid flow, molecular biology,

mathematics…

17By Dr. Hany Elsalamony

Page 18: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

18By Dr. Hany Elsalamony

Page 19: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Design• CAD (computer-aided design):

VLSI (very-large-scale integrated) circuits• Together with other tools:

architecture or interior design

19By Dr. Hany Elsalamony

Page 20: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

20By Dr. Hany Elsalamony

Page 21: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Simulation and animation• Flight simulation – pilot training• Games and educational software• Benefits:

Less cost Less danger, e.g. combination with the VR

(virtual reality) techniques can help surgical interns and astronauts

21By Dr. Hany Elsalamony

Page 22: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

User interfaces• Friendly working environment:

windows, icons, menus, pointing devices

22

Interface for a painting program

By Dr. Hany Elsalamony

Page 23: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

23

Specifications of the functions in the graphics library

•The OpenGL graphics system is an Application Programming Interface (API) to graphics hardware.

By Dr. Hany Elsalamony

Page 24: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

24

Objects Viewers Light sources Material properties

By Dr. Hany Elsalamony

Page 25: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

25

Position (COP)

Orientation Focal length Film plane

By Dr. Hany Elsalamony

Page 26: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

26

Wireframe Flat shading

• HSR (Hidden surface removal) Smooth shading Curves and surfaces

• NURBS, Bezier curves/surfaces Texture mapping

• Bump mapping, environmental maps, antialiasing…

By Dr. Hany Elsalamony

Page 27: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

27By Dr. Hany Elsalamony

Page 28: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

28By Dr. Hany Elsalamony

Page 29: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

29

High-end systems: VRAM or DRAM Simpler systems: part of memory Depth: the number of bits per pixel True color: depth=24 Resolution: the number of pixels in

the frame buffer

By Dr. Hany Elsalamony

Page 30: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

30

Conversion of geometric entities to pixels in the frame buffer

• High-end systems Special-purpose processors

• Simpler systems A single and shared processor

By Dr. Hany Elsalamony

Page 31: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

31

CRT (Cathode-ray tube)By Dr. Hany Elsalamony

Page 32: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

32

CRT• Refresh: at least 50 times per second• Interlace and non-interlace systems• Color CRTs have three colored phosphors

and a shadow mask Other raster devices:

• LCD (liquid-crystal displays)• Plasma panels and digital projection

systems• Non-refreshable: printers and plotters

By Dr. Hany Elsalamony

Page 33: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

33By Dr. Hany Elsalamony

Page 34: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

34

Mouse Joystick Data tablet Anything else?

Hand Foot Voice Mind?

By Dr. Hany Elsalamony

Page 35: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Image formation• Lighting• Shading• Properties of materials

35By Dr. Hany Elsalamony

Page 36: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Object: formed from geometric primitives• Points, lines, polygons• Vertex (pl. Vertices) is the most primitive

one Viewer:

• Locations• Viewing angles

36By Dr. Hany Elsalamony

Page 37: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

37By Dr. Hany Elsalamony

Page 38: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

38

3D world 2D image

By Dr. Hany Elsalamony

Page 39: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

39By Dr. Hany Elsalamony

Page 40: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

40

Synthetic-camera Model

Film Plane

Projection Plane

By Dr. Hany Elsalamony

Page 41: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

41By Dr. Hany Elsalamony

Page 42: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

42

Penetrating transparent surfaces

Reflected by

Mirrors

Diffuse surfaces

Refracted

AbsorbedBy Dr. Hany Elsalamony

Page 43: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

43

Visual system does not have the same response to each color.We are most sensitive to green light

By Dr. Hany Elsalamony

Page 44: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

44By Dr. Hany Elsalamony

Page 45: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

45

dz

xx

dz

yy

p

p

/

/

d

h

2tan2 1

(xp, yp, -d) is the projection of (x, y, z)

By Dr. Hany Elsalamony

Page 46: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

46

Bellows Camera Projector

By Dr. Hany Elsalamony

Page 47: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

47

COP(Center of Projection)

Focal Length

By Dr. Hany Elsalamony

Page 48: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

48By Dr. Hany Elsalamony

Page 49: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

49

Clipping Window

By Dr. Hany Elsalamony

Page 50: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Wireframe Flat shading

• HSR (Hidden surface removal) Smooth shading Curves and surfaces

• NURBS, Bezier curves/surfaces Texture mapping

• Bump mapping, environmental maps, antialiasing…

50By Dr. Hany Elsalamony

Page 51: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

51By Dr. Hany Elsalamony

Page 52: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

52By Dr. Hany Elsalamony

Page 53: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

53By Dr. Hany Elsalamony

Page 54: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

54By Dr. Hany Elsalamony

Page 55: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

55By Dr. Hany Elsalamony

Page 56: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

56By Dr. Hany Elsalamony

Page 57: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

57By Dr. Hany Elsalamony

Page 58: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

58

Example: Scene graph

By Dr. Hany Elsalamony

Page 59: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

59

Early graphics system

Computeline segments

Drawline segments

Very high rate to avoid flickering

By Dr. Hany Elsalamony

Page 60: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

60

Display-processor architectureBy Dr. Hany Elsalamony

Page 61: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

61

Arithmetic pipeline: doubling the throughput!

Pipeline Architecture: Geometric pipeline

By Dr. Hany Elsalamony

Page 62: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

62

Arithmetic pipeline: doubling the throughput!

Pipeline Architecture: Geometric pipeline

By Dr. Hany Elsalamony

Page 63: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Transformation• Conversion between coordinate systems• Translation, rotation, scaling• Aggregate transforms by matrix

multiplications Clipping

• Could be further pipelined

63By Dr. Hany Elsalamony

Page 64: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

Projection• Remaining 3D objects are projected into 2D

objects• Parallel or perspective projections

Rasterization• Convert 2D objects into pixels

64By Dr. Hany Elsalamony

Page 65: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

65

Latency Throughput:

• How fast we can move geometric entities through the pipeline

• How many pixels per second we can alter in the frame buffer

Pipeline architecture is not a must• Ray tracing or radiosity for better quality

By Dr. Hany Elsalamony

Page 66: 1 By Dr. Hany Elsalamony. 2 3  Computer graphics generally means creation, storage and manipulation of models and images  Such models come from diverse

66

Application of computer graphics A graphics system Human visual system Pinhole and synthetic camera models Image formation Geometric pipeline Realistic images may require

resolution of up to 40006000

By Dr. Hany Elsalamony