《cesium编程中级(四)使用渐变纹理》的评论 http://cesium.xin/wordpress/archives/150.html 学习cesiumjs 的好地方--伐罗密 Wed, 20 Nov 2024 01:45:23 +0000 hourly 1 https://wordpress.org/?v=4.9.26 作者:Elusive http://cesium.xin/wordpress/archives/150.html#comment-4577 Thu, 29 Aug 2024 08:03:28 +0000 http://cesium.xin/wordpress/?p=150#comment-4577 var ctx = ramp.getContext(‘2d’);
// 增加
ctx.rect(0, 0, 1, 200);
ctx.fillStyle=”white”;
ctx.fill();

var values = elevationRamp;

]]>
作者:Solitude_425G http://cesium.xin/wordpress/archives/150.html#comment-4576 Thu, 29 Aug 2024 07:22:38 +0000 http://cesium.xin/wordpress/?p=150#comment-4576 想问一下,按照示例,为什么更改canvas设置为height为200,createLinearGradient也设置为200之后,会出现大面积的黑色,按理来说不应该和100和100显示类似的结果吗

]]>
作者:393829394 http://cesium.xin/wordpress/archives/150.html#comment-1923 Mon, 29 Mar 2021 09:24:25 +0000 http://cesium.xin/wordpress/?p=150#comment-1923 麻烦问一下,有什么办法,能够根据某个点的经纬度,得到坡度渲染后该点的坡度值?

]]>
作者:Elusive http://cesium.xin/wordpress/archives/150.html#comment-879 Mon, 06 Jul 2020 02:13:40 +0000 http://cesium.xin/wordpress/?p=150#comment-879 已修改,谢谢指出

]]>
作者:徐 http://cesium.xin/wordpress/archives/150.html#comment-878 Mon, 06 Jul 2020 01:49:07 +0000 http://cesium.xin/wordpress/?p=150#comment-878 到fillRect(0,0,1,100)是纵向的,fillRect(0,0,1,100)是横向的,———–应该是“fillRect(0,0,1,100)是纵向的,fillRect(0,0,100,1)是横向的”吧?

]]>
作者:ytzz http://cesium.xin/wordpress/archives/150.html#comment-654 Sun, 19 Jan 2020 09:48:26 +0000 http://cesium.xin/wordpress/?p=150#comment-654 设置了 transparent:true,属性 只可以透过一个纹理墙看到另外一个纹理墙 看不到后面的地图,请问设置什么参数可以看到后面的地图呢

]]>
作者:ytzz http://cesium.xin/wordpress/archives/150.html#comment-653 Sun, 19 Jan 2020 09:38:22 +0000 http://cesium.xin/wordpress/?p=150#comment-653 就是透过加载的纹理墙看不到后面的地图呀 设置子什么参数可以看到呢

]]>
作者:Elusive http://cesium.xin/wordpress/archives/150.html#comment-652 Sun, 19 Jan 2020 07:49:00 +0000 http://cesium.xin/wordpress/?p=150#comment-652 没明白你说的什么意思,什么透明度级别

]]>
作者:ytzz http://cesium.xin/wordpress/archives/150.html#comment-648 Sun, 19 Jan 2020 03:33:56 +0000 http://cesium.xin/wordpress/?p=150#comment-648 请问一下这个透明度的级别怎么设置呀 我这个透明度看不到墙对面的地图

]]>
作者:一个个 http://cesium.xin/wordpress/archives/150.html#comment-647 Sun, 19 Jan 2020 00:46:53 +0000 http://cesium.xin/wordpress/?p=150#comment-647 能帮我看看问题出在哪么 redWalls 这个墙怎么也调用不了getColorRamp1这个canvas
var redWalls = viewer.entities.add({
name: ‘the Red wall at height1’,
wall: {
positions: Cesium.Cartesian3.fromDegreesArrayHeights([
116.232575,39.535532,0.0,
116.232785,39.535532,0.0,
116.232890,39.535532,0.0,
]),
minimumHeights: [200.0, 200.0,200.0],//高度
material:new Cesium.ImageMaterialProperty({
// image:”2.png”,
image:getColorRamp1([0.01, 0.02, 0.03, 0.04, 0.05], true),
transparent:true
})
}
});
function getColorRamp1(elevationRamp1, isVertical = true) {
var ramp1 = document.createElement(‘canvas’);
ramp1.width = isVertical ? 1 : 100;
ramp1.height = isVertical ? 10 : 1;
var ctx1 = ramp1.getContext(‘2d’);

ctx1.rect(0, 0, 1, 100);
ctx1.fillStyle=”white”;
ctx1.fill();

var values1 = elevationRamp1;

var grd1 = isVertical ? ctx1.createLinearGradient(0, 0, 0, 100) : ctx1.createLinearGradient(0, 0, 100, 0);
grd1.addColorStop(values1[0], ‘#FFFFFF’); //black
//grd.addColorStop(values[0], ‘#000000’); //black
grd1.addColorStop(values1[1], ‘#000000’); //blue
grd1.addColorStop(values1[2], ‘#FF00FF’); //pink
grd1.addColorStop(values1[3], ‘#00FFFF’); //red
grd1.addColorStop(values1[4], ‘#0000FF’); //orange

ctx1.fillStyle = grd1;
if (isVertical)
ctx1.fillRect(0, 0, 1, 100);
else
ctx1.fillRect(0, 0, 100, 1);
return ramp1;
}

]]>