Lecture outline COMP30019 Graphics and Interaction Introduction to - - PowerPoint PPT Presentation

lecture outline comp30019 graphics and interaction
SMART_READER_LITE
LIVE PREVIEW

Lecture outline COMP30019 Graphics and Interaction Introduction to - - PowerPoint PPT Presentation

Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human


slide-1
SLIDE 1

Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

COMP30019 Graphics and Interaction Perspective Geometry

Adrian Pearce

Department of Computer Science and Software Engineering University of Melbourne

The University of Melbourne

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Lecture outline

Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Perspective geometry

How are three-dimensional objects projected onto two-dimensional images? Aim: understand point-of-view, projective geometry. Reading:

◮ Foley Sections 6.1 to 6.4 (excluding example 6.1, we’ll

cover matrices later). Additional reading:

◮ Perspective is also covered in Chapter 3 of the Red Book.

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Geometry of image formation

Mapping from 3D space to 2D image surface, more specifically, a mapping from 3D directions (rays to/ from the observer).

◮ You can think perspective as a transformation as a way of

moving from a higher dimensional image to a lower dimensional form.

◮ The X, Y, Z points in the three dimensional world,

sometimes called voxels, are transformed in to x, y pixels in a two-dimensional image. Simplest device that does this is the pin-hole camera that gives perspective projection. Practical cameras with lenses ideally give the same projection, aside from greater light gathering, and issues like focus.

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry

slide-2
SLIDE 2

Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Pinhole Camera

  • bject in

3D scene image of object (upside down) for image (maybe light-tight box pinhole in box light ray from object projection screen translucent waxed paper)

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Perspective geometry

(X,Y,Z) O Z x f X

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Perspective geometry

◮ Basically an abstraction of pin-hole camera. ◮ Look at XOZ plane—same thing happens in YOZ plane. ◮ Actual point in 3D space is (X, Y, Z) ◮ 0 is origin (focal point) or centre of projection. ◮ Z is distance from actual point to origin. ◮ f is focal distance (focal length). ◮ x is the image (upside down) with respect to real world.

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Perspective Formulas

Point P = (X, Y, Z) in 3D space has projection (x, y) in the image where x f = X Z y f = Y Z

  • r

x = Xf Z y = Yf Z f being the “focal distance” (sometimes f is called d). Look at similar triangles in the previous diagram.

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry

slide-3
SLIDE 3

Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Perspective Formulas

◮ Look at perspective projection diagram to convince

yourself of this — triangles xOf and XOZ have the same proportions.

◮ Rearranging gives equations shown below. ◮ These formulas apply only for this special coordinate

system, sometimes called camera-centred coordinates, for which perspective projection has a particularly simple form.

◮ For other coordinate systems, some 3D transformation will

be necessary (see later).

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Alternative geometry

(X,Y,Z) O Z X f x

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Alternative geometry

◮ Image projection surface imagined to be in front of

projection centre.

◮ Geometrically equivalent ◮ Often more convenient.

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Centre of projection

Projectors Center of projection Projection plane A' A B (a) Projectors Projection plane A' A B (b) B' B' Center of projection at infinity

Foley, Figure 6.03

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry

slide-4
SLIDE 4

Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

“One-point” perspective

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

One point perspective projection (Foley, Figure 6.04)

y z x y z x z-axis vanishing point z-axis vanishing point

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

One-point perspective projection (Foley, Figure 6.05)

Projection plane normal Center of projection Projection plane z x y

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

“Two-point” perspective

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry

slide-5
SLIDE 5

Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

“Three-point” perspective

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Vanishing points

◮ In 3D, parallel lines meet only at infinity, so the vanishing

point can be thought of as the projection of a point at infinity.

◮ If the set of lines is parallel to one of the three principal

axes, the vanishing point is called an axis vanishing point.

◮ So called “one-point”, “two-point”, and “three-point”

perspectives are just special cases of perspective projection, depending on how image plane lines up with significant planes in scene.

◮ Talking about these cases specifically is mainly an artifact

  • f artists or architects dealing with horizontals and verticals

in built environments.

◮ In fact, there are an infinity of vanishing points, one for

each of the infinity of directions in which a line can be

  • riented.

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

House example (Foley Section 6.4)

y x (8, 16, 30) (16, 10, 30) (16, 0, 30) (0, 10, 54) (16, 0, 54) z

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

One-point, centred perspective projection example

z v u VUP VRP PRP = (8, 6, 30) DOP n CW Window on view plane VPN y x

