24
Graphics-1 Gentle Introduction to Computer Graphics • Based on: – David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia – Jack van Wijk’s “Computer Graphics” Course Slides, University of Eindhoven.

Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

  • View
    229

  • Download
    5

Embed Size (px)

Citation preview

Page 1: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-1

Gentle Introduction to Computer Graphics

• Based on:– David Brogan’s “Introduction to Computer

Graphics” Course Slides, University of Virginia

– Jack van Wijk’s “Computer Graphics” Course Slides, University of Eindhoven.

Page 2: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-2

Outline

• Graphics Applications

• What is Computer Graphics

• Representations in Graphics

• Supporting Disciplines

• Introduction to 2d Modeling Transformations

• Matrix Representations

• Linear Transformations

Page 3: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-3

Graphics Applications

• Entertainment: Cinema

Pixar: Monster’s Inc.

A Bug’s Life (Pixar)

Page 4: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-4

Graphics Applications

• Medical Visualization

MIT: Image-Guided Surgery Project

Th

e V

isib

le H

um

an

Pro

jec

t

Page 5: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-5

Graphics Applications

• Everyday use

Page 6: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-6

Graphics Applications

• Scientific Visualization

Page 7: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-7

Graphics Applications

• Computer Aided Design (CAD)

Page 8: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-8

Graphics Applications

• Training

Designing Effective Step-By-Step Assembly Instructions (Maneesh Agrawala et. al)

Page 9: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-9

Graphics Applications

• Games

GT Racer 3

Polyphony Digital: Gran Turismo 3, A Spec

Page 10: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-10

Graphics Applications

• Games

Circus Atari (Atari)

Page 11: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-11

What is Computer Graphics?

• Computer graphics: generating 2D images of a 3D world represented in a computer.

• Main tasks:– modeling: (shape) creating and representing

the geometry of objects in the 3D world– rendering: (light, perspective) generating 2D

images of the objects– animation: (movement) describing how

objects change in time

Page 12: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-12

What is Computer Graphics?

ImageMath. ModelImage Analysis(pattern recognition)

Image Synthesis(Rendering)

Modeling Image processing

Page 13: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-13

Representations in graphics

Vector Graphics

• Image is represented by continuous geometric objects: lines, curves, etc.

Raster Graphics

• Image is represented as a rectangular grid of colored pixels

Page 14: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-14

Vector graphics

• Graphics objects: geometry + color

• Relatively low processing time– in terms of the number of graphic objects

• Geometric transformation possible without loss of information (zoom, rotate, …)

• Examples: PowerPoint, CorelDraw, ...

Page 15: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-15

Raster graphics

• Generic

• Image processing techniques

• Geometric Transformation: loss of information

• Relatively high processing time– in terms of the number of pixels

• Realistic images, textures, ...

• Examples: Paint, PhotoShop, ...

Page 16: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-16

Supporting Disciplines

• Computer science (algorithms, data structures, software engineering, …)

• Mathematics (geometry, numerical, …)

• Physics (Optics, mechanics, …)

• Psychology (Colour, perception)

• Art and design

Page 17: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-17

Introduction to Modeling Transformations

• Specify transformations for objects – Allows definitions of objects in own

coordinate systems– Allows use of object definition multiple

times in a scene

Page 18: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-18

2D Modeling Transformations

ScaleRotate

Translate

ScaleTranslate

x

y

World Coordinates

ModelingCoordinates

Page 19: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-19

Scaling

• Scaling a coordinate means multiplying each of its components by a scalar

• Uniform scaling means this scalar is the same for all components:

2

Page 20: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-20

• Non-uniform scaling: different scalars per component:

• How can we represent this in matrix form?

Scaling

X 2,Y 0.5

Page 21: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-21

Scaling

• Scaling operation:

• Or, in matrix form:

by

ax

y

x

'

'

y

x

b

a

y

x

0

0

'

'

scaling matrix

Page 22: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-22

2-D Rotation

(x, y)

(x’, y’)

x’ = x cos() - y sin()y’ = x sin() + y cos()

Page 23: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-23

2-D Rotation

• This is easy to capture in matrix form:

• Even though sin() and cos() are nonlinear functions of ,– x’ is a linear combination of x and y– y’ is a linear combination of x and y

y

x

y

x

cossin

sincos

'

'

Page 24: Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia

Graphics-24

2-D Translation

(x, y)

(x’, y’)

x’ = x + txy’ = y + ty

tx

ty