To preface, I’m using b27 until 1.0 is released.
I was wondering if there’s a way to prevent geometries from following the curvature of the globe. I’m trying to implement my own hemisphere outline generation using circle outline geometries. The issue I’m running into is that each circle follows the curvature of the Earth, so it ends up looking strange (the bottom-most circle appears to be much ‘lower’ than the lat/lon I have defined as the middle).
Just in case my description isn’t making sense, here’s some sandcastle code to reproduce what I’m seeing. Copy / paste the following into the cesiumjs.org sandcastle, replacing any other code:
require([‘Cesium’], function(Cesium) {
“use strict”;
Cesium.Math.setRandomNumberSeed(1234);
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var scene = viewer.scene;
var primitives = scene.primitives;
var solidWhite = Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE);
// Combine instances each with a unique color.
// We can combine heterogeneous geometries as we
// do here as long as vertex formats match.
var instances = ;
var height = 0;
var center = Cesium.Cartesian3.fromDegrees(-65.0, 35.0);
var radius = 5000000.0;
var radiusStep = radius / 5;
var rectangle = Cesium.Rectangle.fromDegrees(-67.0, 27.0, -63.0, 32.0);
for (var i = 0; i < 5; ++i) {
height = 200000.0 * i;
instances.push(new Cesium.GeometryInstance({
geometry : new Cesium.CircleOutlineGeometry({
center : center,
radius : (radius - (i * radiusStep)) + 1,
height : height,
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
}),
attributes : {
color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({alpha : 0.5}))
}
}));
//instances.push(new Cesium.GeometryInstance({
// geometry : new Cesium.RectangleGeometry({
// rectangle : rectangle,
// height : height,
// vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
// }),
// attributes : {
// color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({alpha : 0.5}))
// }
//}));
}
primitives.add(new Cesium.Primitive({
geometryInstances : instances,
appearance : new Cesium.PerInstanceColorAppearance({
flat : true,
translucent : true,
closed : true
})
}));
Sandcastle.finishedLoading();
});
Is there a way to disable this feature for just one geometry / primitive? In general, I do like it, but in this case it’s actually hindering me.
Thanks,
Joe