gpt4 book ai didi

three.js - 如何将在 mapbox 上的 Threejs 构建放到真正的位置

转载 作者:行者123 更新时间:2023-12-01 01:50:03 25 4
gpt4 key购买 nike

目前我已经加载了埃菲尔铁塔 obj 文件,并使用 Threejs 渲染它,但是我如何将建筑物放在 map 上到它在现实世界中的位置。我使用 mapgox-gl-js 来处理 map 问题,因为它在 3d map 上很方便。
result

style: {
"version": 8,
"sources": {
"satellite": {
"type": "raster",
"url": "mapbox://mapbox.satellite",
"tileSize": 256
},
"canvas": {
type: 'canvas',
canvas: 'idOfMyHTMLCanvas',
// animate: true,
coordinates: [
[-74.02204952394804, 40.706782422418456],
[-73.99115047610259, 40.706782422418456],
[-73.99115047610259, 40.72021689994298],
[-74.02204952394804, 40.72021689994298]
],
contextType: 'webgl'
}
},
"layers": [{
"id": "satellite",
"type": "raster",
"source": "satellite"
}, {
"id": "video",
"type": "raster",
"source": "canvas"
}]
}

感谢您的任何帮助。

最佳答案

您可能想查看 Threebox ,旨在将 Three.js 场景图与 Mapbox GL JS map 同步。

关于three.js - 如何将在 mapbox 上的 Threejs 构建放到真正的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46701072/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com