博客
关于我
cesium官方教程12学习
阅读量:796 次
发布时间:2019-03-25

本文共 1361 字,大约阅读时间需要 4 分钟。

Cesium场景配置示例

Cesium场景配置示例

Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjOWM3MzYxZS0xNDg5LTRhYzgtOTE3ZS1hMTgyNmFmNzY5ZDIiLCJpZCI6MTYwNTYsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1Njk0NzMxMjl9.QT-UwdXK6VZyYMhtznEEIru0AEQEzMPxDlxQw96mTlA'

var viewer = new Cesium.Viewer('cesiumContainer');

//GLSL代码创建材质

/* function czm_materialInput() { ... */

创建自定义材质来处理物质输入。

var theFabric = { ... }

定义了一个新的材料类型,该材料由反衬和反光等map组成,可用于创建复杂的物质效果。

var modelMatrix_car = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-75.62898254394531, 40.02804946899414, 0.0));

将模型矩阵转换为东北向上固定帧的坐标系。

var model_car = viewer.scene.primitives.add(Cesium.Model.fromGltf({ url : 'http://localhost:8080/apps/sampleData/models/GroundVehicle/GroundVehicle.glb', modelMatrix : modelMatrix_car, scale : 200000.0 }));

从GLTF文件中加载汽车模型,并应用自定义的材质设置和场景变换。

model_car.material = new Cesium.Material({ fabric : theFabric });

转载地址:http://bnxuk.baihongyu.com/

你可能感兴趣的文章
python | pdfminer,一个神奇的 关于PDF 文件的 Python 库!
查看>>
python | pendulum,一个有趣的 日期和时间 Python 库!
查看>>
python | pluginbase,一个神奇的 关于插件框架 的Python 库!
查看>>
python | ply,一个无敌的 词法和语法分析工具 的Python 库!
查看>>
python | py2exe,一个超酷的 Python 库!
查看>>
python | pyautogui,一个超酷的 Python 库!
查看>>
python | pybaobabdt,一个超强的 决策树可视化 Python 库!
查看>>
python | pycco,一个神奇的 Python 库!
查看>>
python | pyg2plot,一个有趣的 数据可视化 Python 库!
查看>>
python | pymc,一个超强的 Python 库!
查看>>
python | pynsist,一个强大的 Python 库!
查看>>
python | pyparsing,一个强大的 Python 库!
查看>>
python | pyqtgraph,一个神奇的 Python 库!
查看>>
python读取文本文件数据
查看>>
python | Python mock对象与测试替身
查看>>
python | Python pandas实现数据追加和合并的最佳方法
查看>>
python | Python 中检查一个数字是否是三态数
查看>>
python | Python 蒙特卡洛模拟
查看>>
python | python-docx,一个超厉害的 Python 库!
查看>>
python | Python中使用@property装饰器
查看>>