A CZML Dome Warps in Columbus View

I am making a dome on the globe by making an ellipsoid that is half under the surface, and turning on depth testing to make sure the underground half stays hidden. Everything looks great in the normal 3d view, but if I try to change to the Columbus or 2d view the dome elongates and warps. There is also a strange thick line that goes around the dome as well.

Good view -->

weird view -->

I’m curious if this is a possible bug, or just something I need to fix in my code somewhere. Or is this a result of the map coordinates being stretched when trying to fit it into a rectangle, as opposed to the more natural 3d globe. These views aren’t really important to what I am building, but I think it’d be really cool to have these views as an option for my project. I’ll include some pictures of what I am talking about.

Thanks,

Chris

Chris, this is not a bug. As you have already assumed, what’s happening here is that 2D and Columbus view cause the geometry you created to be deformed as it’s re-projected into the correct coordinates. (Though that weird red line running through the dome is probably an undesired artifact of the Grid material). What you are seeing is physically accurate. Trying to do otherwise would produce a whole host of unintended bugs; for example if you had two ellipsoid right next two each other, they might intersect in one view but not in the other. For small geometry, the difference isn’t noticeable (just like we don’t normally ourselves perceive the curvature of the earth); but as geometry gets larger, it’s pretty clear what’s happening.

Once I was writing and thought about it, that did seem to be the most likely reason for this. Just thought I’d make sure, thanks for the info!

Best,

Chris

Yeah, the thick line is the “rim lighting” aspect of the Grid material, which doesn’t understand Columbus View. Someone would need to fix the Rim Lighting material itself for CV, and then the fix could be copied to the grid material.

–Ed.

Chris,

How did you create the dome in the 1st place? I am looking at doing something similar.

Thanks,
Owen

Hey Owen,

To make a dome I simply made an ellipsoid centered on the surface, so half of it is hidden below the surface. I used czml’s because that works better with my project, but this could easily be done with primitives in javascript as well.

The only catch is you have to make sure that when you instantiate your viewer in the javascript file to set depthTestingAgainstTerrain equal to true. Otherwise the bottom half of the sphere will still show and it looks very weird because it can’t render it properly on top of the surface.

Viewer Code:

var scene = viewer.scene;
scene.globe.depthTestAgainstTerrain = true;

``

This bit will make sure only the top half of the sphere shows. Next I’ll include an easy example of a sphere that will draw a dome like this over Boston. The hardest part is getting the orientation right, and it took me a very long time to get it working. I used a combination of some java formulas to orient north and up I found on the forums and trial and error on a bit of offsets to make it work.

[
{
“id”:“document”,
“name”:“simple”,
“version”:“1.0”
},
{
“id”:“test”,
“ellipsoid”:{
“show” : true,
“radii”:{
“cartesian” : [400000.0, 400000.0, 400000.0]
},
“material”:{
“grid”:{
“color”:{
“rgba” : [255, 0, 0, 255]
},
“lineCount”:{
“cartesian2” : [10, 10]
},
“cellAlpha” : 0.15
}
}
},
“position”:{
“cartesian” : [1531821, -4464826, 4275080]
},
“orientation”:{
“unitQuaternion”:[
0.06643829150467435,-0.39837779895255104,0.9023496167729065,-0.15048671646842948
]
}
}
]

``

Best,

Chris