lecture 11 perspective projection

27
Projections Angel: Interactive Computer Graphics

Upload: guest0026f

Post on 18-May-2015

61.481 views

Category:

Technology


3 download

DESCRIPTION

perspective projection theory and questions

TRANSCRIPT

Page 1: Lecture 11 Perspective Projection

Projections

Angel: Interactive ComputerGraphics

Page 2: Lecture 11 Perspective Projection

Road in perspective

Page 3: Lecture 11 Perspective Projection

Taxonomy of Projections

FVFHP Figure 6.10

Page 4: Lecture 11 Perspective Projection

Taxonomy of Projections

Page 5: Lecture 11 Perspective Projection

Parallel Projection

Angel Figure 5.4

Center of projection is at infinityCenter of projection is at infinity

• Direction of projection (DOP) same for all pointsDirection of projection (DOP) same for all points

Center of projection is at infinityCenter of projection is at infinity

• Direction of projection (DOP) same for all pointsDirection of projection (DOP) same for all points

DOP

ViewPlane

Page 6: Lecture 11 Perspective Projection

Orthographic Projections

Angel Figure 5.5

Top Side

Front

DOP perpendicular to view planeDOP perpendicular to view planeDOP perpendicular to view planeDOP perpendicular to view plane

Page 7: Lecture 11 Perspective Projection

Oblique Projections

H&B

DOP DOP notnot perpendicular to view plane perpendicular to view planeDOP DOP notnot perpendicular to view plane perpendicular to view plane

Cavalier

(DOP = 45o)

tan() = 1

Cabinet

(DOP = 63.4o)

tan() = 2

45 4.63

Page 8: Lecture 11 Perspective Projection

Orthographic Projection

Simple OrthographicSimple OrthographicTransformationTransformation

Original world units are preservedOriginal world units are preserved• Pixel units are preferredPixel units are preferred

Simple OrthographicSimple OrthographicTransformationTransformation

Original world units are preservedOriginal world units are preserved• Pixel units are preferredPixel units are preferred

Page 9: Lecture 11 Perspective Projection

Perspective Transformation

First discovered by Donatello, Brunelleschi, and DaVinci First discovered by Donatello, Brunelleschi, and DaVinci during Renaissanceduring Renaissance

Objects closer to viewer look largerObjects closer to viewer look larger

Parallel lines appear to converge to single pointParallel lines appear to converge to single point

First discovered by Donatello, Brunelleschi, and DaVinci First discovered by Donatello, Brunelleschi, and DaVinci during Renaissanceduring Renaissance

Objects closer to viewer look largerObjects closer to viewer look larger

Parallel lines appear to converge to single pointParallel lines appear to converge to single point

Page 10: Lecture 11 Perspective Projection

Perspective Projection

Angel Figure 5.10

3-PointPerspective

2-PointPerspective

1-PointPerspective

How many vanishing points?How many vanishing points?How many vanishing points?How many vanishing points?

Page 11: Lecture 11 Perspective Projection

Perspective Projection

In the real world, objects exhibit In the real world, objects exhibit perspective perspective foreshorteningforeshortening: distant objects appear : distant objects appear smallersmaller

The basic situation:The basic situation:

In the real world, objects exhibit In the real world, objects exhibit perspective perspective foreshorteningforeshortening: distant objects appear : distant objects appear smallersmaller

The basic situation:The basic situation:

Page 12: Lecture 11 Perspective Projection

Perspective Projection

When we do 3-D graphics, we think of the When we do 3-D graphics, we think of the screen as a 2-D window onto the 3-D world:screen as a 2-D window onto the 3-D world:

When we do 3-D graphics, we think of the When we do 3-D graphics, we think of the screen as a 2-D window onto the 3-D world:screen as a 2-D window onto the 3-D world:

How tall shouldthis bunny be?

Page 13: Lecture 11 Perspective Projection

Perspective Projection

The geometry of the situation is that of The geometry of the situation is that of similar trianglessimilar triangles. . View from above:View from above:

What is x’ ?What is x’ ?

The geometry of the situation is that of The geometry of the situation is that of similar trianglessimilar triangles. . View from above:View from above:

What is x’ ?What is x’ ? d

P (x, y, z)X

Z

Viewplane

