computer graphics - biuu.cs.biu.ac.il/~kapaho/cg/01_intro.pdfcomputer graphics hearn and baker...

Post on 27-Mar-2020

34 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

CG-IDC 1

Computer Graphics

• Instructor: Oren Kapah

(orenkapahbiu@gmail.com)

• Office Hours: T.B.A.

The slides for this course were created by Toky & Hagit Hel-Or

CG-IDC 2

CG-IDC 3

Exercise and Homework

• The exercise will cover practical

aspects of the material taught in class.

• OpenGL will be covered in the

exercise.

• Homework will be written in OpenGL

and Java

• Homework may be submitted in pairs

(No triplets).

• In general - two weeks due date.

• No exercise this week.

CG-IDC 4

Grading Policy:

• 50% homework assignments+50% exam.

• Homework assignments are weighted.

• Exam will include class and exercise

material.

• Homework appeals can be submitted no

later than one week after they’re returned!

IMPORTANT!

You must pass the exam in order to pass

the course.

CG-IDC 5

Course Web site:

• Lessons (PDF format).

• Homework.

• Handouts and program examples.

• Grades.

• News.

• Mailing Group

CG-IDC 6

Books

Computer Graphics

Hearn and Baker

Second Edition, Prentice Hall, 1994.

Computer Graphics Principles and Practice,

Foley, Van Dam, Feiner, and Hughes

Second Edition, Addison Wesley, 1996.

Mathematical Elements for Computer

Graphics

Rogers and Adams

Second edition, McGraw-Hill, 1990.

• OpenGL SuperBible

S. Richard, JR Wright, M. Sweet

Waite Group Press

CG-IDC 7

Goals:

• Implementing Practical Math.

• Getting acquainted with

graphical models, basic

techniques, and algorithms.

• Getting acquainted with a

Graphical Language (OpenGL).

CG-IDC 8

The Visual Sciences

Computer

Vision

Rendering

ImageImage

Processing

Model

3D Object

Geometric

Modeling

CG-IDC 9

Context

• Image Processing: images => images

• Computer Vision: images => models

• Computer Graphics:

– Geometric Modeling: object => models

– 3D-rendering: 2D/3D models =>images

– Animation: 4D models => images.

CG-IDC 10

Applications

• CAD - Computer Aided Design (mechanical,

architectural)

• Simulators (flight, driving)

• Architectural visualization

• Advertising

• Virtual Reality

• Art

• Games

• Special effects

• Education

• Scientific visualization

CG-IDC 11

Tin Toy – Pixar 1988

CG-IDC 12

Rendered image

CG-IDC 13

Rendered image

Lighting

Geometry

Viewing

Material properties

&Texture

CG-IDC 14

Reality – Non realistic rendering

CG-IDC 15

Photo-realistic rendering

CG-IDC 16

Non-realistic rendering

Pensive - 2000

CG-IDC 17

Illumination & Color Models. object’s surfaces physical properties

Solid modelingObject’s Geometrical properties

Objects:

Camera:

Projections

Light Source:

Color

theory

Spatial set-up:

3D transformations,

Coordinate Systems.

Y

XZ

Y

Viewing Factors

CG-IDC 18

Scope and Course Flow:

• 2D Drawing.

• Vector analysis.

• 2D transformations.

• 2D viewing.

• 3D transformations.

• 3D Modeling.

• 3D viewing

• Color Models.

• Shading Models.

CG-IDC 19

Drawing in 2D

Goal: Getting acquainted with images.

• Displays types (raster vs. vector).

• Basic image definitions:

– Pixel, Resolution, dynamic range…

• Scan conversion:

– Techniques for Line drawing

– Techniques for drawing circles.

– Fill polygons.

CG-IDC 20

Vector Analysis

Goal: Refreshing Linear Algebra basics.

• Mathematical entities:

– Scalar, Points, Vectors.

• Fundamental operations:

– point+vector, vector+vector,

vector*scalar, dot product, cross product,

etc.

• Vector representation - the basis.

• Point representation - the frame.

CG-IDC 21

