Skip to content

Commit 3fd3ded

Browse files
authored
Merge pull request #478 from EarthyScience/jp/sphere-extent-fix
Extent logic should apply correctly
2 parents 3d6d7db + 46c64b8 commit 3fd3ded

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/components/textures/shaders/sphereFrag.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ uniform float nanAlpha;
2626
vec2 giveUV(vec3 position){
2727
vec3 n = normalize(position);
2828
float latitude = asin(n.y);
29-
float longitude = atan(n.z, n.x);
29+
float longitude = -atan(n.z, n.x);
3030

3131
latitude = (latitude - latBounds.x)/(latBounds.y - latBounds.x);
3232
longitude = (longitude - lonBounds.x)/(lonBounds.y - lonBounds.x);
3333

34-
return vec2(1.-longitude, latitude);
34+
return vec2(longitude, latitude);
3535
}
3636

3737
bool isValid(vec2 sampleCoord){

src/components/textures/shaders/sphereVertex.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ uniform float animateProg;
1212
vec2 giveUV(vec3 position){
1313
vec3 n = normalize(position);
1414
float latitude = asin(n.y);
15-
float longitude = atan(n.z, n.x);
15+
float longitude = -atan(n.z, n.x);
1616
latitude = (latitude - latBounds.x)/(latBounds.y - latBounds.x);
1717
longitude = (longitude - lonBounds.x)/(lonBounds.y - lonBounds.x);
1818

19-
return vec2(1.-longitude, latitude);
19+
return vec2(longitude, latitude);
2020
}
2121

2222
float sample1(vec3 p, int index) { // Shader doesn't support dynamic indexing so we gotta use switching

src/components/textures/shaders/sphereVertexFlat.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ uniform vec2 lonBounds;
1111
vec2 giveUV(vec3 position){
1212
vec3 n = normalize(position);
1313
float latitude = asin(n.y);
14-
float longitude = atan(n.z, n.x);
14+
float longitude = -atan(n.z, n.x);
1515
latitude = (latitude - latBounds.x)/(latBounds.y - latBounds.x);
1616
longitude = (longitude - lonBounds.x)/(lonBounds.y - lonBounds.x);
1717

18-
return vec2(1.-longitude, latitude);
18+
return vec2(longitude, latitude);
1919
}
2020

2121
float sample1(vec2 p, int index) { // Shader doesn't support dynamic indexing so we gotta use switching

src/utils/HelperFuncs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as THREE from 'three'
33
import { useGlobalStore, usePlotStore, useZarrStore, useCacheStore } from './GlobalStates';
44
import { decompressSync } from 'fflate';
55
import * as zarr from 'zarrita';
6-
import { GetStore, copyChunkToArray } from '@/components/zarr/ZarrLoaderLRU';
6+
import { copyChunkToArray } from '@/components/zarr/ZarrLoaderLRU';
77
export function parseTimeUnit(units: string | undefined): [number, number] {
88
if (units === "Default"){
99
return [1, 0];

0 commit comments

Comments
 (0)