forked from burritojustice/xyz_space_invader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
globe-points.yaml
24 lines (22 loc) · 1012 Bytes
/
globe-points.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import: globe.yaml
styles:
projection_points:
mix: stereo-points
stereo-points:
mix: stereo
shaders:
blocks:
position: |
// lat, lon, centerlat, and centerlon are defined in globe.yaml
// if the point goes past the horizon
if (haversine(rad2deg(lat), rad2deg(lon), rad2deg(centerlat), rad2deg(centerlon)) > EARTH_RADIUS * PI / 2.0) {
// clip the point
position.xy = vec2(3.402823466e+38);
} else {
// bend map into globe
position.xyz = latLongToVector3(lat, lon, 2.) * EARTH_RADIUS;
// rotate globe with map navigation
// 90 degrees in radians = 1.5708
position.xyz *= globe_rotateY3D((-centerlon - 1.5708));
position.xyz *= globe_rotateX3D(-(centerlat));
}