Clamp to Ground Status

Hi all,

I am interested in the current status of Clamp-to-Ground. I know it is a priority and there's been a lot of progress. But I haven't been able to keep straight which types of primitives currently use this feature.

Billboards
Points
Lines
Polygons
Models
Ellipse

I am looking forward to move my model-heavy CZML dataSource from ellipsoid to STK world mesh (e.g. http://www.geo-animate.com/category/world-war-ii/battle-for-normandy-1944/).

Cheers, erik hellstedt

Me again. Just to clarify my post, I meant to ask “Would someone provide a quick status update for each type of primitives?” Cheers, erik

Hello Erik,

So far, only the BillboardCollection and LabelCollection have the ability to set heightReference: Cesium.HeightReference.CLAMP_TO_GROUND.
We also recently introduced the GroundPrimitive, which can be used for CircleGeometry, CorridorGeometry, EllipseGeometry, PolygonGeometry and RectangleGeometry on terrain.

Neither of these have been implemented in the Entity API, so they cannot be used from CZML yet.

I believe we plan on looking to do ground polylines next, but there is a lot of research that needs to be done first so I’m not sure how soon that will be finished. I’m not sure what the status is for models and other primitive types.

Best,

Hannah

Will entity support likely come before or after comprehensive clamping support?

Or will we likely see some kind of global clamp/no clamp flag?

Hi Hannah, has the Cesium dev team discussed Clamp to Ground on polygons any further? It would be really helpful to be able to clamp a CZML polygon to a hillside.

Cheers,

Greg

Hello Greg,

Yes, CZML polygons (and other ground geometry like ellipses and corridors) with 0 height clamp to terrain by default now. Here’s a code example:

var czml = [{
“id” : “document”,
“name” : “CZML Geometries: Polygon”,
“version” : “1.0”
}, {
“id” : “redPolygon”,
“name” : “Red polygon on surface”,
“polygon” : {
“positions” : {
“cartographicDegrees” : [
-119.5644, 37.7582, 0,
-119.5593, 37.7382, 0,
-119.5284, 37.7373, 0,
-119.5317, 37.7642, 0
]
},
“material” : {
“solidColor” : {
“color” : {
“rgba” : [255, 0, 0, 124]
}
}
}
}
}];

var viewer = new Cesium.Viewer(‘cesiumContainer’);
var cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({
url : ‘https://assets.agi.com/stk-terrain/world’,
requestWaterMask : true,
requestVertexNormals : true
});
viewer.terrainProvider = cesiumTerrainProviderMeshes;
var dataSource = Cesium.CzmlDataSource.load(czml);
viewer.dataSources.add(dataSource);
viewer.zoomTo(dataSource);

``

Best,

Hannah

Thanks Hannah, what about polygons with height? Its simple to clamp a cube to terrain with KML in GE but it still seems impossible with Cesium, is that the case as you see it?

Many thanks,

Greg

Hi Greg,

There’s no support for polygons with height at this time. It’s a much more complicated graphics problem and we need to do some research to figure out the best way to do this. I think it will need to use a completely different approach than the surface polygons.

Best,

Hannah

Thanks Hannah, that’s what I feared… its really a major impediment to using Cesium for urban modelling if you can’t clamp 3D geometry to terrain. Hopefully its at least being discussed by the team for future implementation.

Best,

Greg

Hi Greg,

For that kind of use case I would recommend using 3D Tiles. You can create tilesets that put buildings at a height based on the terrain. You can learn more about 3D tiles in this forum post: https://groups.google.com/d/msg/cesium-dev/tCCooBxpZFU/7hxT_E4pGgAJ

Best,

Hannah

Hi Hannah,

I am referring this sample code of 3D tiles https://github.com/AnalyticalGraphicsInc/cesium/blob/3d-tiles/Apps/Sandcastle/gallery/3D%20Tiles.html

But I get error on line #74 saying “Uncaught TypeError: undefined is not a function”.

Also I am unable to find documentation for ‘Cesium3DTileset’ in document references.

Using latest Cesium version 1.27.

I am unable to figure out what’s going wrong there…

Hi MP,

You will need to check out the 3d-tiles branch in order for that example to work: https://github.com/AnalyticalGraphicsInc/cesium/tree/3d-tiles

See our build guide for instructions on checking out and building the code base: https://github.com/AnalyticalGraphicsInc/cesium/tree/3d-tiles/Documentation/Contributors/BuildGuide

Best,

Hannah

Thanks Hannah!

By when this branch will be merged with master and released?

There’s still a lot of work that needs to be done, but we’re hoping to get it merged by Spring 2017

-Hannah

Great news Hannah. Do you foresee this work including being able to clamp to the ground models that move through time from one point to another? Cheers, Erik

Hi Erik, I’m not sure if that’s going to be in the initial spec. Maybe that has been answered somewhere in the 3D tiles forum post: https://groups.google.com/d/msg/cesium-dev/tCCooBxpZFU/7hxT_E4pGgAJ

-Hannah

Hi Hannah,

I have checked out this 3d-tiles branch but I am getting 404 errors for Cesium.js and Cesium.css for basic HelloWorld page.

And a long list of 404 errors in console for a 3d tiles page from sandcastle. Few of them are for files listed below:

Source/Shaders/AdjustTranslucentFS.js

Source/Shaders/Appearances/BasicMaterialAppearanceFS.js

Source/Shaders/Appearances/AllMaterialAppearanceVS.js

etc…

I am using Xampp server on Windows 7.

What am I missing to get this working? Thanks in advance.

Hi Hannah,

The below issue happened as I haven’t built the project. Do you have any idea how to build it in XAMPP environment as I am not familiar with node.js?

Hello,

You will need to install node because it is used to run the build code and start the server we include with the project. You can follow these instructions: https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Documentation/Contributors/BuildGuide#build-the-code

Best,

Hannah

Hey, is there now a possiblity to clamp Cesium3DTileset Models to Ground?
If not, is it possible to use the modelMatrix to move it in hight for all?
Please describe how it would work.