Looking to create a pipe-like structure based on geographic coordinates, the data is in JSON format with latitude and longitude values. Here's an example of how it looks:
[
{
"LATITUDE": "55.10185525",
"LONGITUDE": "-76.4629527"
},
{
"LATITUDE": "55.10181625",
"LONGITUDE": "-76.4629827"
},
{
"LATITUDE": "55.10185525",
"LONGITUDE": "-76.4329527"
},
{
"LATITUDE": "55.10181625",
"LONGITUDE": "-76.4629827"
},
{
"LATITUDE": "56.10185525",
"LONGITUDE": "-77.4629527"
}
I initially tried converting these coordinates into Three.js Vector3 using this method:
function convertLatLonToVec3(lat,lon) {
lat = lat * Math.PI / 180.0;
lon = -lon * Math.PI / 180.0;
return new THREE.Vector3(
Math.cos(lat) * Math.cos(lon),
Math.sin(lat),
Math.cos(lat) * Math.sin(lon));
This method did not work effectively for me. Are there any alternative ways to implement latitude and longitude on a 3D plane?