我正在尝试添加一个具有多种不同属性的实体,例如材质(主要是 alpha)和旋转。矩形图形已覆盖旋转,并且在我设置材质来表示纹理时起作用。
viewer.entities.add({
name: 'Site Layer',
rectangle: {
coordinates: rectangle,
material: 'Image.jpg',
rotation: Cesium.Math.toRadians(13)
}
});
但是,当我尝试使用自定义材质(使用https://github.com/AnalyticalGraphicsInc/cesium/issues/2484 https://github.com/AnalyticalGraphicsInc/cesium/issues/2484)它显示为白色纹理而不是所需的结果......类似于:
material = new Cesium.Material({
fabric : {
type : 'Color',
uniforms : {
image : 'Image.jpg',
alpha : 0.5
}
components : {
diffuse : 'texture2D(image, materialInput.st).rgb',
alpha : 'texture2D(image, materialInput.st).a * alpha'
}
}
}
);
viewer.entities.add({
rectangle: {
coordinates: rectangle,
material: material,
rotation: Cesium.Math.toRadians(13)
}
});
阅读文档,矩形中的材质似乎是 Cesium.MaterialProperty 而不是 Cesium.Material ...这是否意味着我不能简单地将材质分配给矩形?如果没有,我可以以某种方式将材质包装在自定义的 MaterialProperty 中以使其工作吗?
出于好奇,为什么 Material 和 MaterialProperty 之间的功能存在差异?
附注GroundPrimitive 对我不起作用,因为我需要支持的主要浏览器之一(Safari)报告 GroundPrimitives.isSupported = false
也发布在这里https://groups.google.com/forum/#!topic/cesium-dev/1IPjHD7G_NA https://groups.google.com/forum/#!topic/cesium-dev/1IPjHD7G_NA