区块链技术博客
www.b2bchain.cn

Cesium从入门到放弃—三维地下管线的构建求职学习资料

本文介绍了Cesium从入门到放弃—三维地下管线的构建求职学习资料,有助于帮助完成毕业设计以及求职,是一篇很好的资料。

对技术面试,学习经验等有一些体会,在此分享。

Cesium 地下管线开发

  1. XbsjEarth开源SDK
  2. 三维模型制作
  3. 制作地下管线
    于写下了第一篇文章。什么都不说了,直接干!

    XbsjEarth开源SDK

    首先我们要制作三维地下功能,首先要挑选一个合适的平台,好了不扯了,只有Cesium来使用了,然后我们来选取一个封装开源的GIS平台来进行开发,官网在这里bsjEarthSDK,请自己去看哈,开启地表透明的功能代码如下,请看代码:

    var viewer = earth.czm.viewer; //获取Viewer后,使用就和原生Cesium一样了;
    earth.terrainEffect.subSurfaceEnabled = true;//开启地表透明模式;
    earth.terrainEffect.surfaceOpacity = 0.9; //参数是0 ~ 1,间隔是0.1;

    三维模型制作

    这个详见我看了这个

    制作地下管线

    function computeCircle(radius) {
    var positions = [];
    for (var i = 0; i < 360; i++) {
    var radians = Cesium.Math.toRadians(i);
    positions.push(
    new Cesium.Cartesian2(
    radius * Math.cos(radians),
    radius * Math.sin(radians)
    )
    );
    i += 15;//我在这里加了15构建出来的就是一个多边形,如果去掉管横截面就是圆,但是影响渲染
    }
    return positions;
    }

    var redTube = viewer.entities.add({
    polylineVolume: {
    positions: Cesium.Cartesian3.fromDegreesArrayHeights([
    104.0643911540741, 30.644520180014712, -10,
    104.06834473029204, 30.644507622074453, -10,
    104.06835473784035, 30.641167540489427, -10,
    104.0649213449914, 30.641261363072736, -10,
    104.0652037488406, 30.640307797224754, -10,
    104.06842086951482, 30.640165370177698, -10,
    104.0709632404425, 30.640218289417344, -10,
    104.07189450434191, 30.644299282412025, -10,
    104.07064427253918, 30.64452012128316, -10,
    104.07011034321702, 30.64035622435374, -10,
    104.06936621258502, 30.64035013733864, -10,
    104.069595128153, 30.64431128951718, -10,
    104.06491237588305, 30.63936779475631, -10
    ]),
    shape: computeCircle(1),//参数是管线的半径,管线的横截面形状
    material: Cesium.Color.RED,//管线的颜色
    },
    });

    构建地下管线的代码如上,现在我们在合适的敌方放上竖井就行,代码如下:

    //以下是点位,我通过遍历加入
    var shujin = [
    Cesium.Cartesian3.fromDegrees(104.06835312937709, 30.64300192428889, 0),
    Cesium.Cartesian3.fromDegrees(104.06666487703319, 30.64122119501544, 0),
    Cesium.Cartesian3.fromDegrees(104.06577662994573, 30.64028806834443, 0),
    Cesium.Cartesian3.fromDegrees(104.06493923587512, 30.641276636632366, 0),
    Cesium.Cartesian3.fromDegrees(104.0652117128342, 30.640308747653478, 0),
    Cesium.Cartesian3.fromDegrees(104.06936298922272, 30.64036872025258, 0),
    Cesium.Cartesian3.fromDegrees(104.07011596587152, 30.64037593312878, 0)
    ];
    //加载点位
    shujin.forEach(element => {
    viewer.entities.add({
    position: element,
    model: {
    uri: ‘./assets/竖井.gltf’,
    scale: 1400,
    }
    });
    });

    开心,终于写了第一个文章了,好了到此为止,只想好好的虚度光阴。。。。。。
    我是王也!

