博客
关于我
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/

你可能感兴趣的文章
nnU-Net 终极指南
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
NO 157 去掉禅道访问地址中的zentao
查看>>
no available service ‘default‘ found, please make sure registry config corre seata
查看>>
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
查看>>
no connection could be made because the target machine actively refused it.问题解决
查看>>
No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
查看>>
No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
查看>>
No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
查看>>