Viewing System

Post on 06-Jan-2016

33 views 0 download

description

Viewing System. 한신대학교 류승택. 3D Transformation. 3D Transformation. Modeling Coordinates (Xm, Ym, Zm). World Coordinates (Xw, Yw, Zw). Viewing Coordinates (Xv, Yv, Zv). Modeling Transformation. Viewing Transformation. Device Coordinates (Xd, Yd). Projection Coordinates (Xp, Yp). - PowerPoint PPT Presentation

Transcript of Viewing System

Viewing System

한신대학교류승택

3D Transformation

3D Transformation

ModelingCoordinates

(Xm, Ym, Zm)Modeling

Transformation

ModelingTransformation

WorldCoordinates(Xw, Yw, Zw)

ViewingTransformation

ViewingTransformation

ViewingCoordinates(Xv, Yv, Zv)

ProjectionTransformation

ProjectionTransformation

ProjectionCoordinates

(Xp, Yp)Workstation

Transformation

WorkstationTransformation

DeviceCoordinates

(Xd, Yd)

Viewing Transformation (1/5)

Pview = R T

Translation (T)

Rotation (R)

1000

100

010

001

z

y

x

C

C

C

T

1000

0

0

0

zyx

zyx

zyx

nnn

vvv

uuu

R

Scalar Product

Scalar Product (= dot product) ( 내적 ) The sum of the products of their corresponding components

Using the law of cosine, the angle between two vectors a and b satisfies the equation

Scalar Product Properties

• If a is perpendicular to b, then

zzyyxx bababa ba

cosbaba

ba

ba 1cos

abba 2

aaa

cabac)(ba )()()( bababa kkk

cosbaba

0ba

Scalar ??A quantity that is completely specified by its magnitude and has no direction.

a

b

Scalar Product

Scalar Product Use the dot product to project a vector onto another vector

• V unit vector

• The dot product of V and W the length the projection of W onto V

A property of dot product used in CG• Sign

WV|W||V|

WV|W||W||X|

cos

WV (unit vector)

X

o

o

o

90 if 0

90 if 0

90 if 0

WV

WV

WV

Vector Product

Vector Product (= Cross Product) 외적

c = a x b c is perpendicular to both a and b direction: right-hand property

• Perpendicular to the pane defined by a and b

kjiba )()()( xyyxxzzzxyzzy babababababa

)()()( xyyxxzzzxyzzy babababababa ba

zyx

zyx

bbb

aaa

kji

ba b

a

c

Viewing Transformation (2/5)

N vector

V vector Up vector

U vector

),,( zyx uuuVNU

zyx vvvV

VV ,,

0,1,0Up

NNUpUpV )(

zyx nnnN

NN ,,

V

Up-N

Viewing Transformation (3/5)

Another Way

),,(

),,(

,,

321

321

321

vvvunv

uuuNV

NVu

nnnN

Nn

대문자 V Up 벡터를 말함

Viewing Transformation (4/5)

Projection

Parallel Projection vs xx vs yy 0sz

1

ortv

v

v

z

y

x

w

Z

Y

X

P

1000

0000

0010

0001

ortP

Parallel Perspective

Viewing Transformation (5/5)

Perspective Projection

v

vs

z

x

d

x

v

vs

z

y

d

y

dz

yy

v

vs /

dz

xx

v

vs /

1

persv

v

v

z

y

x

w

Z

Y

X

P

0/100

0100

0010

0001

pers

d

P

wXxs / wYys / wZzs / dzw v /

Conclusion (1/2)

3D Viewing Transformation Parallel Projection

1

ort z

y

x

w

Z

Y

X

RTP

11000

100

010

001

1000

0

0

0

1000

0000

0010

0001

z

y

x

C

C

C

nnn

vvv

uuu

w

Z

Y

X

z

y

x

zyx

zyx

zyx

(Xv, Yv, Zv, 1)

(Xp, Yp, 0, 1)

(Xw, Yw, Zw, 1)

Conclusion (2/2)

3D Viewing Transformation Perspective Projection

1

per z

y

x

w

Z

Y

X

RTP

11000

100

010

001

1000

0

0

0

0/100

0100

0010

0001

z

y

x

C

C

C

nnn

vvv

uuu

dw

Z

Y

X

z

y

x

zyx

zyx

zyx

(Xv, Yv, Zv, 1)

(Xp, Yp, Zp, 1)

(Xw, Yw, Zw, 1)

3D Viewing Process (1/2)

3D Viewing Process

ModelingCoordinates

(Xm, Ym, Zm)Modeling

Transformation

ModelingTransformation

WorldCoordinates(Xw, Yw, Zw)

ViewingTransformation

ViewingTransformation

ViewingCoordinates(Xv, Yv, Zv)

ProjectionTransformation

ProjectionTransformation

ProjectionCoordinates

(Xp, Yp)Workstation

Transformation

WorkstationTransformation

DeviceCoordinates

(Xd, Yd)

3D Viewing Process (2/2)

3D Viewing Process

ModelingCoordinates

(Xm, Ym, Zm)Modeling

Transformation

ModelingTransformation

WorldCoordinates(Xw, Yw, Zw)

ViewingTransformation

ViewingTransformation

ViewingCoordinates(Xv, Yv, Zv)

ProjectionTransformation

ProjectionTransformation

ProjectionCoordinates

(Xp, Yp)Workstation

Transformation

WorkstationTransformation

DeviceCoordinates

(Xd, Yd)

Normalizing Transformation

Normalizing Transformation ClippingClipping

NormalizingCoordinates(Xn, Yn, Zn)

ClippingCoordinates(Xc, Yc, Zc)