I want to use library Globe.GL in combination with Three.js, but i am not sure how to connect them. I want custom orbit controls but i do not have luck with solution.
import * as THREE from 'https://cdn.jsdelivr.net/npm/three@0.124.0/build/three.module.js';
import { GLTFLoader } from 'https://cdn.jsdelivr.net/npm/three@0.124.0/examples/jsm/loaders/GLTFLoader.js'
import { OrbitControls } from 'https://cdn.jsdelivr.net/npm/three@0.124.0/examples/jsm/controls/OrbitControls.js';
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 100);
camera.position.z = 5;
const renderer = new THREE.WebGLRenderer({ alpha: true, antialias: true});
renderer.setSize(window.innerWidth, window.innerHeight);
document.getElementById("globeViz").appendChild(renderer.domElement);
//const controls = new OrbitControls(camera, renderer.domElement);
let world;
fetch('countries.geojson').then(res => res.json()).then(countries =>
{
world = Globe()
.globeImageUrl('earth-dark.png')
.backgroundImageUrl('night-sky2.png')
.showAtmosphere(false)
.atmosphereColor(`#00ff0d`)
.hexPolygonsData(countries.features)
.hexPolygonResolution(3)
.hexPolygonMargin(0.2)
.hexPolygonColor(() => `#8E8E8E`)
.hexPolygonLabel(({ properties: d }) => `
<b>${d.ADMIN} (${d.ISO_A2})</b> <br />
Population: <i>${d.POP_EST}</i>
`)
(document.getElementById('globeViz'))
} );
window.addEventListener('resize', () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
render();
}, false);
var animate = function() {
requestAnimationFrame(animate);
//console.log(world);
render();
};
function render() {
renderer.render(scene, camera);
}
animate();