46
Unit 4 3D Viewing Pipeline Part - 2 Projections

3D transformation

Embed Size (px)

DESCRIPTION

describe about 3D viewing pipeline

Citation preview

Page 1: 3D transformation

Unit 43D Viewing Pipeline

Part - 2Projections

Page 2: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Normalized view space

Modeling Transformation

Viewing Transformation

Lighting & Shading

3D-Clipping

Projection

Scan conversion, Hiding

Primitives

Image

Object space

World space

Camera space

Image space, Device coordinates

Hidden Surface Removal

3D Viewing Pipeline

Page 3: 3D transformation

Contents

1. Introduction

2. Perspective Projections

3. Parallel Projections

Page 4: 3D transformation

Viewing and Projection

• Camera Analogy:1. Set up your tripod and point the camera at the scene (viewing transformation).2. Arrange the scene to be photographed into the desired composition (modeling transformation).3. Choose a camera lens or adjust the zoom (projection transformation).4. Determine how large you want the final photograph to be - for example, you might want it enlarged (viewport transformation).

Madhulika (18010), Assistant Professor, LPU.

Page 5: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Page 6: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Projections

• Our 3-D scenes are all specified in 3-D world coordinates

• To display these we need to generate a 2-D image - project objects onto a picture plane

• So how do we figure out these projections?

Picture Plane

Objects in World Space

Page 7: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Projections

• Projection is just one part of the process of converting from 3-D world coordinates to a 2-D image

Clip against view volume

Project onto projection

plane

Transform to 2-D device coordinates

3-D world coordinate

output primitives

2-D device coordinates

Page 8: 3D transformation

Projection Transformation

Madhulika (18010), Assistant Professor, LPU.

Page 9: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Page 10: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Projections

• There are two broad classes of projection:

– Parallel: Typically used for architectural and engineering drawings

– Perspective: Realistic looking and used in computer graphics

Perspective Projection Parallel Projection

Page 11: 3D transformation

Classical viewingViewing requires three basic elements

• One or more objects

• A viewer with a projection surface

• Projectors that go from the object(s) to the projection surface

Classical views are based on the relationship among these

elements

• The viewer picks up the object and orients it how she would

like to see it

Each object is assumed to constructed from flat principal

faces

• Buildings, polyhedra, manufactured objects

Madhulika (18010), Assistant Professor, LPU.

Page 12: 3D transformation

Classical Projections

Madhulika (18010), Assistant Professor, LPU.

Page 13: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

ProjectionsProjectionsProjections

PERSPECTIVEConverging Projectors

(View Point)

PERSPECTIVEConverging Projectors

(View Point)

PARALLEL(View Direction)

PARALLEL(View Direction)

OBLIQUEProjector not to

View plane

OBLIQUEProjector not to

View plane

ORTHOGRAPHICProjector to

View plane

ORTHOGRAPHICProjector to

View plane

GENERALGENERAL

MULTI VIEWView plane || to principal plane

MULTI VIEWView plane || to principal plane

AXONOMETRICView plane not ||

To principal plane

AXONOMETRICView plane not ||

To principal plane

1-Principal vanishing point1-Principal

vanishing point

2-Principal vanishing point2-Principal

vanishing point

3-Principal vanishing point3-Principal

vanishing pointThree viewsThree views

Auxiliary ViewAuxiliary View

Sectional ViewSectional View

ISOMETRICEqual angle with

all three axis

ISOMETRICEqual angle with

all three axis

DIMETRICEqual angle with

any two axis

DIMETRICEqual angle with

any two axis

TRIMETRICUnequal angle with

all three axis

TRIMETRICUnequal angle with

all three axis

CAVALIERNo foreshortening of lines

To XY-Plane

CAVALIERNo foreshortening of lines

To XY-Plane

CABINETforeshortening of lines To XY-Plane by 1/2

CABINETforeshortening of lines To XY-Plane by 1/2

Page 14: 3D transformation

Contents

1. Introduction

2. Perspective Projections

3. Parallel Projections

Page 15: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Perspective Projections

• Perspective projections are much more realistic than parallel projections and are used by artists.

Page 16: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Perspective Projections

• Perspective projections are described by– Centre of projection: Eye of artists or lens of camera

– View Plane: Plane containing canvas or film strip or frame buffer

• A ray called projector is drawn from COP to object point, its intersection with view plane determines the projected image point on view plane.

X-axis

Projector

COP

View Plane

Y-axis

Z-axis

Object point

Projected point

Page 17: 3D transformation

Perspective Projection

Madhulika (18010), Assistant Professor, LPU.

Page 18: 3D transformation

Parallel Projections

Madhulika (18010), Assistant Professor, LPU.

Page 19: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Perspective Projections

• There are a number of different kinds of perspective views

• The most common are one-point and two point perspectives

Page 20: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Perspective Projections• Perspective drawings are characterised by

1. Perspective foreshortening

2. Vanishing points

3. View Confusion

4. Topological Distortion

– These are also known as Perspective Anomalies.– These anomalies enhance realism in terms of depth cues, but

distorts the actual size, shape and relationship between parts of object.

Page 21: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Perspective Projections

1. Perspective foreshortening: an illusion that objects and lengths appear smaller as their distance form COP increases.

– We can see three balls have different dimensions, since they placed at different distances they are projected to same length

COP(0,0,-d)Z-axis

Y-axis

Page 22: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Perspective Projections

• Increasing the field of view angle increases the height of the view plane and so increases foreshortening

Page 23: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Perspective Projections

• The amount of foreshortening that is present can greatly affect the appearance of our scenes

Page 24: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Perspective Projections