(0,0,0) x’ = ?

Page 14: Lecture 11 Perspective Projection

Perspective Projection

Desired result for a point Desired result for a point [[x, y, z, 1x, y, z, 1]]TT projected onto the projected onto the view plane:view plane:

What could a matrix look like to do this?What could a matrix look like to do this?

Desired result for a point Desired result for a point [[x, y, z, 1x, y, z, 1]]TT projected onto the projected onto the view plane:view plane:

What could a matrix look like to do this?What could a matrix look like to do this?

dzdz

y

z

ydy

dz

x

z

xdx

z

y

d

y

z

x

d

x

,','

',

'

Page 15: Lecture 11 Perspective Projection

A Perspective Projection Matrix

Answer:Answer:Answer:Answer:

0100

0100

0010

0001

d

M eperspectiv

Page 16: Lecture 11 Perspective Projection

A Perspective Projection Matrix

Example:Example:

Or, in 3-D coordinates:Or, in 3-D coordinates:

Example:Example:

Or, in 3-D coordinates:Or, in 3-D coordinates:

10100

0100

0010

0001

z

y

x

ddz

z

y

x

d

dz

y

dz

x,,

Page 17: Lecture 11 Perspective Projection

Projection Matrices

Now that we can express perspective Now that we can express perspective foreshortening as a matrix, we can compose it foreshortening as a matrix, we can compose it onto our other matrices with the usual matrix onto our other matrices with the usual matrix multiplicationmultiplication

End result: a single matrix encapsulating End result: a single matrix encapsulating modeling, viewing, and projection transformsmodeling, viewing, and projection transforms

Now that we can express perspective Now that we can express perspective foreshortening as a matrix, we can compose it foreshortening as a matrix, we can compose it onto our other matrices with the usual matrix onto our other matrices with the usual matrix multiplicationmultiplication

End result: a single matrix encapsulating End result: a single matrix encapsulating modeling, viewing, and projection transformsmodeling, viewing, and projection transforms

Page 18: Lecture 11 Perspective Projection

Perspective vs. ParallelPerspective projectionPerspective projection

+ Size varies inversely with distance - looks realisticSize varies inversely with distance - looks realistic

– Distance and angles are not (in general) preservedDistance and angles are not (in general) preserved

– Parallel lines do not (in general) remain parallelParallel lines do not (in general) remain parallel

Parallel projectionParallel projection

+ Good for exact measurementsGood for exact measurements

+ Parallel lines remain parallelParallel lines remain parallel

– Angles are not (in general) preservedAngles are not (in general) preserved

– Less realistic looking Less realistic looking

Perspective projectionPerspective projection

+ Size varies inversely with distance - looks realisticSize varies inversely with distance - looks realistic

– Distance and angles are not (in general) preservedDistance and angles are not (in general) preserved

– Parallel lines do not (in general) remain parallelParallel lines do not (in general) remain parallel

Parallel projectionParallel projection

+ Good for exact measurementsGood for exact measurements

+ Parallel lines remain parallelParallel lines remain parallel

– Angles are not (in general) preservedAngles are not (in general) preserved

– Less realistic looking Less realistic looking

Page 19: Lecture 11 Perspective Projection

Classical Projections

Angel Figure 5.3

Page 20: Lecture 11 Perspective Projection

A 3D Scene

Notice the presence ofNotice the presence ofthe camera, thethe camera, theprojection plane, and projection plane, and the worldthe worldcoordinate axescoordinate axes

Viewing transformations define how to acquire the image Viewing transformations define how to acquire the image on the projection planeon the projection plane

Notice the presence ofNotice the presence ofthe camera, thethe camera, theprojection plane, and projection plane, and the worldthe worldcoordinate axescoordinate axes

Viewing transformations define how to acquire the image Viewing transformations define how to acquire the image on the projection planeon the projection plane

Page 21: Lecture 11 Perspective Projection

Q1

Using the origin as the centre of projection, derive Using the origin as the centre of projection, derive the perspective transformation onto the plane the perspective transformation onto the plane passing through the point Rpassing through the point R00(x(x00,y,y00,z,z00) and having ) and having

normal vector N=nnormal vector N=n11i+ni+n22j+nj+n33kk

