+ All Categories
Home > Documents > 06 viewing 1 - IIT Bombay · 2015-08-13 · CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015...

06 viewing 1 - IIT Bombay · 2015-08-13 · CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015...

Date post: 18-Mar-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
10
  CS 475 / CS 675 Computer Graphics Lecture 6 : Viewing CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015 Perspective Projection Image Plane or Projection Plane Object Projectors Centre of Projection CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015 Parallel Projection Image Plane or Projection Plane Object Projectors Centre of Projection? CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015 Parallel Projection Orthographic Projection Top View Side View Front View Multiviews (x=0, y=0 or z=0 or principal planes). True size or shape for lines. For projection on the z=0 plane we get the projection matrix as P z =0 = [ 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 ]
Transcript

   

 

CS 475 / CS 675Computer Graphics

Lecture 6 : Viewing

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Perspective Projection

Image Planeor Projection Plane

Object

Projectors

Centre of Projection

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Parallel Projection

Image Planeor Projection Plane

Object

ProjectorsCentre of Projection?

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Parallel ProjectionOrthographic Projection

Top View

Side View

Front View

● Multiviews (x=0, y=0 or z=0 or principal planes).

● True size or shape for lines.

● For projection on the z=0 plane we get the projection matrix as

P z=0=[1 0 0 00 1 0 00 0 0 00 0 0 1

]

   

 

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Parallel ProjectionAxonometric Projection

● Transform and then project using an orthographic projection such that at multiple adjacent faces are visible – better representation of a 3D object using 1 view. Face parallel to projection plane shows true shape and size.

● If be the matrix formed by stacking up the unit vectors along the three axes, and be the axonometric projection, then

T.U=T . [1 0 00 1 00 0 11 1 1

]=[x x ' x y ' x z 'y x ' y y ' y z '0 0 01 1 1

]T

U

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Parallel ProjectionAxonometric Projection

● If be the matrix formed by stacking up the unit vectors along the three axes, and be the axonometric projection, then

T.U=T . [1 0 00 1 00 0 11 1 1

]=[x x ' x y ' x z 'y x ' y y ' y z '0 0 01 1 1

]T

U

● The foreshortening ratios for each projected principal axes are then given by:

f x= x x '2y x '2 f y= x y '2

y y ' 2 f z= x z ' 2 yz ' 2

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Parallel ProjectionAxonometric Projection

● Depending on the kind of foreshortening they cause we can have three types of axonometric projections

– Trimetric (all foreshortenings are different)

f x≠ f y≠ f z

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Parallel ProjectionAxonometric Projection

● Depending on the kind of foreshortening they cause we can have three types of axonometric projections

– Trimetric (all foreshortenings are different)

– Dimetric (two foreshortenings are the same)

f x≠ f y≠ f z f x= f z

   

 

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Parallel ProjectionAxonometric Projection

● Depending on the kind of foreshortening they cause we can have three types of axonometric projections

– Trimetric (all foreshortenings are different)

– Dimetric (two foreshortenings are the same)

– Isometric (all foreshortenings are the same)

f x≠ f y≠ f z f x= f z f x= f y= f z

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Parallel ProjectionAxonometric Projection

● Assuming we rotate by and before we do the projection on the z=0 plane.

T =P z=0 . R x . Ry

=[1 0 0 00 1 0 00 0 0 00 0 0 1

] .[1 0 0 00 cos −sin 00 sin cos 00 0 0 1

] . [cos 0 sin 00 1 0 0−sin 0 cos 00 0 0 1

]=[

cos 0 sin 0sin sin cos −sincos 00 0 0 00 0 0 1

]

Ry Rx

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Parallel ProjectionAxonometric Projection

● Now we apply this axonometric projection to

T.U=[cos 0 sin 0sin sin cos −sin cos 00 0 0 00 0 0 1

] .[1 0 00 1 00 0 11 1 1

]=[

cos 0 sin

sin sin cos −sin cos0 0 01 1 1 ]

