Upload
cipriana-paduraru
View
212
Download
0
Embed Size (px)
DESCRIPTION
Cohen Sutherland
Citation preview
LABORAT *******Fie drcoduri C(5,8),aplice EF, GH,*******
Fig. 1.
TOR 7 (Cli
**********reptunghiuar atrib
, D(11,4)algoritmu
, IJ in ra**********
. Inainte
B
A
ipping pen
**********ul de clibui algori, E(9,1),ul Cohen-Saport cu d**********
de clippi
ntru segme
**********ipping x_itmul CoheF(13,3), Sutherlanddreptunghi**********
ing
C
G
H
I
ente - Alg
**********_min=3, y_en-SutherlG(6,3), d de clipiul dat. **********
G
goritmul C
**********_min=2, xland puncH(5,1), Ipping pent
**********
E
J
Cohen-Suth
**********x_max=10, telor A(2I(6,5), J(tru segmen
**********
F
D
herland)
**********y_max=6.
2,4), B(2,(9,3). Santele AB,
**********
****Ce
,1), a se CD,
****
Fig. 2. 1. Se a
Above A: y >B: y L: x y_max < y_min > x_max < x_min
ipping
codul de c
ght Left
clipping p
G
H
I
pentru cap
Punc---- A(2 B(2 C(5D(11 E(9F(13 G(6 H(5 I(6 J(9
C
G
petele seg
ctul | Cod----------2,4) | 0002,1) | 0105,8) | 1001,4) | 0019,1) | 0103,3) | 0016,3) | 0005,1) | 0106,5) | 0009,3) | 000
D
J
gmentelor
dul --- 01 01 00 10 00 10 00 00 00 00
AB 1. testul de acceptare/respingere 00010101 ---- ^0001 Respins CD 1. testul de acceptare/respingere 1000 0010 ---- ^ 0000 2. se face clip cu latura de sus x = x0 + (x1 - x0)*(ymax - y0)/(y1 - y0); y = y_max; C(8,6) 3. se updateaza codul + test CD 0000 0010 ---- ^ 0000 4. se face clip cu latura din dreapta y = y0 + (y1 - y0)*(xmax - x0)/(x1 - x0); x = x_max; D(10,14/3) 3. se updateaza codul + test CD 0000 0000 ---- ^ 0000 Acceptat EF 1. testul de acceptare/respingere 0100 0010 ---- ^ 0000
2. se face clip cu latura de jos x = x0 + (x1 - x0)*(ymin - y0)/(y1 - y0); y = y_min; E(11,2) 3. se updateaza codul + test EF 0100 0100 ---- ^ 0100 Respins GH 1. testul de acceptare/respingere 0000 0100 ---- ^ 0000 2. se face clip cu latura de jos x = x0 + (x1 - x0)*(ymin - y0)/(y1 - y0); y = y_min; H(11/2,2) 3. se updateaza codul + test GH 0000 0000 ---- ^ 0000 Acceptat IJ 1. testul de acceptare/respingere 0000 0000 ----- ^ 0000 Acceptat