I am currently working on a project where I have a json file containing country borders. My goal is to use this data to build a map in three.js, similar to the example provided by this link.
I want each cylinder on the map to be positioned according to its respective country, like shown in this image:
https://i.sstatic.net/IbN1k.png
Take a look at the snippet below. At the moment, I am calculating the center of the bounding box for each geometry, which is effective but the cylinders are not pointing outwards as desired in the image. I've attempted using lookAt() without success. There's also a for loop that rotates the countries and cylinders, but they're not moving correctly (feel free to uncomment it and test).
How can I adjust the positioning of the cylinders to be accurate?
<!DOCTYPE html>
... (the rest of the HTML code provided in the original text) ...
</body>