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

Post on 22-Apr-2020

2 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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

Projections

© 1995-2015 Josef Pelikán & Alexander Wilkie

CGG MFF UK Praha

pepca@cgg.mff.cuni.cz

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

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

Basic Concepts

plane of projection

projectionrays

plane of projection

projectionorigin

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)

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

Monge projection

elevation

top view

side view

x y

y

z z

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

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

Axonometry – Dimetric Projection

xy

z

projection plane

1

11

a a

b

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

Axonometry – Trimetric Projection

x

y

z

projection plane

1

11

ba

c

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°

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°

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

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

One Point Perspectivez

projection plane || xz

x

y

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

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

Two Point Perspective

zperspective plane || z

xy

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

Three Point Perspective

zprojection planeintersects all axes

xy

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)

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

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

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 ]

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

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!

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]

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]

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

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

top related