Guillaume Beraudo
unread,Sep 23, 2014, 6:44:09 AM9/23/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cesiu...@googlegroups.com
Hello,
Point and line geometries with 3D coordinates are drawn in 3D.
However, 3D polygons are drawn on the ellipsoid. See sandcastle example at the bottom.
Is it the expected behaviour?
I expected the case where all Z coordinates are identical to be handled,
the polygon being translated from the ellipsoid.
With PolygonGeometry, I may use a modelMatrix or set height/extrudedHeight.
With GeoJson, is there a workaround?
BR,
Guillaume
Sandcastle example - point and line are 3D, polygon is not
//Create the viewer
var viewer = new Cesium.Viewer('cesiumContainer');
Cesium.viewerEntityMixin(viewer);
var geo = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [102.0, 0.6, 1e5]
}
},
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[102.0, 0.0, 1e5], [103.0, 1.0, 1e3], [104.0, 0.0, 1e5], [105.0, 1.0, 1e2]
]
}
},
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[100.0, 0.0, 1e6], [101.0, 0.0, 1e6], [101.0, 1.0, 1e6], [100.0, 1.0, 1e6],
[100.0, 0.0, 1e6]
]
]
}
}
]
};
var dataSource = new Cesium.GeoJsonDataSource();
viewer.dataSources.add(dataSource);
dataSource.load(geo);
//Reset the scene when switching demos.
Sandcastle.reset = function() {
var camera = viewer.scene.camera;
camera.lookAt(Cesium.Cartesian3.fromDegrees(100, 0, 5000000),
Cesium.Cartesian3.fromDegrees(100, 0, 0), Cesium.Cartesian3.UNIT_Z);
};
--
Guillaume Beraudo
Camptocamp Engineer