Geo3D城市引擎大规模建筑植被渲染

TypeScript 复制代码
import * as Geo3D from "../src";
import InitHelper from "./InitHelper";
//3D场景初始化
const sceneControl = InitHelper.init3D();
const container = document.querySelector("#map") as HTMLElement;
container && sceneControl.render(container);
const { scene, camera, renderer } = sceneControl;
const control = InitHelper._createControls(camera, container);
InitHelper.loadGltf(scene, 1);
renderer.shadowMap.type = PCFSoftShadowMap;
const light = InitHelper.addLight(scene, new Vector3(5000, 2000, 5000));
light.visible = true

//插件初始化
const centerGeo = new Vector3(116.185600, 39.896326, 0);
const imageryLayers = new Geo3D.ImageryLayers()
const tdtImageryLayer = new Geo3D.TDTImageryLayer({
    token: 'b832b97649334239ascbb0919148c548b669ba',
})
const tdtImageryLayer2 = new Geo3D.TDTImageryLayer({
    token: 'b832b9764939cbfeeb0919148c548b669ba',
    style: 'cva_w',
})
imageryLayers.add(tdtImageryLayer);
imageryLayers.add(tdtImageryLayer2);
const map = new Geo3D.Map({
    threeModule: {
        scene, camera, renderer, control
    },
    center: centerGeo,
    useEarth: false,
    imageryLayers: imageryLayers,
    // terrainLayer: new Geo3D.TerrainLayer({
    //     maxLevel: 14,
    //     url: globalConfig.terrain_beijing
    // })
})

map.addEventListener(Geo3D.MapEventType.ready, () => {
    const mask = document.getElementById('mask');
    mask!.style.display = 'none';
});

function getFormatExtent(coords) {
    const results: Geo3D.Point[] = [];
    for (let index = 0; index < coords.length; index++) {
        const pointCoord = coords[index];
        const coord3DXYZ = Geo3D.CoordUtil.LonLatTo3DXYZ(pointCoord[0], pointCoord[1], 0);
        results.push([coord3DXYZ.x, coord3DXYZ.z]);
    }
    return results;
}
const minlon1 = 116.182892;
const minlat1 = 39.894874;
const maxlon1 = 116.188174;
const maxlat1 = 39.897445;
const excludeCoords = [
    [minlon1, minlat1],
    [maxlon1, minlat1],
    [maxlon1, maxlat1],
    [minlon1, maxlat1],
    [minlon1, minlat1]
]
const excludeExtent = getFormatExtent(excludeCoords);
// 116.182944, 39.901406
const minlon = 116.162944;
const minlat = 39.881406;
const maxlon = 116.202944;
const maxlat = 39.921406;
const extentCoords = [
    [minlon, minlat],
    [maxlon, minlat],
    [maxlon, maxlat],
    [minlon, maxlat],
    [minlon, minlat]
]
const exttent = getFormatExtent(extentCoords);
const treePipline = new Geo3D.TreeManager.TreePipeline({
    imageryLayer: tdtImageryLayer,
    extent: exttent,
    exclude: excludeExtent,
    scene: scene,
    camera: camera
})
treePipline.add();

//
const buildingPipline = new Geo3D.BuildingPipline({
    pbfUrl: './static/shijingshan.bpf',
    scene: scene
})
buildingPipline.loadBuilding();
相关推荐
子燕若水6 小时前
daz3d + PBRSkin (MDL)+ SSS
3d
灏瀚星空9 小时前
Python数学可视化:3D参数曲面与隐式曲面绘制技术
开发语言·python·3d
高德技术10 小时前
全流程开源!高德3D贴图生成系统,白模一键生成真实感纹理贴图
3d·贴图
daifgFuture2 天前
Android 3D球形水平圆形旋转,旋转动态更换图片
android·3d
牧子川2 天前
【论文解读】CVPR2023 PoseFormerV2:3D人体姿态估计(附论文地址)
3d·cvpr2023·poseformerv2
资深设备全生命周期管理2 天前
优化版本,增加3D 视觉 查看前面的记录
3d
m0_748250742 天前
GPUCUDA 发展编年史:从 3D 渲染到 AI 大模型时代(上)
人工智能·3d
少林6593 天前
谷歌地图高清卫星地图2026中文版下载|谷歌地图3D卫星高清版 V7.3.6.9796 最新免费版下载 - 前端工具导航
3d·谷歌地图
LeonDL1683 天前
HALCON 深度学习训练 3D 图像的几种方式优缺点
人工智能·python·深度学习·3d·halcon·halcon训练3d图像·深度学习训练3d图像
xhload3d4 天前
图扑软件 | 带你体验 Low Poly 卡通三维世界
物联网·3d·智慧城市·html5·webgl·数字孪生·可视化·工业互联网·三维建模·工控·轻量化·中国风·卡通动画·写实风格·科技风·low poly