Using the origin as the centre of projection, derive Using the origin as the centre of projection, derive the perspective transformation onto the plane the perspective transformation onto the plane passing through the point Rpassing through the point R00(x(x00,y,y00,z,z00) and having ) and having

normal vector N=nnormal vector N=n11i+ni+n22j+nj+n33kk

Page 22: Lecture 11 Perspective Projection

A1

P(x,y,z) is projected onto P’(x’,y’,z’)P(x,y,z) is projected onto P’(x’,y’,z’)

x’=x’=ααx, y’= x, y’= ααy , z’= y , z’= ααzz

nn11x’+nx’+n22y’+ny’+n33z’=d (where d=nz’=d (where d=n11xx00+n+n22yy00+n+n33zz00))

αα=d/(=d/(nn11x+nx+n22y+ny+n33z)z)

d 0 0 0d 0 0 0

PerPerN,R0N,R0= 0 d 0 0= 0 d 0 0

0 0 d 00 0 d 0

nn1 1 nn22 n n33 0 0

P(x,y,z) is projected onto P’(x’,y’,z’)P(x,y,z) is projected onto P’(x’,y’,z’)

x’=x’=ααx, y’= x, y’= ααy , z’= y , z’= ααzz

nn11x’+nx’+n22y’+ny’+n33z’=d (where d=nz’=d (where d=n11xx00+n+n22yy00+n+n33zz00))

αα=d/(=d/(nn11x+nx+n22y+ny+n33z)z)

d 0 0 0d 0 0 0

PerPerN,R0N,R0= 0 d 0 0= 0 d 0 0

0 0 d 00 0 d 0

nn1 1 nn22 n n33 0 0

Page 23: Lecture 11 Perspective Projection

Q2

Find the perspective projection onto the view Find the perspective projection onto the view plane z=d where the centre of projection is the plane z=d where the centre of projection is the origin(0,0,0)origin(0,0,0)

Find the perspective projection onto the view Find the perspective projection onto the view plane z=d where the centre of projection is the plane z=d where the centre of projection is the origin(0,0,0)origin(0,0,0)

Page 24: Lecture 11 Perspective Projection

Q3

Derive the general perspective transformation Derive the general perspective transformation onto a plane with reference point Ronto a plane with reference point R00(x(x00,y,y00,z,z00), ),

normal vector N=nnormal vector N=n11i+ni+n22j+nj+n33k, and using C(a,b,c) as k, and using C(a,b,c) as

the centre of projectionthe centre of projection

Derive the general perspective transformation Derive the general perspective transformation onto a plane with reference point Ronto a plane with reference point R00(x(x00,y,y00,z,z00), ),

normal vector N=nnormal vector N=n11i+ni+n22j+nj+n33k, and using C(a,b,c) as k, and using C(a,b,c) as

the centre of projectionthe centre of projection

Page 25: Lecture 11 Perspective Projection

A3

PerPerN,R0’N,R0’=T=TCC. Per. PerN,R0 N,R0 .T.T-C-CPerPerN,R0’N,R0’=T=TCC. Per. PerN,R0 N,R0 .T.T-C-C

Page 26: Lecture 11 Perspective Projection

Q4

Derive parallel projection onto xy plane in the Derive parallel projection onto xy plane in the direction of projection V=ai+bj+ckdirection of projection V=ai+bj+ckDerive parallel projection onto xy plane in the Derive parallel projection onto xy plane in the direction of projection V=ai+bj+ckdirection of projection V=ai+bj+ck

Page 27: Lecture 11 Perspective Projection

A4

x’-x=ka , y’-y=kb , z’-z=kcx’-x=ka , y’-y=kb , z’-z=kc

K=-z/c (z=0 on xy plane)K=-z/c (z=0 on xy plane)

1 0 -a/c1 0 -a/c

ParParVV= 0 1 -b/c= 0 1 -b/c

0 0 0 0 0 0

x’-x=ka , y’-y=kb , z’-z=kcx’-x=ka , y’-y=kb , z’-z=kc

K=-z/c (z=0 on xy plane)K=-z/c (z=0 on xy plane)

1 0 -a/c1 0 -a/c

ParParVV= 0 1 -b/c= 0 1 -b/c

0 0 0 0 0 0