1. A concise explanation of the problem you're experiencing.
I want to show Line of Sight on 3D buildings with color format projection instead of lines, where human can visible over the buildings in that area.
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
var viewer = new Cesium.Viewer('cesiumContainer');
var thetaMax = 360; //bearing in degrees
var dTheta = 10;
var R = 5000; // distance in meters
var centerLLH = Cesium.Cartographic.fromDegrees(-75.5966, 40.0386 , 0.0);
var centerXYZ = Cesium.Cartographic.toCartesian(centerLLH);
// We'll need the transformation from local coordinates to Earth-Centered, Earth-Fixed
var enuTransform = Cesium.Transforms.eastNorthUpToFixedFrame(centerXYZ);
for (var theta = 0; theta < thetaMax; theta += dTheta) {
var dX = R * Math.cos(Cesium.Math.toRadians(theta)) ;
var dY = R * Math.sin(Cesium.Math.toRadians(theta));
var limitENU = new Cesium.Cartesian4(dX, dY, 0.0, 1.0);
// Transform point in local coordinate system (East-North-Up) to ECEF
var limitECF = new Cesium.Cartesian4();
limitECF = Cesium.Matrix4.multiplyByVector(enuTransform, limitENU, limitECF);
var glowingLine = viewer.entities.add({
name : 'Ray at ' + theta + ' degrees ENU',
polyline : {
positions : [
centerXYZ,
limitECF
],
width : 1,
material : Cesium.Color.ORANGE.withAlpha(0.5),
}
});
}
var centerEntity = viewer.entities.add({
name: 'Center',
position: new Cesium.ConstantPositionProperty(centerXYZ),
point: {
size: 8
}
});
viewer.zoomTo(centerEntity);
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I want to show Line of Sight on 3D buildings with color format instead of line, where human can visble over the buildings in that area
4. The Cesium version you're using, your operating system and browser.
cesuim 1.39, windows 10