projections - univerzita karlova · 2017-01-18 · (central) perspective projections –projection...

24
1 / 24 Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca Projections © 1995-2015 Josef Pelikán & Alexander Wilkie CGG MFF UK Praha [email protected] http://cgg.mff.cuni.cz/~pepca/

Upload: others

Post on 22-Apr-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

1 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Projections

© 1995-2015 Josef Pelikán & Alexander Wilkie

CGG MFF UK Praha

[email protected]

http://cgg.mff.cuni.cz/~pepca/

Page 2: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

2 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Basic Concepts

plane of projection

projectionrays

plane of projection

projectionorigin

Page 3: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

3 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Classification of Linear Projections

Parallel projections– Projection rays are parallel to each other

Orthogonal projections– Projection rays are orthogonal to the projection plane– Monge projection, floor plan, elevation, side view– Axonometry (general orthogonal projection)

Oblique projections– Cabinet projection (the z axis has ½ scale)– Cavalier projection (same scale on all axes)

Page 4: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

4 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Monge projection

elevation

top view

side view

x y

y

z z

Page 5: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

5 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Axonometry – Isometric Projection

xy

z

projection plane

1

1

1

a a

a

Page 6: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

6 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Axonometry – Dimetric Projection

xy

z

projection plane

1

11

a a

b

Page 7: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

7 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Axonometry – Trimetric Projection

x

y

z

projection plane

1

11

ba

c

Page 8: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

8 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Cabinet Projection

projection plane = xy

x

z

y

1

11

11/2

30°

x

z

y

1

11

11/2

45°

Page 9: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

9 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Cavalier Projection

projection plane = xy

x

z

y

1

11

11

30°

x

z

y

1

1

1

1

1

45°

Page 10: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

10 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Classification of Linear Projections

(Central) perspective projections– Projection rays form a beam that pass through a single

point, the center of the projection– Do not preserve parallelism (vanishing points!)

One point perspective– The plane of projection is parallel to two coordinate axes– Lines parallel to the third coordinate axis meet in one

vanishing point

Page 11: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

11 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

One Point Perspectivez

projection plane || xz

x

y

Page 12: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

12 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Classification of Linear Projections

Two point perspective– The plane of projection is parallel to one coordinate axis

– Lines parallel to the other axes meet in two vanishing points

Three point perspective– The plane of projection is in an arbitrary orientation

– Lines parallel to the coordinate axes meet in three vanishing points

Page 13: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

13 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Two Point Perspective

zperspective plane || z

xy

Page 14: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

14 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Three Point Perspective

zprojection planeintersects all axes

xy

Page 15: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

15 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Orthogonal Projection Implementation

[x,y] are usually coordinates in the viewing plane, and z depth (distance from the viewer)

Fundamental views (top, front, side)– These are just permutations of the x, y and z axes (with

possible sign change)

General orthogonal projection (isometric)– View direction (normal of the projection plane): N– Orientation vector (up): u– Transformation: Cs(S,u×N,u,N)

Page 16: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

16 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Orthogonal Projection

x

y

z

N

u×Nu

Cs(S,u×N,u,N)

x

y

zN

u×N

u

S

Page 17: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

17 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

[1 0 0 00 1 0 0

K⋅cosα K⋅sin α 1 00 0 0 1

]

perspective plane: xyforeshortening coefficient: Kangle of the projection axis z:

x

z

y

K

Oblique Projection Implementation

Page 18: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

18 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Central Projection Implementation

General perspective projection:– Center of the projection: S– View direction (normal of the perspective plane): N– Distance of the plane from the center of the projection: d– Orientation vector (up): u

Projection transformation:– Use standard orientation (center at the origin, view

direction along z): Cs(S,u×N,u,N)– Perspective projection: e.g. [ x· d/z, y· d/z, z ]

Page 19: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

19 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Using the Standard Orientation

Cs(S,u×N,u,N)

x

y

z

N

u×N

u

S

d

x

y

z

N

u×Nu

Page 20: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

20 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Perspective Transform

[1 0 0 00 1 0 0

0 0 1 1d

0 0 0 0]

x, y

z

d

projection plane

Does NOTconservelinearity!

Page 21: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

21 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Transformation of Linear Objects

Perspective transform of lines Per:– The following equation obviously does not hold:

Per(A + t· [B - A]) = Per(A) + t· [Per(B) - Per(A)]

Using a difference algorithm (DDA) for visibility calculations:– Given point C(u) on the segment Per(A)Per(B):

C(u)x,y = Per(A)x,y + u· [Per(B)x,y - Per(A)x,y]

– This also has to hold for depth z:

C(u)z = Per(A)z + u· [Per(B)z - Per(A)z]

Page 22: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

22 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

Conservation of Linearity

[1 0 0 00 1 0 0

0 0 11−d

1

0 0 −d1−d

0 ]x, y

z

d

projection plane

1 1

x, y

z[-k,1] [k,1]

Page 23: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

23 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

4D Clipping

x, y

z

-k k

x,y = -k x,y = k

z = 0

viewing area

limit hyperplane:x = -kw, x = kw, y = -kw, y = kw, z = 0

for w > 0: -kw < x < kw, -kw < y < kw, 0 < z

Page 24: Projections - Univerzita Karlova · 2017-01-18 · (Central) perspective projections –Projection rays form a beam that pass through a single point, the center of the projection

24 / 24Projection 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

End

Further Information

J. Foley, A. van Dam, S. Feiner, J. Hughes: Computer Graphics, Principles and Practice, 229-283

Jiří Žára a kol.: Počítačová grafika, principy a algoritmy, 277-291