Transformations in 2D

Goal: Introduction to 3D.

• Basic 2D transformations:

– Translation, Scaling, Rotation, Shear.

• Composition of transformations and

transformation groups:

Rigid

Affine

Similarity

CG-IDC 22

• Transformations in Matrix notation:

• Composition of transformations in

matrix notation.

• The homogeneous coordinates in 2D:

• Change of coordinates:

y

x

dc

ba

y

x

'

'

x

y

x’y’

),,(),,(),( ttytxWYXyx

CG-IDC 23

Viewing in 2D

Goal: Preperation to 3D and some

rendering concepts.

• Viewing transformation pipe-line:

• Line and Polygon Clipping techniques:

x world

y world

Clipping

CG-IDC 24

Transformations in 3D

Goal: Geometrical transformations to be

used in viewing pipe-line.

• Similar to 2D but in 3D.

CG-IDC 25

Viewing in 3D

Goal: Geometrical transformations in

viewing pipe-line.

• From Model coordinates to Viewer

coordinates.

yw

zw

xw

world

P0

xv

yv

zvViewer

System

Body

System

Front-

Wheel

System

CG-IDC 26

• Projections:

– Orthographic.

– Oblique.

– Perspective.

• The Viewing Volume:

zv

far

near

yv

xv

CG-IDC 27

Solid Modeling

Goal: Learn how to define solid objects.

• 1D Curves in 3D

– Primitive based: line segments.

– Free form:

• Implicit, Explicit, Parametric (polynomials,

splines)

• 2D Surfaces in 3D

– Primitive Based: Polygon mesh.

– Free Form: As above

CG-IDC 28

• 3D volumes in 3D

– Volume Rep.

• Sweep volumes

• Spatial Occupancy(voxels, Octree, BSP)

• Constructive Solid Geometry

– Boundary Rep.

• Polyhedra

• Free form: as above

CG-IDC 29

Approximated/Interpolated

Parametric Surfaces

• Bilinear interpolation.

• Splines:

– Cardinal spline.

– Hermite spline.

– Bezier Spline.

– B spline.

CG-IDC 30

y

x

650

610

590

550

570

600

580

560

540

505

500

510

520530

490

495

485

480

470450

1.00.50.0

0.5

0.9

green

yellow-green

yellow

orange

red

magenta

purple

blue

cyan white

pink

Goal: Understanding what a color is.

• The Trichromatic Color Theory.

• Linear color space and color

representations: RGB, CMY,HSB.

• Perceptual color spaces: LAB,YIQ.

• The CIE Chromaticity Diagram.

Color Theory

R

G

B

Brightness

Hue

CG-IDC 31

Illumination Models &

ShadingGoal: Understanding the physical properties of

an object.

• Light source parameters (shape,

position, color, intensity).

• Surface parameters: Ambient, diffuse,

specular.

• Polygon Rendering methods.

• Transparency.

• Shadow.

CG-IDC 32

Ambient, Diffuse, and

Specular components

Composition of Light

Sources

SHADOW.EXE

CG-IDC 35

Image based lighting - 2000

CG-IDC 36

Example: A Sequence of creating

an images from a given model.

(from Foley Van Dam)

CG-IDC 37

Polygonal model generated from spline patches.

Orthographic projection

Polygonal model generated from spline patches.

Perspective projection

CG-IDC 38

Depth cueing.

CG-IDC 39

Colored vectors.

Depth Clipping

CG-IDC 40

Hidden line removal

Visible surface determination with ambient illumination

CG-IDC 41

Individually shaded polygon with diffuse reflection

Gouraud shaded polygon with diffuse reflection

CG-IDC 42

Gouraud shaded polygon with specular reflection

Phong shaded polygon with specular reflection

CG-IDC 43

Curved surfaces with specular reflection

multiple lights

CG-IDC 44

Texture mapping

shadows

CG-IDC 45

Final image

CG-IDC 46

Pixar 1986 – best of Siggraph 1986

CG-IDC 47

Real time – off line rendering

CG-IDC 48

top related