Currently working on a three.js globe project that involves adding data layers using geoJSON. The initial layer, representing countries, is displayed as lines thanks to ThreeGeoJSON.
https://i.sstatic.net/nuBkR.png
However, I am aiming to go beyond just outlines and fill the countries with color.
You can view my ongoing project here: http://bl.ocks.org/jhubley/321232d4ccefefcdc53218fd0adccac5
The code for this project can be found here: https://gist.github.com/jhubley/321232d4ccefefcdc53218fd0adccac5
I have attempted to create a new function that would render polygons and multipolygons as meshes instead of lines. Here is the function:
function drawShape(x_values, y_values, z_values, options) {
var shape_geom = new THREE.BoxGeometry();
createVertexForEachPoint(shape_geom, x_values, y_values, z_values);
var shape_material = new THREE.MeshBasicMaterial( {color: 0xffff00 } );
var shape = new THREE.Mesh(shape_geom, shape_material);
scene.add(shape);
clearArrays();
}
Unfortunately, nothing appears when using this function. There are no console errors to provide insight into the issue.
If anyone has suggestions on how I could successfully fill the countries, I would greatly appreciate any advice or guidance.