vasturiano / three-globe

WebGL Globe Data Visualization as a ThreeJS reusable 3D object
https://vasturiano.github.io/three-globe/example/links/
MIT License
1.19k stars 145 forks source link

Is it possible locate hexBinPoints by coordinates (not random position like now)? #68

Open RedirexStudio opened 1 year ago

RedirexStudio commented 1 year ago

Is it possible locate hexBinPoints by coordinates (not random position like now)?

vasturiano commented 1 year ago

@RedirexStudio could you elaborate a bit on your question? It's not overly clear what you mean by random position.

RedirexStudio commented 1 year ago

@RedirexStudio could you elaborate a bit on your question? It's not overly clear what you mean by random position.

I mean you have hexbin model (https://vasturiano.github.io/three-globe/example/hexbin/), and this model put points around sphere by random like

const N = 6000; const gData = [...Array(N).keys()].map(() => ({ lat: (Math.random() - 0.5) * 180 * 0.9, lng: (Math.random() - 0.5) * 360 / 1 }));

But i want to create model like hexed-polygons (https://vasturiano.github.io/three-globe/example/hexed-polygons/) in borders of countries and use hexbin points like in previous example instead of polygons.

vasturiano commented 1 year ago

@RedirexStudio the coordinates of the hex bin points are determined by the H3 system. It varies only by resolution level, otherwise they're located always in the same spot. Determined by a pre-computed hexagonal tesselation of the sphere surface.