zoukankan      html  css  js  c++  java
  • cesium建模&加载3dsmax模型

    cesium可以建模吗?当然可以,但是。。。

    建的模型比较单调乏味,比如建一个正方体,建一个圆球,如果是复杂一些的模型,例如一个tube(管道),一个圆环。。。。那该怎么办?cesium有没有提供这样的函数供我们使用呢?例如我们常见的。。。飞机模型   使用threejs建模呢?https://www.cnblogs.com/2008nmj/p/14886567.html

    var viewer = new Cesium.Viewer("cesiumContainer", {
      infoBox: false,
      selectionIndicator: false,
      shadows: true,
      shouldAnimate: true,
    });
    
    function createModel(url, height) {
      viewer.entities.removeAll();
    
      var position = Cesium.Cartesian3.fromDegrees(
        -123.0744619,
        44.0503706,
        height
      );
      var heading = Cesium.Math.toRadians(135);
      var pitch = 0;
      var roll = 0;
      var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
      var orientation = Cesium.Transforms.headingPitchRollQuaternion(
        position,
        hpr
      );
    
      var entity = viewer.entities.add({
        name: url,
        position: position,
        orientation: orientation,
        model: {
          uri: url,
          minimumPixelSize: 128,
          maximumScale: 20000,
        },
      });
      viewer.trackedEntity = entity;
    }
    
    var options = [
      {
        text: "Aircraft",
        onselect: function () {
          createModel(
            "../SampleData/models/CesiumAir/Cesium_Air.glb",
            5000.0
          );
        },
      },
      {
        text: "Drone",
        onselect: function () {
          createModel(
            "../SampleData/models/CesiumDrone/CesiumDrone.glb",
            150.0
          );
        },
      },
      {
        text: "Ground Vehicle",
        onselect: function () {
          createModel(
            "../SampleData/models/GroundVehicle/GroundVehicle.glb",
            0
          );
        },
      },
      {
        text: "Hot Air Balloon",
        onselect: function () {
          createModel(
            "../SampleData/models/CesiumBalloon/CesiumBalloon.glb",
            1000.0
          );
        },
      },
      {
        text: "Milk Truck",
        onselect: function () {
          createModel(
            "../SampleData/models/CesiumMilkTruck/CesiumMilkTruck.glb",
            0
          );
        },
      },
      {
        text: "Skinned Character",
        onselect: function () {
          createModel(
            "../SampleData/models/CesiumMan/Cesium_Man.glb",
            0
          );
        },
      },
      {
        text: "Draco Compressed Model",
        onselect: function () {
          createModel(
            "../SampleData/models/DracoCompressed/CesiumMilkTruck.gltf",
            0
          );
        },
      },
    ];
    
    Sandcastle.addToolbarMenu(options);
  • 相关阅读:
    OCP-1Z0-053-V12.02-285题
    OCP-1Z0-053-V12.02-281题
    今天博客抽风了,我也抽风了
    OCP-1Z0-053-V12.02-278题
    OCP-1Z0-053-V12.02-271题
    OCP-1Z0-053-V12.02-269题
    OCP-1Z0-053-V12.02-256题
    OCP-1Z0-053-V12.02-249题
    OCP-1Z0-053-V12.02-248题
    OCP-1Z0-053-V12.02-244题
  • 原文地址:https://www.cnblogs.com/2008nmj/p/14927645.html
Copyright © 2011-2022 走看看