UT

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Parallel ProjectionAxonometric Projection

● So the foreshortening ratios become

f x2=cos2

sin2 sin2

f y2=cos2

f z2=sin2

sin2 cos2

● For Isometric projections, if we solve for then we get and

f x= f y= f z=35.26 =±45

   

 

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Parallel ProjectionOblique Projection

● The projectors are parallel to each other but they are not perpendicular to the plane of projection.

● Only planes parallel to plane of projection show true shape and size.

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Parallel ProjectionOblique Projection

P x , y , z

P ' x , y

P ' ' x p , yp

l

x p=xl cos

y p=yl sin

tan =zl

or l=z cot

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

● When we get a Cavalier projection. Lines perpendicular to the projection plane are not foreshortened.

● When we get Cabinet projections. Lines perpendicular to the projection plane are foreshortened by half.

● is typically 30° or 45°.

Parallel ProjectionOblique Projection

P x , y , z

P ' x , y

P ' ' x p , y p

l

cot =1 /2

=45

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Perspective Projection

Image Planeor Projection Plane

Object

Projectors

Centre of Projection

● Projectors converge at a finite centre of projection.

● Parallel lines converge.

● We get non-uniform foreshortening.

● Shape is not preserved.

● We see in perspective – so perspective viewing seems natural and helps in depth perception.

   

 

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

A digression into art

13th century , Arezzo by Giotto

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

A digression into art

Early 15th century , The Little Garden of Paradise

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

A digression into art

15th century , The Baptistry in Florence, Filippo Brunelleschi

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

A digression into art

15th century , Fresco of Holy Trinity, Masaccio

   

 

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

A digression into art

15th century , School of Athens, Raphael

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Perspective Projection

P x , y , z

P ' x ' , y '

zc

y y 'l1

l2

y 'l2

=y

l 2−l1

zc

l 2

=zc−z

l2−l 1

⇒ y '=y

1−zzc

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Perspective Projection

P x , y , z

P ' x ' , y '

zc

x x '

l 1l2

x 'l2

=x

l2−l1

zc

l2

=zc−z

l2−l1

⇒ x '=x

1−zzc

zc

z

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Perspective Projection

● First we apply a perspective transform to a point that takes it to

[x 'y 'z 'w ' ]=[

1 0 0 00 1 0 00 0 1 00 0 r 1 ] .[

xyz1 ]=[

xyz

rz1]x '=

xrz1

, y '=y

rz1, z '=

zrz1

X '=Pr . X

X X '

   

 

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

● If then we get

Perspective Projection

● First we apply a perspective transform to a point that takes it to

● Now we add projection on the plane.

[x 'y 'z 'w '

]=[1 0 0 00 1 0 00 0 0 00 0 0 1

] .[1 0 0 00 1 0 00 0 1 00 0 r 1

] . [xyz1 ]=[

xy0

rz1]x '=

xrz1

, y '=y

rz1, z '=0

X '=P z=0 .P r . X

X X '

z=0

r=−1zc

x '=x

1−zzc

, y '=y

1−zzc

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Perspective Projection● Vanishing point in the z

direction.

● Set of lines not parallel to the projection plane converge at a vanishing point.

VP z

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

● If then we get , i.e., the vanishing point lies an equal distance on the opposite side of the projection plane as the center of projection.

Perspective Projection

● To find the vanishing point along the z direction we apply the perspective transformation to the point at infinity along the z direction.

[x 'y 'z 'w '

]=[1 0 0 00 1 0 00 0 1 00 0 r 1

] . [0010]=[

001r] x '=0, y '=0, z '=

1r

X '=Pr . X

r=−1 / zcz '=−zc

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

● CoP is at , VP is at

Perspective Projection

● Centre of projection (CoP) on x axis

[x 'y 'z 'w '

]=[1 0 0 00 1 0 00 0 1 0p 0 0 1

] .[xyz1 ]=[

xyz

px1]x '=

