26
1 ECE 104 Fundamentals of Computer Graphics Falko Kuester BERKELEY • DAVIS • IRVINE • LOS ANGELES • RIVERSIDE • SAN DIEGO • SAN FRANCISCO SANTA BARBARA • SANTA CRUZ 2 Instructor : Falko Kuester Email : [email protected] Course web-page : graphics.eng.uci.edu/courses/ece104 Instruction : M., W. 5:00-6:50pm SSL 140 Office hours : W 7:00-8:00pm ET 444D or by appointment ECE 104 Fundamentals of Computer Graphics Spring 2002 BERKELEY • DAVIS • IRVINE • LOS ANGELES • RIVERSIDE • SAN DIEGO • SAN FRANCISCO SANTA BARBARA • SANTA CRUZ

Fundamentals of Computer Graphics

  • Upload
    others

  • View
    24

  • Download
    0

Embed Size (px)

Citation preview

1

1

ECE 104

Fundamentals ofComputer Graphics

Falko Kuester

BERKELEY • DAVIS • IRVINE • LOS ANGELES • RIVERSIDE • SAN DIEGO • SAN FRANCISCO SANTA BARBARA • SANTA CRUZ

2

Instructor : Falko KuesterEmail : [email protected] web-page : graphics.eng.uci.edu/courses/ece104Instruction : M., W. 5:00-6:50pm SSL 140Office hours : W 7:00-8:00pm ET 444D or by appointment

ECE 104Fundamentals of Computer Graphics

Spring 2002

BERKELEY • DAVIS • IRVINE • LOS ANGELES • RIVERSIDE • SAN DIEGO • SAN FRANCISCO SANTA BARBARA • SANTA CRUZ

2

3

TA : Sergio CarnallaEmail : [email protected] web-page : graphics.eng.uci.edu/courses/ece104Office hours : T., Th. 6:00-8:00pm EG3151Lab hours : T., Th. 6:00-8:00pm EG3151

ECE 104Fundamentals of Computer Graphics

Spring 2002

BERKELEY • DAVIS • IRVINE • LOS ANGELES • RIVERSIDE • SAN DIEGO • SAN FRANCISCO SANTA BARBARA • SANTA CRUZ

4

Course Overview and Description

Comprehensive introduction to computer graphicsHardware, software and applicationsFocus on basic concepts underlying computer graphics Establish a strong foundation for designer of graphics systemsUse of OpenGL to study the theoretical foundations, architecture and algorithmic issues of computer graphics

Prerequisites

ECE 40 Good knowledge of algorithms, data structures, basic linear algebra and trigonometry

3

5

TextRequired

Foley, van Dam, Feiner, Hughes, Computer Graphics: Principles and Practice.

RecommendedEdward Angel, Interactive Computer Graphics: A Top-Down Approach with OpenGL, 2/e, Addison Wesley, 2000, 613pp.,ISBN 0-201-38597-X.

Woo, Neider, Davis, Sheiner, OpenGL Programming Guide: The Official Guide to Learning OpenGL.

Reference Hill, Francis S., Jr., Hill, Francis J., Computer Graphics Using OpenGL.

Watt, A., 3D Computer Graphics, 3/e, Addison Wesley, 2000.

6

Grading

Projects:Assignment 1: 15%Assignment 2: 15%Assignment 3: 15%Assignment 4: 15%

Exams:Mid-Term: 20%Final: 20% (comprehensive exam)

4

7

Projects

Project gradesCompleteness and correctness (80%)User Interface (10%)Documentation (5%)Coding standard compliance (5%)

Project submissionSource code A readme file stating

What did you implement? How did you implement it?Which problems did you encounter? Additional features you implemented.

MiscellaneousAll assignments will be available on the course home page.

8

Schedule

Week Monday Wednesday

1 Introduction to Computer Graphics Graphics Programming

2 The OpenGL State Machine Input and Interaction

3 Geometric Objects & Transformations I

Geometric Objects & Transformations II

4 Viewing and Projections I Viewing and Projections II

5 MIDTERM Curves and Surfaces

6 Clipping Hidden Line/Surface Removal

7 Lighting and Shading I Lighting and Shading II

8 Texture Mapping I Texture Mapping II

9 Ray Tracing I Ray Tracing II

10 Image Based Modeling and Rendering Advanced Topics

5

9

Description

Introduction: Graphics Systems & Models – graphics architectures and software, imaging: pinhole camera, human vision, synthetic camera, modeling vs. rendering.Graphics Programming: OpenGL – architecture, displaying simple two-dimensional geometric objects, positioning systems, working in a windowed environment.Input & Interaction – input devices, event-driven programming, GLUT, using callbacks.Geometric Objects & Transformations – affine transformations (translation, rotation, scaling, shear), homogeneous coordinates, concatenation, current transformation and matrix stacks.Viewing & Projections – classical three dimensional viewing, specifying views, affinetransformation in 3D, projective transformations, three dimensional architectures.Shading – light sources, reflections, polygonal shading, recursive subdivision, ray tracing.Rendering – introduction to primitive clipping, hidden surface removal, scan conversion.Texture Mapping – introduction to texture mapping.Image Based Modeling and Rendering – introduction to the latest techniques of combining images and computer graphics to obtain realistic results.

