-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
153 lines (136 loc) · 3.23 KB
/
index.html
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<html>
<head>
<title>Satellite TLE Viewer</title>
<script id="earth-vs" type="x-shader/x-vertex">
attribute vec3 a_position;
attribute vec2 a_uv;
varying vec2 v_uv;
varying float v_light;
uniform mat4 u_projection;
uniform mat4 u_view;
void main(void)
{
v_uv = a_uv;
mat3 v3 = mat3(u_view);
v_light = dot(normalize(mat3(u_view) * a_position), vec3(0,0,1));
gl_Position = u_projection * u_view * vec4(a_position,1);
}
</script>
<script id="earth-fs" type="x-shader/x-fragment">
precision mediump float;
varying vec2 v_uv;
varying float v_light;
uniform sampler2D u_texture;
void main(void)
{
float sample = texture2D(u_texture, v_uv).r;
vec4 land = vec4(vec3(0.15, 0.375, 0.15) * v_light, 1.0);
vec4 sea = vec4(vec3(0.05, 0.15, 0.25) * v_light, 1.0);
gl_FragColor = sea + (land-sea)*sample;
}
</script>
<script id="orbit-vs" type="x-shader/x-vertex">
attribute vec3 a_position;
attribute float a_M;
attribute float a_mm;
varying float v_M;
varying float v_mm;
uniform mat4 u_projection;
uniform mat4 u_view;
void main(void)
{
v_M = a_M;
v_mm = a_mm;
gl_Position = u_projection * u_view * vec4(a_position,1);
}
</script>
<script id="orbit-fs" type="x-shader/x-fragment">
precision mediump float;
varying float v_M;
varying float v_mm;
uniform float u_time;
uniform vec3 u_color;
uniform float u_highlight;
uniform float u_offset;
void main(void)
{
float mp = (u_time / (1000.0*24.0*60.0*60.0)) * v_mm;
float m = 1.0-fract(v_M/360.0 + mp + 1000.0);
float m1 = pow(m,50.0);
float m2 = pow(m,200.0) * u_highlight;
gl_FragColor = vec4(u_color, m1 * (1.0-u_offset) + u_offset) + vec4(1,1,1,1)*m2;
}
</script>
<script type="text/javascript" src="data0.js"></script>
<script type="text/javascript" src="satellite.js"></script>
<style type="text/css">
body {
margin: 0px;
padding: 0px;
background-color: black;
color: white;
font-family: monospace;
}
a:link {
color: yellow;
}
a:visited {
color: yellow;
}
a:active {
color: yellow;
}
canvas {
width: 100%;
height: 100%;
}
#gear {
position: absolute;
top: 0;
left: 0;
border: 1px solid black;
background-color: #002010;
opacity: 0.8;
padding: 5px;
}
#gear_expand {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
cursor: pointer;
}
.hide {
display: none;
}
#credits {
position: absolute;
left: 0;
bottom: 0;
border: 0;
padding: 5px;
}
</style>
</head>
<body>
<div id="gear">
<span id="gear_expand">filter [+]</span>
<div id="gear_body" class="hide">
<br/>
<div id="gear_filters">
</div>
<div id="gear_footer">
</div>
</div>
</div>
<div id="credits">
Drag to rotate.<br/>
Use mouse wheel to zoom.<br/>
<strong>Data from <a href="http://celestrak.com" target="_blank">CelesTrak</a></strong>
</div>
<canvas id="screen"></canvas>
<a href="https://github.com/sqaxomonophonen/satellite"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/52760788cde945287fbb584134c4cbc2bc36f904/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f77686974655f6666666666662e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png"></a>
</body>
</html>