.


:




:

































 

 

 

 


, , , ...

, .. .

 
  :
  • ,
  • ;
  • ;
  • o- .
:
  • ;
  • ;
  • .

 

 

, . . . . , . .

, . , (). . 8- Illustrator'a .psd- Photoshop'a . , , . , .

 

5/ y=kx+b?

. y=kx+b. k b, , .

 

, .
. , .
, . : , , , (, ..). . , , . , , , . , , .
. :
. (, ), .
. y=kx+b. k b, .
. , , , , . . , . , , : x2+ay2+a2xy+a3x+a4y+a5=0.
. . , , . . : x3+ay3+a2x2y+a3x y2+ a4x2+ a5y++a6xy+a7x+a8y + a9=0.
. . , . , . , , . , .
.

6/ AutoCAD?

. , ,

 

3.7.

 

Z, Z .. 3- . (Elev), ' ('ddmodes) : Command: elev New current elevation <20.0000>: 30 New current thickness <5.0000>:

 

 

- 1 256, , ( ). , : 1 (red); 2 - (yellow); 3 - (green); 4 - (cyan); 5 - (blue); 6 - (magenta); 7 - (white). . : 1). / . AutoCAD (.3.1.) . 2) Color .

 

 

. - ( , ) AutoCAD (, , , , , ..). . 31 , , : "$" (), "-" (), "_" (). , . : continuous dash dot ___. ___. ___. ___. ___ dash - - - - - - - - - - - - - - - - - - - dot...................... , "continuous" (), . .. (linetype) (ddltype):

 

 

, AutoCAD, . . , Center , Frame - , Main - . / / (. 3.5) layer, .

: http://life-prog.ru/view_autocad.php?id=10

 

 

:

1. ;

2. ;

3. .

 

7/ utD.

 

. 4 1) , . - (. 4). Scale (), Select objects: ( :) Enter .

 

. 5. Scale 2) Scale (). (. 5) Modify (), Scale () . 3) Specify base point: ( :) (, )

 

. 6. 4) Specify scale factor or [Reference]: ( [ ]:) R. 5) Specify reference length <1>: ( <1>:) , , . . - , ( 1 2 . 6),. 6) Specify new length: ( :) . - 262. Enter .

 

 

8/ . .

, . , , - .

( - ). , , .

.

 

.

[ 103 ], ( ), , .

.

, ( ) .

.

, (, ).

, .

 

9/ utD .

Autocad . Autocad . , , CorelDRAW ( CorelDRAW Graphics Suite 15 SP3).


, . .


. Line () L. Specify first point ( ). , . Specify next point or (Undo) ( ). . , , , . . , . , . . Enter. Line (), Enter. , , .


Line () . , Line (), Enter, Autocad . . . . Undo (). , . Close (). , , Line ()


, . Autocad .

 

 

3 :

DDA- , .

, .

, .

:

Direct3D , . () ID3DXLine.

DDA-:

DDA- , . DDA . Digital Differential Analyzer ( ) , ...

DDA-

, . , (. ).

:

#include "fixed.h"

#define roundf(x) floor(x + 0.5f)

void line_DDA_fixed(HDC hdc, float x1, float y1, float x2, float y2)
{
// (1) ,
//
int iX1 = roundf(x1);
int iY1 = roundf(y1);
int iX2 = roundf(x2);
int iY2 = roundf(y2);

// (2)
int deltaX = abs(iX1 - iX2);
int deltaY = abs(iY1 - iY2);

// (3) ,
// .
// ,
int length = max(deltaX, deltaY);

// ,
if (length == 0)
{
SetPixel(hdc, iX1, iY1, 0);
return;
}

// (4)
fixed dX = frac_to_fixed(x2 - x1, length);
fixed dY = frac_to_fixed(y2 - y1, length);

// (5)
fixed x = float_to_fixed(x1);
fixed y = float_to_fixed(y1);

//
length++;
while (length--)
{
SetPixel(hdc, round_fixed(x), round_fixed(y), 0);
x += dX;
y += dY;
}
}

 

:

́ (. Bresenham's line algorithm) , , , . . (Jack E. Bresenham) IBM 1962 .

C++

void drawLine(int x1, int y1, int x2, int y2) { const int deltaX = abs(x2 - x1); const int deltaY = abs(y2 - y1); const int signX = x1 < x2? 1: -1; const int signY = y1 < y2? 1: -1; // int error = deltaX - deltaY; // setPixel(x2, y2); while(x1!= x2 || y1!= y2) { setPixel(x1, y1); const int error2 = error * 2; // if(error2 > -deltaY) { error -= deltaY; x1 += signX; } if(error2 < deltaX) { error += deltaX; y1 += signY; } } }

: .

 

 

. (Xiaolin Wu, ) , Computer Graphics 1991 . , .

 

10/ . .

. , , , .

. ,

  • ;
  • .

,

  • ;
  • - .

. ru.wikibooks.org

, , 2x2 . 3x3. , ?

. , , .

(, ) (x', y', h), = ' / h, = y'/h, h (, h = 0 ).

. . , (1, 1, 1) (2, 2, 2) (1, 1). (x, y, 1), .

33. .

/

: (x, y) -> (ax *x, ay * y). :

[ ax 0 0 ]

[ 0 ay 0 ]

[ 0 0 1 ]

ax x,

ay y.

. , / . , , , .

2x2 . :

[ cos(phi) sin(phi) 0 ]

[ -sin(phi) cos(phi) 0 ]

[ 0 0 1 ]

. phi = , . , / ( ).

(x, y) (x + tx, y + ty). :

[ 1 0 0 ]

[ 0 1 0 ]

[ tx ty 1 ]

/, :

[ -1 0 0 ]

[ 0 1 0 ]

[ 0 0 1 ]
x

[ 1 0 0 ]

[ 0 -1 0 ]

[ 0 0 1 ]
y

3x3, (0 0 1)T, :

[ * * 0 ]

[ * * 0 ]

[ * * 1 ]

, :

f(x) = x * R + t,

R 2x2, t . :

[ R1,1 R1,2 0 ]

[ R2,1 R2,2 0 ]

[ tx ty 1 ]

- :

[ x y 1 ] * [ R1,1 R1,2 0 ]

[ R2,1 R2,2 0 ]

[ tx ty 1 ]

=

[ x y 1 ] + [ tx ty 1 ]

[ x y ] = R * [ x y ]

. : R? |R|. ( , .)

.. , R, . , .

R . .. (1, 0) (R1,1, R1,2), (0, 1) (R2,1,R2,2). R.

.

y, , (-1, 0). .. R :

[ -1 0 ]

[ 0 1 ]

, , :

, . : ? ? , , ?

, .

. , , CTRL.

.. , . , , , :

, , emain.cpp

, , Engine

, , Viewport

, , Action

, .

11 . .

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

. , .

. RGB CMYK .

, , . , . .

1. utD.

2. - utD. .

  1. . utD.
  2. AutoCAD.
  3. 3d .
  4. ?
  5. ?

 



<== | ==>
, . | . - . .
:


: 2017-02-11; !; : 409 |


:

:

, .
==> ...

1589 - | 1449 -


© 2015-2024 lektsii.org - -

: 0.091 .