Геометрические преобразования в компьютерной графике: Конспект лекций

  • Published on
    08-Dec-2016

  • View
    243

  • Download
    4

Embed Size (px)

Transcript

  • ..

    2011

  • 681.3

    ..

    .

    . : , 2011. 50 .

    .

    , , ,

    .

    ,

    .

    2

  • ..................................................................................................... 4

    1 .............................. 7

    1.1 ................... 7

    1.2 ........................................... 12

    2 .................................... 18

    2.1 ............................................................... 18

    2.2 . ....................................................................... 22

    3 ............................... 29

    3.1 ................. 29

    3.2 ..................................... 31

    4 ................................................................................. 45

    3

  • 1951 ,

    () .

    :

    , ,

    - ,

    .

    60- ,

    ( )

    Sketchpad

    (1963 .), General Motors

    (1964 .).

    ,

    .

    , , , ,

    ,

    ,

    , , ,

    .

    ( ), (

    ), ,

    ( ), (

    ), ( ,

    ) .

    4

  • , , ,

    . ,

    , : ()

    , ,

    .

    . ,

    () ,

    (). ,

    , ;

    ,

    ;

    ,

    ,

    .

    ,

    . ,

    , ,

    :

    (

    , , );

    (

    );

    (

    , , );

    5

  • (

    ,

    );

    ( , ,

    , , );

    ( ,

    );

    ( , ..

    ).

    , ,

    , .

    . ,

    ,

    .

    .

    , (

    ).

    OpenGL

    DirectX.

    .

    ,

    .

    6

  • 1

    1.1

    ,

    - , .

    ()

    .

    . ,

    (),

    .

    () .

    ().

    , .

    .

    . .

    , () , (,

    ) .

    ,

    . ,

    , () ()

    7

  • . .

    .

    .

    ()

    , ,

    . ,

    ( )

    .

    ,

    , ,

    .

    . ,

    .

    , ,

    .

    .

    : ,

    .

    .

    . ()

    : , , , .

    8

  • [1].

    ,

    :

    . ,

    ().

    ( rendering)

    .

    ().

    T&L (transformation

    and lighting),

    ,

    .

    . ( )

    ,

    .

    ,

    .

    (rasterization)

    ,

    .

    .

    .

    .

    , .

    . ,

    9

  • ,

    .

    .

    ,

    .

    ( )

    - .

    ,

    .

    ( ) .

    , .

    ,

    ,

    .

    ( ),

    .

    .

    ()

    . .

    , .

    .

    10

  • .

    .

    .

    (,

    ),

    ,

    .

    .

    .

    , . ,

    ,

    () , .

    ,

    .

    , ,

    .

    .

    (), .

    . ()

    11

  • (),

    .

    .

    .

    (, ) .

    ,

    (, ). ,

    .

    ,

    .

    .

    1.2

    1.1

    ,

    .

    (host - ),

    (graphics processing unit GPU).

    .

    , ,

    ,

    , ,

    12

  • , .

    -

    .

    , .

    . ,

    .

    , .

    .

    ,

    , .

    ()

    .

    .

    ,

    ,

    .

    ( ) .

    ,

    ,

    . , -

    , ,

    , -, ,

    .

    13

  • , , ,

    . , ,

    .

    . ,

    ,

    .

    , ,

    .

    , ,

    . ,

    ,

    .

    ,

    .

    .

    ()

    . ,

    ,

    ().

    .

    .

    .

    ,

    14

  • .

    :

    ,

    .

    ,

    .

    ,

    .

    ,

    .

    .

    . ,

    , ,

    . (tessellation).

    .

    , .

    .

    ,

    .

    . ,

    ,

    . -,

    15

  • , (),

    . -,

    () ,

    . , -,

    ,

    ,

    .

    . ,

    . 1 ,

    . a b (a)

    (b) .

    b

    a

    a*

    b*

    , V

    V

    x

    z

    z

    x

    V

    a*

    b*

    a

    b

    , z

    1

    16

  • ,

    .

    ,

    ,

    .

    [1].

    .

    , ,

    , .

    ,

    . ,

    . ,

    .

    ,

    () , ,

    .

    .

    ()

    .

    . ,

    , .

    .

    , ,

    -, -, -.

    17

  • , ,

    .

    , , ,

    .

    ,

    .

    2

    2.1

    ,

    ,

    .

    ,

    .

    , ,

    .

    .

    , ( )

    ,

    ( ) .

    ,

    , P

    P ,

    18

  • , P

    , .

    ,

    ,

    .

    .

    x, y.

    , ,

    :

    ,

    ,

    02221

    01211

    ++=

    ++=

    yytxtyxytxtx

    (2.1)

    x, y , x, y

    ; tij, x0, y0 ,

    .02221

    1211 tttt

    .

    . tij, x0,

    y0 ,

    .

    ,

    . ,

    , .

    19

  • ,

    x0 y0

    .

    (xOy) (

    xOy) :

    ,

    ,

    0

    0

    +=

    +=

    yyyxxx

    x0, y0 xOy xOy .

    ( )

    ()

    ( ) :

    ,cossin,sincos

    yxyyxx

    +=

    =

    .

    , , ,

    x, y, x, y .

    . ,

    ( ).

    , , ykyxkx yx ==

    20

  • k x , k y 0 .

    k x, y > 1 , k x, y < 1

    , k x k y .

    ()

    , .

    , ,

    :

    .2cos2sin,2sin2cos

    yxyyxx

    =

    +=

    2. ,

    ,

    (2.1).

    P*

    x*p x*xp

    yp

    y*p

    P

    0*

    y*

    x*xp

    yp P

    0*

    y*

    y*p P*

    x*p

    x*px*

    xpyp

    y*pP

    0*

    y*

    xf

    y

    xxp

    P

    0*

    y

    Y*0

    x*0

    P ypy*p

    x*p x*

    y*

    a

    2 (), (), () ()

    21

  • .

    -,

    () . -,

    ( ).

    :

    ,Tyxyx = (2.2)

    T .

    x, y

    - yx T. T

    (2.1),

    :

    .

    00

    2212

    2111

    =

    yxtttt

    T

    (2.2). ,

    .

    (2.2) -

    yxyx , ,

    .

    .

    2.2 .

    22

  • n- ,

    , (n+1)- ,

    .

    .

    P

    (x, y).

    [w1 w2 w3],

    P :

    .,3

    2

    3

    1 ywwx

    ww

    == (2.3)

    w3 .

    ,

    (x,y,w), 3.

    P (xh,yh,h)

    P (x,y, ) 1

    P(x,y)

    y

    x x

    w

    1

    0

    y

    w=1

    3

    23

  • P(x,y) w1, w2, w3 , (0, 0, 0)

    P (x, y, 1). , P

    P, P c (xh, yh, h), h

    . ,

    (2.3).

    .

    : (x : y : 1), h=1 ,

    : (w1 : w2 : w3).

    ( w1, w2, w3)

    ( x, y, z),

    , ,

    , A(xA:yA:1).

    ,

    , , KA =| xA yA 1|.

    :

    100

    11

    00

    2212

    2111

    =

    yxtttt

    yxyx

    K = K T, (2.4)

    .

    K T (2.1)

    1=1.

    ,

    .

    24

  • , (translation )

    :

    ,1010001

    00

    =

    yxTR

    (rotation)

    ,1000cossin0sincos

    =RT

    (scaling)

    ,1000000

    y

    x

    mm

    SC =

    (reflection)

    .10002cos2sin02sin2cos

    =RF

    , ,

    x (=0) y (=90).

    ,

    (2.4) .

    .

    ,

    ,

    [2].

    25

  • 1. xc, yc.

    RT ,

    ,

    . , RT,

    , ,

    . (x : y : 1)

    . ,

    TR.

    RT.

    . ,

    () ,

    .

    .

    . , ( )

    : ,

    .

    ,1010001

    1000cossin0sincos

    1010001

    11

    CCCC yxyxyxyx

    =

    : .21 TRRTTRKK =

    ()

    26

  • . ,

    (2.4)

    .

    2. P, P

    (xc, yc).

    ( ),

    ( ).

    :

    , .

    .

    RF ,

    ,

    . ,

    ( ).

    :

    .1010001

    100010001

    100010001

    1010001

    11

    CCCC

    PPPP

    yxyxyxyx

    =

    ( )

    ,

    .

    3. xc, yc

    .

    27

  • ,

    1, .

    ,

    :

    .100020002

    =SC

    :

    .21 SCTRRTTRKK =

    , , , TR3

    . ,

    .

    .

    !

    -. -

    . .

    [2].

    , (2.4), K T

    , . ,

    ,

    , ,

    . ,

    1 :

    28

  • .1100

    1001

    1000cossin0sincos

    1001001

    1yx

    yx

    yx

    yx

    C

    C

    C

    C

    =

    3

    3.1

    . ()

    ,

    , .

    ,

    .

    (),

    .

    , x0y (

    z=0). ,

    ,

    . ,

    ,

    , .

    , . ,

    29

  • ,

    1.2.

    : , ,

    .

    .

    ,

    . ,

    ,

    ,

    ,

    .

    .

    , 4. x

    y, y z, z x ,

    .

    z

    z

    y

    yx x

    4 () ()

    30

  • ,

    xOy, V

    z, 5.

    z*

    x*

    y*P(x*,y*,z*)

    O*

    x*s

    Ps

    y*s

    Pxz

    Pyz

    V z *(0,0,- )v

    5

    . ,

    ,

    .

    , ,

    , .

    3.2

    ,

    , .

    ,

    , ,

    31

  • x, y, z , , , ,

    x*, y*, z*,

    ,

    ,

    ,

    0333231

    0232221

    0131211

    +++=

    +++=

    +++=

    zztytxtzyztytxty

    xztytxtx (3.1)

    tij, 000 ,, zyx ,

    .0

    333231

    232221

    131211

    ttttttttt

    : , ,

    .

    . ,

    ,

    .

    , ,

    ,

    , .

    , :

    (x: y: z: 1), (xh: yh: zh: h), h0

    .

    :

    ,11 Tzyxzyx = (3.2)

    .

    (

    TR):

    32

  • ,1010000100001

    000

    =

    zyx

    TR

    000 ,, zyx .

    ,

    .

    , ( )

    .

    tij (3.1)

    ,

    . 6

    x (xyz).

    , 6

    , , .

    z*

    y*

    x*

    x

    ,

    . ,

    33

    6

  • , .

    , (3.1) t11 x

    x* , t12 x y*

    3.1.

    3.1

    x y z

    x t11 t12 t13y t21 t22 t23z t31 t32 t33

    ,

    .

    1000000

    332313

    322212

    312111

    ttttttttt

    RT =

    : x ( ), y (), z (), 7. ,

    .

    , , ( ) ,

    .

    34

  • .

    (3.2) RTx,

    RTy, RTz,

    .

    . :

    ,

    10000cossin00sincos00001

    =xRT

    ,

    10000cos0sin00100sin0cos

    =yRT

    ,

    1000010000cossin00sincos

    =zRT

    -:

    35

    z

    yx

    7

  • ,10000cossin00sincos00001

    =xRT

    ,

    10000cos0sin00100sin0cos

    =yRT

    .

    1000010000cossin00sincos

    =zRT

    ,

    ( )

    SC:

    ,

    1000000000000

    z

    y

    x

    kk

    k

    SC =

    kx, ky, kz - .

    ,

    ,

    . ,

    .

    36

  • , x,y,z

    xy, ,

    5. PS P . PS s.

    V(0,0, vz )

    )1(

    *

    +

    =

    v

    s

    zz

    xx

    )1(

    *

    +

    =

    v

    s

    zz

    yy (3.3)

    .0* =sz

    5,

    xz yz. PXZ , PYZ

    .

    :

    .

    1000

    1000

    00100001

    =

    vzPR

    37

  • ,

    ,

    . , PR -

    1 zyx ,

    ( )hhzhyhx sss ::: :.1 ,0 , , +

    ====

    vsss z

    zhhzyhyxhx

    h ( ) sss zyx ,, , (3.3),

    PR.

    , vz ,

    .

    ()

    .

    , . ,

    xy :

    .

    10 00010000 1000 01

    =xyRF

    ,

    (

    );

    ;

    38

  • .

    , ,

    (

    ).

    . ,

    , :

    - -.

    -

    .

    1.

    (xA, yA, zA) :

    ,

    (xC, yC, zC)

    .

    V (0,0, vz ),

    , .

    .

    . ,

    ,

    44.

    ,

    39

  • ,

    1, hhzhyhx sAsAsA .

    .

    V,

    x, y, z.

    z.

    z, .

    .

    , . ,

    , z

    . ,

    .

    RTz

    , .

    ,

    .

    .

    . ,

    , .

    ,

    .

    40

  • , ,

    , .

    . , , ,

    ,

    .

    ,

    , :

    ( ) ( )( ) ( )

    .

    10 0 0 010 0 00 10 00 0 1

    1010000100001

    1000010000cos sin 00sincos

    1010000100001

    1000

    1000

    00100001

    1

    =

    CCC

    CCCv

    AAAsAsAsA

    zyx

    zyxz

    zyxhhzhyhx

    , ,

    .

    2.

    , -

    x, y, z, www zyx 000 ,, .

    x, y, z vvv zyx 000 ,,

    41

  • . -.

    . .

    ,

    .

    ,

    , ,

    . ,

    .

    , ,

    . ,

    , ,

    , , ,

    .

    ().

    - 1ppp zyxKP

Recommended

View more >