What is calculation of Line of sight in cesuim and projections over the building thru human vision

589 views
Skip to first unread message

lakshmi...@gmail.com

unread,
Apr 6, 2018, 5:38:29 AM4/6/18
to cesium-dev
1. A concise explanation of the problem you're experiencing.

i am not able find exact calculation to find line of sight calculation from one latitude and longitude with human vision over buildings


2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

code-------------------

var theta=360 ; //bearing in degre
var R= 5000 ; // distance in meters


for(var i=0;i<=theta;i++){

var dx1 = R * Math.cos(i) ;
console.log("dx=="+dx1);

var dy1 = R * Math.sin(i);
console.log("dy=="+dy1);


var delta_longitude1 = dx1/(111320*Math.cos(42.25732445310803));
console.log(delta_longitude1);

var delta_latitude1 = dy1/110540;
console.log(delta_latitude1);

Final_longitude1 = longitude + delta_longitude1;
Final_latitude1 = latitude + delta_latitude1;

var value=longitude+","+latitude+","+height+","+Final_longitude1+","+Final_latitude1+","+height;

var arr=[value];

var res = value.split(",");





glowingLine = viewer.entities.add({
name : 'Glowing blue line on the surface',
polyline : {
//positions : Cesium.Cartesian3.fromDegreesArray(res),
positions : Cesium.Cartesian3.fromDegreesArrayHeights(res),
width : 1,
material : Cesium.Color.ORANGE.withAlpha(0.5),

}
});


-------------------------------------


3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I want to show a line of sight visibility thru human vision and only with one latitude and longitude & 360 as bearing angle as input and I want to show vision over buildings how much a human can see from top of the building.


4. The Cesium version you're using, your operating system and browser.

cesuim 1.39, browser- google chrome,OS= windows 10

Scott Reynolds

unread,
Apr 7, 2018, 8:54:12 AM4/7/18
to cesium-dev
Your example seems to be trying to show the rays from your center point, but you've left out the latitude and have included a couple of 'magic' numbers (111320 and 110540).  Below is an example of computing and drawing the rays.

Hope that helps.

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);

Dhana lakshmi

unread,
Apr 9, 2018, 2:00:47 AM4/9/18
to cesiu...@googlegroups.com
Hi  Scott Reynolds,

Thanks for the amazing help.

I request to share calculations on restricting line of sight projections over other buildings. 

I could not find the calculations, where the line of sight rays are projected over all buildings.

For example, there is a building, the light cannot pass thru the 3rd building where it has to stop, if the light is hitting to second building, 

can u share, how the restrictions can be done?
That would be more helpful.

Thanks in advance




Regards
Dhanalakshmi



--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/HS-c_0oyAmQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dhana lakshmi

unread,
Apr 11, 2018, 9:03:45 AM4/11/18
to cesiu...@googlegroups.com
Hi  Scott ,

I have received error as "ces_example.html:45 Uncaught TypeError: Cesium.Cartographic.toCartesian is not a function" in my html .

but in sandcastle,its working fine. Can you help me out. is that any problem with version ? or any other thing.

Regards
Dhana

Gabby Getz

unread,
Apr 12, 2018, 10:11:34 AM4/12/18
to cesium-dev
That was a function added in a recent release, try downloading and using the latest version of Cesium.

Dhana lakshmi

unread,
Apr 12, 2018, 2:15:39 PM4/12/18
to cesiu...@googlegroups.com
Thank you. Will check.
Message has been deleted
Message has been deleted

Руслан Сорокин

unread,
Dec 16, 2018, 4:12:44 AM12/16/18
to cesium-dev
Hi Gabby,

Please, tell us exactly what function you mean?

Thanx in advance.

Sincerely,

  Ru

четверг, 12 апреля 2018 г., 17:11:34 UTC+3 пользователь Gabby Getz написал:
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.

Omar Shehata

unread,
Dec 17, 2018, 1:18:14 PM12/17/18
to cesium-dev
I think that was just referring to the Cesium.Cartographic.toCartesian function.

Also, the ion SDK does have some pretty cool tools for doing this kind of visibility analysis that you can buy as an add-on to CesiumJS:

Руслан Сорокин

unread,
Dec 18, 2018, 3:33:22 AM12/18/18
to cesium-dev
Thank you, Omar! I'll look this.

понедельник, 17 декабря 2018 г., 21:18:14 UTC+3 пользователь Omar Shehata написал:
Reply all
Reply to author
Forward
0 new messages