zoukankan      html  css  js  c++  java
  • cesium3dtiles位置改变

    cesium偏移3dtiles高度
    var heightOffset = 20.0; var boundingSphere = tileset.boundingSphere; var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center); var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset); var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);


    cesium设置3dtiles位置朝向
    var targetPosition = Cesium.Cartesian3.fromDegrees(121.46175, 31.40674, 0);
    var headingPitchRoll = new Cesium.HeadingPitchRoll(0, 0, 0);
    var modelMatrix = new Cesium.Matrix4();
    Cesium.Transforms.headingPitchRollToFixedFrame(targetPosition, headingPitchRoll, Cesium.Ellipsoid.WGS84, Cesium.Transforms.eastNorthUpToFixedFrame, modelMatrix);
    tileset.modelMatrix =modelMatrix;
    viewer.camera.flyTo({
    destination:tileset.boundingSphere.center
    });
     
    cesium添加实体并设置位置朝向

    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;

     



  • 相关阅读:
    MFC通过ODBC连接Mysql程序
    MFC下DLL编程(图解)
    INI文件的写入与读取
    如何在MFC中启动其它的(.exe)可执行文件
    [VC++]用CTime类得到当前日期、时间、星期,格式化(详细讲解)
    OutputDebugString输出调试信息到debugtrack
    MFC添加背景图片三种方法
    在MFC对话框中添加状态栏
    MFC 窗体背景图片设置
    MFC实现为窗体添加的背景图片
  • 原文地址:https://www.cnblogs.com/943711466qq/p/9535347.html
Copyright © 2011-2022 走看看