@pirireis/webglobeplugins 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@ void main() {
|
|
|
39
39
|
float angle = pad_angle - 1.5707963267948966192313216916398;
|
|
40
40
|
float radius_ = radius - (pad_range * odd);
|
|
41
41
|
|
|
42
|
-
if (
|
|
42
|
+
if (is3D){
|
|
43
43
|
gl_Position = projection * view * vec4(
|
|
44
44
|
circleLimpFromLongLatRadCenterCartesian3D( center, radius_, angle) - translate, 1.0);
|
|
45
45
|
v_limp = vec2(0.0, 0.0);
|
|
@@ -99,11 +99,11 @@ export const circleLimpFromLongLatRadCenterCartesian3D = R + `
|
|
|
99
99
|
vec3 circleLimpFromLongLatRadCenterCartesian3D( vec2 center, float radius, float angle) {
|
|
100
100
|
vec3 geoW = longLatRadToCartesian3D(center);
|
|
101
101
|
vec3 normal = normalize(geoW);
|
|
102
|
-
vec3 tangent1 = cross(normal, vec3(0.0, 0.0, 1.0));
|
|
103
|
-
if ( length(tangent1) < 0.1 ){ tangent1 = cross(normal, vec3(0.0, 1.0, 0.0)); }
|
|
102
|
+
vec3 tangent1 = cross(normal, vec3(0.0, 0.0, -1.0));
|
|
103
|
+
if ( length(tangent1) < 0.1 ){ tangent1 = cross(normal, vec3(0.0, -1.0, 0.0)); }
|
|
104
104
|
tangent1 = normalize(tangent1);
|
|
105
105
|
// rotate tangent with given angle
|
|
106
|
-
tangent1 =
|
|
106
|
+
tangent1 = cos(angle) * tangent1 - sin(angle) * cross(normal, tangent1);
|
|
107
107
|
return (geoW * cos(radius/R))+ tangent1 * radius / 1000.0;
|
|
108
108
|
}
|
|
109
109
|
`;
|
|
@@ -113,12 +113,12 @@ export const circleLimpFromLongLatRadCenterMercatorRealDistance = `
|
|
|
113
113
|
vec2 circleLimpFromLongLatRadCenterMercatorRealDistance(vec2 center, float radius, float angle){
|
|
114
114
|
|
|
115
115
|
float radius_radian = radius / R;
|
|
116
|
-
float lat = center.y
|
|
116
|
+
float lat = center.y - radius_radian * sin(angle);
|
|
117
117
|
|
|
118
118
|
float scale = 1.0/abs( cos( lat ) );
|
|
119
119
|
vec2 center_ = longLatRadToMercator(center);
|
|
120
|
-
float x = center_.x +
|
|
121
|
-
float y = center_.y
|
|
120
|
+
float x = center_.x + scale * radius * cos(angle);
|
|
121
|
+
float y = center_.y - scale * radius * sin(angle);
|
|
122
122
|
return vec2(x, y);
|
|
123
123
|
}
|
|
124
124
|
`;
|
|
@@ -127,7 +127,7 @@ vec2 circleLimpFromLongLatRadCenterMercatorRealDistance(vec2 center, float radiu
|
|
|
127
127
|
export const circleLimpFromLongLatRadCenterMercatorCompass = `
|
|
128
128
|
vec2 circleLimpFromLongLatRadCenterMercatorCompass(vec2 center, float radius, float angle){
|
|
129
129
|
vec2 center_ = longLatRadToMercator(center);
|
|
130
|
-
float y = sin(angle) * radius + center_.y;
|
|
130
|
+
float y = -sin(angle) * radius + center_.y;
|
|
131
131
|
float x = cos(angle) * radius + center_.x;
|
|
132
132
|
return vec2(x, y);
|
|
133
133
|
}`;
|