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();
相关推荐
桃花键神12 小时前
从传统到智能:3D 建模流程的演进与 AI 趋势 —— 以 Blender 为例
人工智能·3d·blender
东风西巷15 小时前
全能的3D创作平台,Blender(免费开源3D建模工具)
学习·3d·开源·blender·软件需求
查里王21 小时前
AI 3D 生成工具知识库:当前产品格局与测评总结
人工智能·3d
Hello123网站1 天前
Champ-基于3D的人物图像到动画视频生成框架
3d·ai工具
Magnum Lehar1 天前
3d wpf游戏引擎的导入文件功能c++的.h实现
3d·游戏引擎·wpf
博图光电1 天前
Motioncam Color S + 蓝激光:3D 视觉革新,重塑工业与科研应用新格局
3d
新启航光学频率梳1 天前
[新启航]深孔加工尺寸精度检测方法 - 激光频率梳 3D 轮廓测量
科技·3d·制造
eqwaak01 天前
Matplotlib 动画显示进阶:交互式控制、3D 动画与未来趋势
python·tcp/ip·3d·语言模型·matplotlib
LabVIEW开发1 天前
LabVIEW加载 STL 模型至 3D 场景 源码见附件
3d·labview·labview知识·labview功能·labview程序
嘀咕博客2 天前
Stable Virtual Camera:Stability AI等推出的AI模型 ,2D图像轻松转3D视频
人工智能·3d·音视频·ai工具