«ChangeLine» algoritmi yozilishi
Chegaralarni ajratish algoritmi, rastrda ajratish va ularni qayta tiklash.
1.
dot0, dot1 –chegara konturlariga tegishli nuqtalar
2.
vec0, vec1 – local yo’nalishlar
3.
GetVec(dot0, dot1) - dot0 dan dot1 ga yo’nalgan vektorlar
4.
alphaTest – papilliar chegaralarni aniqlash konstantalari
5.
NextDotCW(dot0, step) – step nuqtalardan chegaralarni ajratish
Chegaralarni kesishuvini aniqlash
1.
Begin
2.
dot0 ::= boshlang’ich qiymat
3.
dot1 ::= NextDotCW(dot0, step);
4.
vec0 ::= GetVec(dot0, dot1);
5.
dot0 ::= dot1;
6.
dot1 ::= NextDotCW(dot0, step);
7.
vec1 ::= GetVec(dot0, dot1);
8.
If |vec1 – vec0| < alphaTest, go to p. 11
34
1
1
1
1
1
...
T
Y
X
T
Y
X
M
k
k
k
=
9.
If topilgan nuqtalar kesishsa , unda aniqlangan qiymatlar to’xtatiladi
10.
If topilgan nuqtalar ochiq joylar bo’lsa dastur boshiga boring
11.
vec0 ::= vec1; go to p.5
12.
End
Do'stlaringiz bilan baham: |