This repository has been archived by the owner on Nov 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsaved
88 lines (87 loc) · 2.55 KB
/
saved
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
if(viewtrianglex0<viewtrianglex1){
if(viewtrianglex0<viewtrianglex2){
//view triangle 0 has smallest x (unchanged)
}else{
//view triangle 2 has smallest x
let tempx = viewtrianglex2;
let tempy = viewtraingley2;
viewtrianglex2 = viewtrianglex0;
viewtriangley2 = viewtriangley0;
viewtrianglex0 = tempx;
viewtriangley0 = tempy;
}
}else{
if(viewtrianglex1<viewtrianglex2){
//view triangle 1 has smallest x
let tempx = viewtrianglex1;
let tempy = viewtriangley1;
viewtrianglex1 = viewtrianglex0;
viewtriangley1 = viewtriangley0;
viewtrianglex0 = tempx;
viewtriangley0 = tempy;
}else{
//view triangle 2 has smallest x
let tempx = viewtrianglex2;
let tempy = viewtriangley2;
viewtrianglex2 = viewtrianglex0;
viewtriangley2 = viewtriangley0;
viewtrianglex0 = tempx;
viewtriangley0 = tempy;
}
}
if(viewtriangley0<viewtriangley1){
if(viewtriangley0<viewtriangley2){
//view triangle 0 has smallest y
let tempx = viewtrianglex1;
let tempy = viewtriangley1;
viewtrianglex1 = viewtrianglex0;
viewtriangley1 = viewtriangley0;
viewtrianglex0 = tempx;
viewtriangley0 = tempy;
}else{
//view triangle 2 has smallest y
let tempx = viewtrianglex2;
let tempy = viewtriangley2;
viewtrianglex2 = viewtrianglex1;
viewtriangley2 = viewtriangley1;
viewtrianglex1 = tempx;
viewtriangley1 = tempy;
}
}else{
if(viewtriangley1<viewtriangley2){
//view triangle 1 has smallest y (unchanged)
}else{
//view triangle 2 has smallest y
let tempx = viewtrianglex2;
let tempy = viewtriangley2;
viewtrianglex2 = viewtrianglex1;
viewtriangley2 = viewtriangley1;
viewtrianglex1 = tempx;
viewtriangley1 = tempy;
}
}
if(viewtriangley0>viewtriangley1){
if(viewtriangley0>viewtriangley2){
//view triangle 0 has largest y
let tempx = viewtrianglex2;
let tempy = viewtriangley2;
viewtrianglex2 = viewtrianglex0;
viewtriangley2 = viewtriangley0;
viewtrianglex0 = tempx;
viewtriangley0 = tempy;
}else{
//view triangle 2 has largest y (unchanged)
}
}else{
if(viewtriangley1>viewtriangley2){
//view triangle 1 has largest y
let tempx = viewtrianglex2;
let tempy = viewtriangley2;
viewtrianglex2 = viewtrianglex1;
viewtriangley2 = viewtriangley1;
viewtrianglex1 = tempx;
viewtriangley1 = tempy;
}else{
//view triangle 2 has largest y (unchanged)
}
}