Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to...

25
Viewing 1

Transcript of Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to...

Page 1: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

Viewing

1

Page 2: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

Introduction to Computer Graphics - Foley, Van Dam, Feiner, Hughes & Phillips 2

• Often it is helpful to envision viewing in

computer graphics using a synthetic camera

•We can move, orient, rotate, and snap the shutter of the camera to capture a 2D image

Page 3: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

3

• The camera is code which produces an image

(either on screen or to file) – Object is a 3D model consisting of points, lines,

surfaces, etc...

– Our coordinate system for camera is different than

that of the object •u, v, n for camera

•x, y, z for object

Page 4: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

Introduction to Computer Graphics - Foley, Van Dam, Feiner, Hughes & Phillips 4

• Of course it's a bit more than just “pushing the

button” to capture the image

• Image acquisition requires of a number of steps, usually consisting of... – Specification of projection type

– Specification of viewing parameters

– Clipping in 3D

– Projection and Display

Page 5: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

5

• In general, projects consist of transforming an

n-dimensional system into a system with a

dimension less than n •We'll focus on the common 3D to 2D

projection

Page 6: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

Perspective Drawing Handbook - Joseph D'Amelio 6

Page 7: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

7

• Projection of 3D defined by straight projection

rays called projectors

• Rays emulate from a center of projection • Rays pass through each point of an object and

intersect a projection plane to form the

projection

Page 8: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

Introduction to Computer Graphics - Foley, Van Dam, Feiner, Hughes & Phillips 8

• Usually the center of projection is a finite

distance away from the projection plane

• For some projections, it is convenient to think of center of projection as infinitely away

Page 9: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

9

• Size varies inversely with respect to the

distance from the center of projection

• Tends to look more realistic – Cannot generally measure

•Shape

•Object distances

•Angles (except front faces)

– Parallel lines appear no longer parallel

Page 10: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

10

• Less realistic because perspective

foreshortening is lacking

• Can however, use for exact measurements – Parallel lines remain parallel

– Angles still only preserved for front faces

Page 11: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

11

Page 12: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

12

• Any set of parallel lines not parallel to the

projection plane – Converge to a vanishing point

• In 3D, parallel lines meet only at infinity

Page 13: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

Introduction to Computer Graphics - Foley, Van Dam, Feiner, Hughes & Phillips 13

• Lines parallel to x, y do not converge

Page 14: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

Introduction to Computer Graphics - Foley, Van Dam, Feiner, Hughes & Phillips 14

Page 15: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

June Ruivivar 15

Page 16: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

Introduction to Computer Graphics - Foley, Van Dam, Feiner, Hughes & Phillips 16

• Lines parallel to y do not converge

Page 17: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

Hillcrest Building - springgrove.com 17

Page 18: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

18

• All lines converge

Page 19: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

travelnow.com - Hilton New York 19

Page 20: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

Li Shen - UMass Dartmouth 20

Page 21: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

21

• Orthographic parallel projections – Direction of projection and normal to projection plane

are the same (or reverse)

• Oblique parallel projections – If the direction of projection is not normal to

projection plane

Page 22: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

Introduction to Computer Graphics - Foley, Van Dam, Feiner, Hughes & Phillips 22

•Most common are top/plan, front & side

elevations – Frequently found in engineering and architectural

drawings

Page 23: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

23

Page 24: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

Object (3D)

• At RiSphere, RiPatch, ...

Shader (3D)

• At RiShader

World (3D)

• At RiWorldBegin

Camera (3D)

• At RiProjection

• Camera at origin

• Axes: , , Forward

Screen (2D)

• 0,0 at center of projection

• Axes: ,

Raster (2D)

• 0,0 to width,height

• Axes: ,

NDC (2D)

• 0,0 to 1,1

• Axes: ,

Page 25: Viewing - Inspiring Innovationolano/class/435-08-2/viewing.pdf · Viewing 1 . Introduction to Computer Graphics - Foley, Van Dam, Feiner, ... Perspective Drawing Handbook - Joseph

Object (3D)

• When rendering

Eye (3D)

• Eye at origin

• Axes: , , Back

Clip (3D)

• Eye: 0,0,-

• Axes: , , Forward

NDC (3D)

• -1,-1,-1 to 1,1,1

Window (2D)

• 0,0 to width,height

MODELVIEW PROJECTION

glViewport/glDepthRange