Cesium 地下管线开发

  1. XbsjEarth开源SDK
  2. 三维模型制作
  3. 制作地下管线
    于写下了第一篇文章。什么都不说了,直接干!

    XbsjEarth开源SDK

    首先我们要制作三维地下功能,首先要挑选一个合适的平台,好了不扯了,只有Cesium来使用了,然后我们来选取一个封装开源的GIS平台来进行开发,官网在这里bsjEarthSDK,请自己去看哈,开启地表透明的功能代码如下,请看代码:

    var viewer = earth.czm.viewer; //获取Viewer后,使用就和原生Cesium一样了;
    earth.terrainEffect.subSurfaceEnabled = true;//开启地表透明模式;
    earth.terrainEffect.surfaceOpacity = 0.9; //参数是0 ~ 1,间隔是0.1;

    三维模型制作

    这个详见我看了这个

    制作地下管线

    function computeCircle(radius) {
    var positions = [];
    for (var i = 0; i < 360; i++) {
    var radians = Cesium.Math.toRadians(i);
    positions.push(
    new Cesium.Cartesian2(
    radius * Math.cos(radians),
    radius * Math.sin(radians)
    )
    );
    i += 15;//我在这里加了15构建出来的就是一个多边形,如果去掉管横截面就是圆,但是影响渲染
    }
    return positions;
    }

    var redTube = viewer.entities.add({
    polylineVolume: {
    positions: Cesium.Cartesian3.fromDegreesArrayHeights([
    104.0643911540741, 30.644520180014712, -10,
    104.06834473029204, 30.644507622074453, -10,
    104.06835473784035, 30.641167540489427, -10,
    104.0649213449914, 30.641261363072736, -10,
    104.0652037488406, 30.640307797224754, -10,
    104.06842086951482, 30.640165370177698, -10,
    104.0709632404425, 30.640218289417344, -10,
    104.07189450434191, 30.644299282412025, -10,
    104.07064427253918, 30.64452012128316, -10,
    104.07011034321702, 30.64035622435374, -10,
    104.06936621258502, 30.64035013733864, -10,
    104.069595128153, 30.64431128951718, -10,
    104.06491237588305, 30.63936779475631, -10
    ]),
    shape: computeCircle(1),//参数是管线的半径,管线的横截面形状
    material: Cesium.Color.RED,//管线的颜色
    },
    });

    构建地下管线的代码如上,现在我们在合适的敌方放上竖井就行,代码如下:

    //以下是点位,我通过遍历加入
    var shujin = [
    Cesium.Cartesian3.fromDegrees(104.06835312937709, 30.64300192428889, 0),
    Cesium.Cartesian3.fromDegrees(104.06666487703319, 30.64122119501544, 0),
    Cesium.Cartesian3.fromDegrees(104.06577662994573, 30.64028806834443, 0),
    Cesium.Cartesian3.fromDegrees(104.06493923587512, 30.641276636632366, 0),
    Cesium.Cartesian3.fromDegrees(104.0652117128342, 30.640308747653478, 0),
    Cesium.Cartesian3.fromDegrees(104.06936298922272, 30.64036872025258, 0),
    Cesium.Cartesian3.fromDegrees(104.07011596587152, 30.64037593312878, 0)
    ];
    //加载点位
    shujin.forEach(element => {
    viewer.entities.add({
    position: element,
    model: {
    uri: ‘./assets/竖井.gltf’,
    scale: 1400,
    }
    });
    });

    开心,终于写了第一个文章了,好了到此为止,只想好好的虚度光阴。。。。。。
    我是王也!

Cesium 地下管线开发

  1. XbsjEarth开源SDK
  2. 三维模型制作
  3. 制作地下管线
    于写下了第一篇文章。什么都不说了,直接干!

    XbsjEarth开源SDK

    首先我们要制作三维地下功能,首先要挑选一个合适的平台,好了不扯了,只有Cesium来使用了,然后我们来选取一个封装开源的GIS平台来进行开发,官网在这里bsjEarthSDK,请自己去看哈,开启地表透明的功能代码如下,请看代码:

    var viewer = earth.czm.viewer; //获取Viewer后,使用就和原生Cesium一样了;
    earth.terrainEffect.subSurfaceEnabled = true;//开启地表透明模式;
    earth.terrainEffect.surfaceOpacity = 0.9; //参数是0 ~ 1,间隔是0.1;

    三维模型制作

    这个详见我看了这个

    制作地下管线

    function computeCircle(radius) {
    var positions = [];
    for (var i = 0; i < 360; i++) {
    var radians = Cesium.Math.toRadians(i);
    positions.push(
    new Cesium.Cartesian2(
    radius * Math.cos(radians),
    radius * Math.sin(radians)
    )
    );
    i += 15;//我在这里加了15构建出来的就是一个多边形,如果去掉管横截面就是圆,但是影响渲染
    }
    return positions;
    }

    var redTube = viewer.entities.add({
    polylineVolume: {
    positions: Cesium.Cartesian3.fromDegreesArrayHeights([
    104.0643911540741, 30.644520180014712, -10,
    104.06834473029204, 30.644507622074453, -10,
    104.06835473784035, 30.641167540489427, -10,
    104.0649213449914, 30.641261363072736, -10,
    104.0652037488406, 30.640307797224754, -10,
    104.06842086951482, 30.640165370177698, -10,
    104.0709632404425, 30.640218289417344, -10,
    104.07189450434191, 30.644299282412025, -10,
    104.07064427253918, 30.64452012128316, -10,
    104.07011034321702, 30.64035622435374, -10,
    104.06936621258502, 30.64035013733864, -10,
    104.069595128153, 30.64431128951718, -10,
    104.06491237588305, 30.63936779475631, -10
    ]),
    shape: computeCircle(1),//参数是管线的半径,管线的横截面形状
    material: Cesium.Color.RED,//管线的颜色
    },
    });

    构建地下管线的代码如上,现在我们在合适的敌方放上竖井就行,代码如下:

    //以下是点位,我通过遍历加入
    var shujin = [
    Cesium.Cartesian3.fromDegrees(104.06835312937709, 30.64300192428889, 0),
    Cesium.Cartesian3.fromDegrees(104.06666487703319, 30.64122119501544, 0),
    Cesium.Cartesian3.fromDegrees(104.06577662994573, 30.64028806834443, 0),
    Cesium.Cartesian3.fromDegrees(104.06493923587512, 30.641276636632366, 0),
    Cesium.Cartesian3.fromDegrees(104.0652117128342, 30.640308747653478, 0),
    Cesium.Cartesian3.fromDegrees(104.06936298922272, 30.64036872025258, 0),
    Cesium.Cartesian3.fromDegrees(104.07011596587152, 30.64037593312878, 0)
    ];
    //加载点位
    shujin.forEach(element => {
    viewer.entities.add({
    position: element,
    model: {
    uri: ‘./assets/竖井.gltf’,
    scale: 1400,
    }
    });
    });

    开心,终于写了第一个文章了,好了到此为止,只想好好的虚度光阴。。。。。。
    我是王也!

部分转自互联网,侵权删除联系

赞(0) 打赏
部分文章转自网络,侵权联系删除b2bchain区块链学习技术社区 » Cesium从入门到放弃—三维地下管线的构建求职学习资料
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

b2b链

联系我们联系我们