xpx1

, y '=y

px1, z '=

zpx1

X '=P p . X

−1/ p ,0,0,1 1 / p , 0,0, 1

Single point perspective

   

 

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

● CoP is at , VP is at

Perspective Projection

● Centre of projection (CoP) on y axis

[x 'y 'z 'w '

]=[1 0 0 00 1 0 00 0 1 00 q 0 1

]. [xyz1 ]=[

xyz

qy1]x '=

xqy1

, y '=y

qy1, z '=

zqy1

X '=Pq . X

0,−1/q ,0,1 0,1 /q ,0,1

Single point perspective

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Perspective Projection

P pq=P p .P q=[1 0 0 00 1 0 00 0 1 0p 0 0 1 ] .[

1 0 0 00 1 0 00 0 1 00 q 0 1 ]=[

1 0 0 00 1 0 00 0 1 0p q 0 1 ]

Two point perspective

x '=x

pxqy1, y '=

ypxqy1

, z '=z

pxqy1

● Two vanishing points

● Two CoPs?

From http://gatewayhsart.wordpress.com

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Perspective Projection

P pqr=P p . Pq . Pr=[1 0 0 00 1 0 00 0 1 0p q r 1

]Three point perspective

x '=x

pxqyrz1, y '=

ypxqyrz1

● Three vanishing points

● Three CoPs?

z '=z

pxqyrz1

M. C. Esher, Ascending and Descending

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Perspective Projection

T =Pr z=0 . T l , m , n=[1 0 0 00 1 0 00 0 0 00 0 r 1

] .[1 0 0 l0 1 0 m0 0 1 n0 0 0 1

]=[1 0 0 l0 1 0 m0 0 0 00 0 r rn1

]

Generation of perspective views

● Transform and then apply single point persepective.

● Let us try to translate, apply a perspective and project to z=0

   

 

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Perspective ProjectionGeneration of perspective views

● Translation along x=y line.

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Perspective ProjectionGeneration of perspective views

● Translation along the z axis causes change in scaling.

z −z

y

−y

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Perspective ProjectionGeneration of perspective views

● Rotate about y axis and then apply single point persepective projection.

T =Pr z=0 . Ry =[1 0 0 00 1 0 00 0 0 00 0 r 1

] .[cos 0 sin 0

0 1 0 0−sin 0 cos 0

0 0 0 1]

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Perspective ProjectionGeneration of perspective views

● Rotate about y axis and then apply single point persepective projection.

T =Pr z=0 . R y =[1 0 0 00 1 0 00 0 0 00 0 r 1

] .[cos 0 sin 0

0 1 0 0−sin 0 cos 0

0 0 0 1]

=[cos 0 sin 0

0 1 0 00 0 0 0

−r sin 0 r cos 1]

● We get a two point perspective.

   

 

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Perspective ProjectionGeneration of perspective views

● Rotate about y axis, x axis and then apply single point persepective projection.

T =Pr z=0 . Rx . R y

=[1 0 0 00 1 0 00 0 0 00 0 r 1

] .[1 0 0 00 cos −sin 00 sin cos 00 0 0 1

] . [cos 0 sin 0

0 1 0 0−sin 0 cos 0

0 0 0 1]

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Perspective ProjectionGeneration of perspective views

● Rotate about x axis, y axis and then apply single point persepective projection.

T =Pr z=0 . Ry , Rx

=[cos 0 sin 0

sin sin cos −sincos 00 0 0 0

−r cossin r sin r coscos 1]

● We get a three point perspective.

CS 475 / CS 675: Lecture 6 Parag Chaudhuri, 2015

Taxonomy

Parallel Perspective

Orthographic ObliqueAxonometric

Trimetric

Dimetric

Isometric

Cavalier

Cabinet

Front

Top

Side

Planar Projections

One Point

Two Point

Three Point


Recommended