10

Computer GraphicsDisplay of InformationDesignSimulationUser Interfaces

Slides Courtesy of Vinnie Costa of Hofstra University

6

11

Scientific Visualization

12

Arts and Design

+=

7

13

Simulation

14

User Interfaces

8

15

Human Visual System

16

Human Visual System

Lens, Iris, Retina, Rods & ConesVisual Acuity = ResolutionBrightness – perceived intensityResponse varies with colorPrimary colors – RGB (additive),

CMY (subtractive)

9

17

Human Vision

RetinaCones : color sensing receptors

high concentration at the centeruniform 5% of central value for > 18 degrees

Rod : non-color sensingnone at the center increase to max at ~18 degrees

color information is limited at periphery

(Hood and Finkelstein, 1986)

18

Human Vision

Cones3 types (pigment-based)small, medium and long wavelength3:7:14 ratio

120 * 106 rod photoreceptors per eye6.5 * 106 cone photoreceptors per eye

1 * 106 fibers are leaving the eye

10

19

Spatial Vision

Depth perceptionRelative position / occlusionShadingSharpnessSizePerspectiveStructureMotion - parallax

20

Graphics System

ProcessorMemoryFrame BufferOutput DevicesInput Devices

11

21

Raster

22

Frame Buffer

Pixels are stored in a frame bufferVRAM, DRAMDepth – number of bits per pixel1 bit: 2 colors8 bit: 28 = 256 colorsResolutionRasterization - processor converts geometric entities to pixel assignments in the frame buffer

12

23

Output

Cathode-ray tube (CRT)Refresh RateNoninterlaced (50-85 Hz) vs Interlaced (odd/even 60 Hz))

RGB gunsLCDs

24

Interlacing (interleave)

Derived from TV standardNTSC and PAL use interlacing

Divides single frame in two fields

Odd and even scan line separation1, 3, 5, 7, …. and 2, 4, 6, 8,…..

13

25

Input

Mouse

Stylus, Pen, Tablet

Keyboard

26

Visualization

ObjectSpecified by points, lines, and polygons in the 3D space.

ViewerPoint of view

We (viewer) form images of objectsLight

14

27

Visualization

28

Visualization

15

29

Light

Electromagnetic RadiationVisible spectrum350 (blue) – 780 (red) nanometers

Radio --- Visible --- Heat Point Source – single locationMonochromatic – single frequency

30

Ray Tracing

Ray – semi-infinite line emanating from a point.Diffuse surface, reflected, refractedRay Tracing is an image forming technique.

16

31

Ray Tracing

32

The Math BeginsLet the light on a flat surface be a, and the object which forms the primary shadow be bc. The wall de is the surface on which the derivative shadow is received at the place mn. The remainder, dn and me, continues to be illuminated by a, and the light from dn is reflected in the primitive shadow bc, and the light from me does the same. Thus the derivative shadow nm, which is not exposed to the light a, remains dark, while the primitive shadow is illuminated by the lit background which surrounds the derivative shadow. Therefore the derivative is darker than the primitive.

- Leonardo da Vinci

17

33

Pinhole Camera

Small hole in the center of one sideFilm placed on opposite side

34

Pinhole Camera

Projection: image of a point is a pointInfinite Depth of Field: every point within field of view is in focusIn basic computer graphics, all objects are in focus

18

35

www.pinhole.com

36

Synthetic Camera Model

Creating a computer generated image is similar to forming an image using an optical system

19

37

Synthetic Camera Model

Projector Center of ProjectionProjection Plan

38

Synthetic Camera Model

Clipping RectangleClipping Window

20

39

The Programmer’s Interface

40

Application Programmer’s Interface

API – set of functions that interface between an application program and a graphics systemSynthetic Camera Model: OpenGL, PHIGS, Java3D

21

41

Basic Functions of API’s

ObjectsViewerLight SourcesMaterial Properties

42

Objects

Usually defined by a set of vertices

glBegin(GL_POLYGON);glVertex3f(0.0, 0.0, 0.0);glVertex3f(0.0, 1.0, 0.0);glVertex3f(0.0, 0.0, 1.0);

glEnd( );

22

43

Viewer

Position – center of projectionOrientation – coordinate system with origin at COPFocal Length – size of image on planeFilm Plane – independent of the lens orientation

44

Viewing Techniques

Classical – relationship between object and viewerSynthetic Camera – independence between object and viewer

23

45

Wireframe

46

Things Get Better

Flat PolygonsLight Source, ShadingSurface TextureFractalsFog, Environment

24

47

Modeling-Rendering

Rendering – is the production of the imageSeparate the modeling of the scene from the production

48

Early Graphic Systems

25

49

Pipeline Architecture

a + (b * c)

50

Fundamental Operations

Transformation – changes in coordinate systems through matrix operationsClipping – adjusting our view of the worldProjection – from 3D to 2DRasterization – pixels in the frame buffer

26

51

Performance

Front End – geometric processing (vertices, clipping, transforms) best suited for pipeliningLatency – time it takes to move through the systemBack End – rasterization and direct manipulation of bits in the frame buffer; parallel bit processors

52

Things To Come