Компьютерная графика: методические указания к лабораторному практикуму

  • View
    216

  • Download
    2

Embed Size (px)

Transcript

  • ,

    .. , ..

    -

    2005

  • ,

    , . , , , , .

    , , , , - , . , . , , . () .

    .. .. . , .

  • 3

    , ,

    , , . . , .

    , , . , .

    - . . , , , , , , . .

    , , .

    -. , . , .

  • 4

    1 1

    1.1

    . , ( ) . , . , .

    1.2 1.

    .

    , , - , .

    : Y = kX + b, (1) k=0, k=1, k=10, k=0.2, k=1,5;

    . dy/dx = y/x = const, (2) const k, .

    (, Bezier).

    , , .

    X = x1(1-t) + x2 t, Y = y1(1-t) + y2 t, (3)

    , 1(1,1) , 2(2,2) ,

    t=0,...,1 ( t

  • 5

    1.3 2.

    . , .

    : (X - a)2 + (Y - b)2 = R2, (4) =150, b=100 R=50 (=0, b=0 R=80);

    X = a + RCos(), Y = b + RSin(), (5) , ( =3.14159);

    dy/dx = - x/. , , , (- X) Y:

    X n+l = Xn + y n, Y n+l = Y n - n, (6)

    ,

    . , 2-n (2n-1

  • 6

    , (8). q , Sin( ) Cos( ) .

    :

    Xn+l = nCos()+YnSin(); Yn+l = YnCos() - nSin(), (8) = 2 /n (n -

    ). .

    , . , .

    1.4 3. .

    . 3+ .

    . , , .

    .

    : ( ) (). () .

    .

    : = R(), (9) :

    X= Cos(), Y= Sin(); (10)

  • 7

    (), :

    X=a+RCos()+ACos(), Y=b+RSin()+BSin(), (11)

    (),

    : X=a+RxSin(/Dx+Dy),

    Y=b+RySin(/Dx+Dy) (12) 1.5 4.

    , , 1.

    1

    2, .

    2

  • 8

    2 2

    2.1

    (1-)S1 + S2 = 0 , (13) S1 S2 ( ) , -

    1 0 . S1 S2 4 ,

    P(x,y) : = S1(xp,yp)/[ S1(xp,yp) - S2(xp,yp)] (14) , , S,

    3.

    3 4

    : (k1X + b1Y + C1)(k2X + b2Y + C2) = 0 (15) , , (1-)t1t2 + t3t4 = 0 , (16) t1, t2, t3 t4 - . .

    [ 1(x1,y1), 2(x2,y2) ] [ t1 ,t2 ],

  • 9

    l . , ( 4),

    (1-)t1t2 + l2 = 0 , (17)

    F(xF,yF) :

    = t1t2(xF,yF)/[ t1t2(xF,yF) - l2 (xF,yF)]. (18)

    2.2 1.

    , 5, . (-40,0), D(-20,80) (0,100) , . (-40,0), G(-20,-30) F(0,-40) , .

    5 6

    2. 6 . 0.2.

    3. , (0,0), (1,0), (1,1), D(0,1) (3/2,1/2). .

    2.3 2.

    = R (), (19)

  • 10

    X = Cos() Y = Sin() (20) 2.4 3.

    ,

    : = a *(5+2 *Cos() + 3*Cos(m)sign(Cos()))--b*(Sin(18*))2 *Cos(/2))8, = a * Cos(4*t) + b = t c*Sin(4 + t ), = a *(1 + Cos(3*) + b* Sin(3*))2

  • 11

    3 3

    3.1 1.

    . R1 R2. , R3 , ( ).

    R2 R1, . R3 R2.

    7 3.2 2

    (

    ) Bezier 1, 2 3- ,

    Px(t)=Cimti(1-t)m-iXi,

    Py(t)=Cimti(1-t)m-iYi, (21) m - , i=0,...,m. 3.3 3

    (

    ) Bezier . , .

  • 12

    4 4

    4.1 ()

    ,

    . , .

    4.2 1

    , , 1:1

    ( ), AutoCAD. .

    , . 4.3 2

    ,

    Bzier . , . .

    4.4 3

    -

    . , . .

    P(t) = P1(t) + P2(t) + P3(t), (22)

    tPPP iit 211 *][21)( += ,

    PttP it 122 *)(*2)( = ,

    )1 2213 (*][21)( += tPPP iit .

  • 13

    t 0,...,1. (x,y) .

  • 14

    5 5

    5.1

    , . .

    8

    U () V ().

    . V U ( 1).

    .

    F(x,y,z) = 0, z=f(x,y), :

    x = X(u,v), y= Y(u,v), (23) z = Z(u,v).

    u v .

    .

    U () V ().

    . -

  • 15

    V U .

    .

    : F(x,y,z) = 0, z=f(x,y), x = X(u,v), y= Y(u,v), z = Z(u,v).

    u v . 5.2 1.

    . oZ. . . , , oY.

    .

    5.3 2.

    . , .

    - Bzier ( ), 1(0,100), 4(100,0) 2(30,20), 3(80,140).

    . 120. 1.

    : = 30)( CosxyX , += 30)( SinxyzY a (24) : Sin(30)= 0.5, Cos(30)= 0.866

    .

  • 16

    6 6 6.1

    , ,

    ( ) ( ).

    ( ).

    , . , , .

    6.2

    u.

    9

    . , , r0, u1 u2. r0. ( ) u1 u2 ( 9). r u r', r=r-zu.

    x' ' , r'= r0+x'u1+y'u2 r'=r-z'u= r0+x'u1+y'u2.

    . u1 u2

    ', ', z'. ,

  • 17

    (25) u1 u u2 u, x' '.

    , ,)uu(uu))(ur(rx

    12

    10

    =

    ,)uu(uu))(ur(ry

    12

    20

    = (26)

    , . . u=u1 u2, : x' = (r-r0)u1, y' = (r-r0)u2, z' = (r-r0)u3.

    , .

    . xA-yA-zA 10.

    10

    oZ

    Ya :

    = - 1+x2, Ya =-z1-z2+za (27)

    kx,ky kz :

    =-kxCos +ykyCos, Ya =-kxSin -ykySin +zaky (28)

  • 18

    , kx=ky=kz ==30 , , :

    =(y-)Cos30 ,

    Ya =z-(y+)Sin30 (29)

    6.3 ()

    r', r rn (

    ) 11.

    11

    , , r0 -

    , u1 u2, - r'=zr+x'u1,+y'u2. , , r

    rn , z r'=zr+(1-z)un . : r'= zr+x'u1,+y'u2 =zr+(1-z)un .

    u2 (r-rn ), u1 (r-rn ) u1 u2, x, y z.

    , , , .

    d, rn =r0+du, u=u1 u2,.

    ,

    , (30)

  • 19

    6.4 1

    . ( ) . S(500,300,100).

    12

    .

    6.5 2

    . . ( )

    . , .

    .

  • 20

    13

  • 21

    7 7

    7.1 (AutoAD)

    , CorelDraw, CorelHara, Designer . AutoAD Autodesk. , , . AutoAD 1982 . 1989 AutoAD10. 14, AutoAD-2002 AutoAD-2004. .

    AutoAD .

    7.2 1.

    AutoCAD, .

    . . .

    7.3 2

    AutoCAD,

    ( ). .

  • 22

    8 8

    8.1

    , . , , , , .

    , , . , , .

    . . , , .

    8.2 1. :

    .

    . =

    2b2a + : kx = 0,5, ky =0.5 = 49.

    14

  • 23

    8.3 2 .

    15

    : (X-a)2 + (Y-b)2 = R2. , , n=4. f = 0,3. , , , = 2. 8.

    8.4 3 .

    : :

    yCosxSinYySinxCosX

    +=+=

    cyxxdYxdyxxcX

    +=

    +=

    )()(

    0

    00

  • 24

    n=4. 16

    8.5 4

    .

    17

    ( 1/3), . . n =