目录

Geo3D建筑材质切换屋顶纹理

Geo3D建筑材质切换+屋顶纹理

一、简介

基于Threejs开发封装建筑渲染管线,利用简单二维建筑矢量面轮廓程序化生成3D建筑,支持材质一键切换,支持多样化建筑墙面材质和屋顶材质,支持建筑透明,支持地形高程适配,支持按空间范围裁剪挖洞等。

二、效果

https://i-blog.csdnimg.cn/direct/2627177b8ee245018cf2f36813ba6adf.gif

https://i-blog.csdnimg.cn/direct/da1269c2074048eb8889d64995f6c890.png

https://i-blog.csdnimg.cn/direct/ccbaafc0c0b24a0f9323ab0c9836a83d.png

https://i-blog.csdnimg.cn/direct/c2e3e1e029b54412ad0244585bf112f2.png

三、代码

///建筑///
const buildingPipline = new Geo3D.BuildingPipline({
    themeName: Geo3D.ThemeName.Theme_Realistic,
    pbfUrl: map.staticPath + '/static/' + 'shijingshan.bpf',
    heightProp: 'height',
    bottomHeight: 67,
    extent: extentCoords as Geo3D.Point[],
    exclude: excludeCoords as Geo3D.Point[],
    scene: scene
})
buildingPipline.add();

GUI//
const vm = {
    simpleTheme: () => {
        Geo3D.ThemeUtil.setTheme(Geo3D.ThemeName.Theme_Simple);
    },
    realTheme: () => {
        Geo3D.ThemeUtil.setTheme(Geo3D.ThemeName.Theme_Realistic);
    },
};
const gui = new GUI();
gui.domElement.style.transform = 'scale(1.5)';
gui.domElement.style.transformOrigin = 'right top';
//@ts-ignore
gui.add(vm, "simpleTheme").name("白模");
//@ts-ignore
gui.add(vm, "realTheme").name("实景");