Foley Figures 6.21 and 6.22

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry

slide-6
SLIDE 6

Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Which of the below is the centre of project in Foley Figure 6.22?

◮ VRP (view reference point) ◮ PRP (projection reference point) ◮ VPN (view plane normal) ◮ DOP (direction of projection) ◮ VUP (view-up vector)

Is the view plane inbetween the centre of projection and the house or behind the centre of projection?

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Two-point perspective projection example

In a two-point projection of a house, left, the viewplane (defined by the view plane normal, VPN), right, cuts the z and x axes (Foley Figures 6.17 and 6.25).

y x z v u VPN View plane

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Parallel projection

◮ Parallel projection introduces no perspective distortion

(centre of projection plane (focal point) is at infinity

◮ Along with its variants it is useful in engineering drawings,

where measurements must be taken.

◮ oblique projection if view plane is not perpendicular to

projection.

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Geometric project classes

Subclasses of planar geometric projections (Foley Figure 6.10).

Planar geometric projections Front elevation Side elevation Top (plan) Parallel Perspective Orthographic Oblique One-point Cabinet Cavalier Other Two-point Three-point Axonometric Isometric Other

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry

slide-7
SLIDE 7

Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Ortographic (parallel) projection

Parallel projection (also known as orthographic projection) is given by x = X y = Y (That is, just drop Z coordinate.) Also can have “normal perspective” which is scaled parallel (orthographic) projection x = sX = (f/Z ′)X y = sY = (f/Z ′)Y That is, it’s like perspective projection in which objects are “squashed” to some constant fictitious depth Z ′ instead of being at their true depths.

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Oblique parallel projection using vectors

  • rigin

P x y

v v

,

( )

x y d p

Fig 4.3 Rowe

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Oblique parallel projection using vectors

◮ All points are projected parallel to the projection vector d

  • nto the xy plane.

◮ Note the projection vector is not perpendicular to the xy

plane, else it would be an orthogonal projection.

◮ Point p is projected onto point xv, yv.

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Derivation of oblique parallel projection

The vector equation of the (projection) line is r = p + td The intersection of this line with the xy plane is at z = 0, therefore t = −pz dz and by substitution we obtain (xv, yv) = {px − pzdx dz , py − pzdy dz }

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry

slide-8
SLIDE 8

Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Derivation of oblique parallel projection

◮ r and d are vector parameters. ◮ r = (x, y, z) is a vector pointing to a point on the plane

along the dotted line.

◮ r = p + td is the vector equation of a line passing through

a point.

◮ t is a scalar parameter. ◮ Provided that dz is non-zero, otherwise if it is zero the

projection direction is parallel to the xy plane so it does not intersect.

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Perspective projection using vectors

p – c p

  • rigin

P x y c x y

v v

,

( )

C Q

Fig 4.5 Rowe

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Perspective projection using vectors

◮ Point C is the centre of projection. ◮ Points P and Q are projected onto the xy plane at the

points shown.

◮ For point P, the projection direction is given by the vector

P − C (this is calculated for each point).

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Derivation of perspective projection

The projection passing through C and P is r = c + t(p − c) at z = 0 t = − cz (pz − cz) and by substitution we obtain (xv, yv) = {cx − cz px − cx pz − cz , cy − cz py − cy pz − cz } further simplification gives (xv, yv) = {cxpz − czpx pz − cz , cypz − czpy pz − cz }

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry

slide-9
SLIDE 9

Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Perspective of the human eye

Human eye effectively uses a kind of “spherical” projection: Retina is curved, though projection centre (in lens) isn’t at centre of the eyeball (therefore not planar geometric projection).

◮ Doesn’t exactly match perspective projection. ◮ Only a problem for very wide fields of view.

Perspective is basically the right projection for putting a 3D scene onto a flat surface for human viewing.

◮ Other projections are possible for special effects, e.g.

“fish-eye” lens.

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry Introduction to perspective geometry Perspective Geometry Centre of projection Projection using vectors Human perspective

Summary

◮ Perspective geometry is based loosely on the pin-hole

camera model that maps 3D points onto a 2D image plane

◮ The image plane may thought of either behind a focal point

  • r in between a vanishing point and the object.

◮ Computer graphics largely concerns planar geometric

projections, generally perspective projection and sometimes parallel projection for specific applications.

◮ One-point, two-point and three-point projection variants

arise according to how many times the viewplane cuts the axis planes.

Adrian Pearce University of Melbourne COMP30019 Graphics and InteractionPerspective Geometry