diff --git a/src/components/map/mapbox/MapBoxMap.js b/src/components/map/mapbox/MapBoxMap.js index ecf92b6..b091701 100644 --- a/src/components/map/mapbox/MapBoxMap.js +++ b/src/components/map/mapbox/MapBoxMap.js @@ -33,7 +33,7 @@ import * as THREE from 'three'; * drone-1.glb : 드론 3D Model * out.glb : UAM 3D Model */ -import uamGltf from './models/drone-1.glb'; +import uamGltf from './models/out.glb'; import uamVertipad from './models/scene.glb'; const buffer = [ @@ -170,17 +170,22 @@ const buffer = [ ]; const ghlfkd = [ - [126.6243464, 37.5642352], - [126.62469825999999, 37.565102957777775], - [126.62505012, 37.56597071555556], - [126.62540197999999, 37.566838473333334], - [126.62575384, 37.56770623111111], - [126.6261057, 37.568573988888886], - [126.62645755999999, 37.56944174666667], - [126.62680942, 37.570309504444445], - [126.62716128, 37.57117726222222], - [126.62751314, 37.572045020000004], - [126.627865, 37.57291277777778] + [126.6240164, 37.5643352, 0], + [126.6240164, 37.5643352, 30], + [126.6240164, 37.5643352, 60], + [126.6240164, 37.5643352, 90], + [126.6240164, 37.5643352, 120], + [126.6240164, 37.5643352, 150], + [126.62469825999999, 37.565102957777775, 150], + [126.62505012, 37.56597071555556, 150], + [126.62540197999999, 37.566838473333334, 150], + [126.62575384, 37.56770623111111, 150], + [126.6261057, 37.568573988888886, 150], + [126.62645755999999, 37.56944174666667, 150], + [126.62680942, 37.570309504444445, 150], + [126.62716128, 37.57117726222222, 150], + [126.62751314, 37.572045020000004, 150], + [126.627865, 37.57291277777778, 150] ]; let gridCoords = []; let altitudeMarker = []; @@ -603,19 +608,23 @@ export default function MapBoxMap() { }; tb.loadObj(options, model => { - let longitude = 126.6243464; // 3D Model 경도 값 - const latitude = 37.5642352; // 3D Model 위도 값 + const longitude = 126.6240164; // 3D Model 경도 값 + const latitude = 37.5643352; // 3D Model 위도 값 let hei = 150; // 3D Model 높이 값 - model.setCoords([longitude, latitude, hei]); // 3D Model 위치 지정 - model.setRotation({ x: 0, y: 0, z: 90 }); // 3D Model 방향 각도 지정 + model.setCoords([longitude, latitude, 0]); // 3D Model 위치 지정 + model.setRotation({ x: 0, y: 0, z: 250 }); // 3D Model 방향 각도 지정 tb.add(model); let index = 0; // 0.5초마다 모델의 위치를 변경 setInterval(() => { // longitude += 0.001; // 경도를 약간 증가시킵니다. - model.setCoords([ghlfkd[index][0], ghlfkd[index][1], hei]); + model.setCoords([ + ghlfkd[index][0], + ghlfkd[index][1], + ghlfkd[index][2] + ]); index++; if (index === ghlfkd.length) { // 배열의 끝에 도달하면 인덱스를 0으로 재설정하고 계속 반복합니다. @@ -651,8 +660,8 @@ export default function MapBoxMap() { } }); const uamRouteArr = [ - ...uamRoute.features[0].geometry.coordinates, - [126.8045935, 37.56016, 150] + [126.62344452564807, 37.56537917231002], + [126.8045935, 37.56016] ]; for (let i = 0; i < uamRouteArr.length; i++) { @@ -665,7 +674,7 @@ export default function MapBoxMap() { const options = { obj: uamVertipad, // 3D Model 파일 type: 'gltf', // 3D Model 확장자 타입 - scale: { x: 0, y: 0, z: 0 }, // 3D Model 크기 값 + scale: { x: 10, y: 10, z: 10 }, // 3D Model 크기 값 units: 'meters', // 높이 단위 rotation: { x: 90, y: -90, z: 0 } // // 3D Model 방향 각도 초기 값 }; @@ -675,7 +684,7 @@ export default function MapBoxMap() { let hei = 0; // 3D Model 높이 값 model.setCoords([longitude, latitude, hei]); // 3D Model 위치 지정 - model.setRotation({ x: 0, y: 0, z: 90 }); // 3D Model 방향 각도 지정 + model.setRotation({ x: 0, y: 0, z: 250 }); // 3D Model 방향 각도 지정 tb.add(model); }); },