2. Vanishing points: An illusion that certain sets of parallel lines appear to meet at a point (called vanishing point).

– These are those lines that are not parallel to view plane i.e. lines that are not to view plane normal.

– Principal vanishing points are formed by apparent intersection of lines parallel to one of the three principal axes.

– The number of principal vanishing points is determined by the number of principal axis intersected by the view plane.

X-axis

Z-axis

Y-axis COP(0,0,-d)

L1

L2L’1

L’2

O

Page 25: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

(from Donald Hearn and Pauline Baker)

Perspective Projections

Page 26: 3D transformation

Classes of Perspective Projection

Classes of Perspective Projection

• One-Point Perspective

• Two-Point Perspective

• Three-Point Perspective

• One-Point Perspective

• Two-Point Perspective

• Three-Point Perspective

26

Page 27: 3D transformation

One-Point PerspectiveOne-Point Perspective

27

Page 28: 3D transformation

Two-point perspective projection:Two-point perspective projection:

– This is often used in architectural, engineering and industrial design drawings.

28

Page 29: 3D transformation

Three-point perspective projection

Three-point perspective projection

• Three-point perspective projection is used less frequently as it adds little extra realism to that offered by two-point perspective projection

• Three-point perspective projection is used less frequently as it adds little extra realism to that offered by two-point perspective projection

29

Page 30: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Perspective Projections

3. View Confusion: An object behind the COP is projected upside down and backward onto the view plane.

X-axis

Z-axis

Y-axis

COP(0,0,-d)

L1

L2

L’1

L’2

O

Page 31: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Perspective Projections4. Topological Distortion: All points lying on the plane parallel to view plane and passing through the

COP are projected to ∞ by the perspective transformation. – This may make a finite line segment

to appear as two infinite rays.

X-axis

Z-axis

Y-axis

COP(0,0,-d)

O

P1

P2

P’1P’2

P3

∞ ∞

Page 32: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Perspective Projections

Page 33: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Perspective Projections

• Although a perspective projection is set up by specifying the position and size of the view plane and the position of the projection reference point called COP

• However, this can be kind of awkward

Page 34: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Perspective Projections• The field of view angle can be a more intuitive way to specify

perspective projections

• This is analogous to choosing a lense for a camera

Field of view

Page 35: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Perspective Projections

• We need one more thing to specify a perspective projections using the filed of view angle

• The aspect ratio gives the ratio between the width sand height of the view plane

Page 36: 3D transformation

Contents

1. Introduction

2. Perspective Projections

3. Parallel Projections

Page 37: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Parallel Projections• Parallel projections are used by drafter and engineers to create working

drawings of an object as they preserve scale and shape

• These are described by– Viewing Direction: which describe the direction of projection

– View Plane: Plane containing canvas or film strip or frame buffer

• A ray called projector is drawn || to Viewing direction and passing through object point, its intersection with view plane determines the projected image point on view plane.

X-axisView Plane

Y-axis

Z-axis

ObjectViewing Direction

Object’

Page 38: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Parallel Projection

• Center of projection is at infinity– Direction of projection (DOP) same for all points

DOP

ViewPlane

Page 39: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Parallel Projections

Parallel ProjectionsParallel Projections

OBLIQUEProjector not to

View plane

OBLIQUEProjector not to

View plane

ORTHOGRAPHICProjector to

View plane

ORTHOGRAPHICProjector to

View plane

GENERALGENERAL

MULTI VIEWView plane || to principal plane

MULTI VIEWView plane || to principal plane

AXONOMETRICView plane not ||To principal plane

AXONOMETRICView plane not ||To principal plane

Three viewsThree views

Auxiliary ViewAuxiliary View

Sectional ViewSectional View

ISOMETRICEqual angle with

all three axis

ISOMETRICEqual angle with

all three axis

DIMETRICEqual angle with

any two axis

DIMETRICEqual angle with

any two axis

TRIMETRICUnequal angle with

all three axis

TRIMETRICUnequal angle with

all three axis

CAVALIERNo foreshortening of lines

To XY-Plane

CAVALIERNo foreshortening of lines

To XY-Plane

CABINETforeshortening of lines To XY-Plane by 1/2

CABINETforeshortening of lines To XY-Plane by 1/2

Page 40: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Orthographic Projections

Top Side

Front

• DOP perpendicular to view plane

Page 41: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Oblique Projections

• DOP not perpendicular to view plane

Cavalier

(DOP = 45o)

Cabinet

(DOP = 63.4o)

45 4.63

Page 42: 3D transformation

• Cavalier Projection- It is obtained when the angle between the oblique projectors and the plane of projection is 45 degree and the foreshortening factors for all three principal directions are equal.

• In Cavalier projection , the resulting figure is too thick.

Madhulika (18010), Assistant Professor, LPU.

Page 43: 3D transformation

• Cabinet Projection- It is used to correct the deficiency that is produced by Cavalier projection.

• An oblique projection for which the foreshortening factor for the edge perpendicular to the plane of projection is one-half is called Cabinet projection.

• For a cabinet projection, the angle between the projectors and the plane of projection is 63.43.

Madhulika (18010), Assistant Professor, LPU.

Page 44: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Parallel Projections

• Identify type parallel projections

Orthographic Projection

Oblique Projection

Isometric Projection

Page 45: 3D transformation

Madhulika (18010), Assistant Professor, LPU.

Parallel Projections

• Isometric projections have been used in computer games from the very early days of the industry up to today

Q*Bert Sim City Virtual Magic Kingdom

Page 46: 3D transformation

Madhulika (18010), Assistant Professor, LPU.