Hello, I want move CircleGeometry in 3D, 2D and 2.5D. This code from https://groups.google.com/forum/embed/?place=forum/cesium-dev&showsearch=true&showpopout=true&hideforumtitle=true&parenturl=http%3A%2F%2Fcesiumjs.org%2Fforum.html#!searchin/cesium-dev/translate/cesium-dev/dSydY8q6CLo/BNwMrziywS4J work in 3D:
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
var primitives = scene.primitives;
var ellipsoid = scene.globe.ellipsoid;
var positionOnEllipsoid = ellipsoid.cartographicToCartesian(Cesium.Cartographic.fromDegrees(-100.0, 40.0, 0.0));
var circleGeometry = new Cesium.CircleGeometry({
center : positionOnEllipsoid,
radius : 90000.0
});
var circleInstance = new Cesium.GeometryInstance({
geometry : circleGeometry,
id : 'circle',
attributes : {
color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 0.0, 0.0, 0.4))
}
});
// Add sphere instance to primitives
var circlePrimitive = new Cesium.Primitive({
geometryInstances : circleInstance,
appearance : new Cesium.PerInstanceColorAppearance({
translucent : true
})
});
primitives.add(circlePrimitive);
function moveDome(circlePrimitive){
var inverseModelMatrix = new Cesium.Matrix4();
Cesium.Matrix4.inverseTransformation(Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid), inverseModelMatrix);
var cartesianPosition = ellipsoid.cartographicToCartesian(Cesium.Cartographic.fromDegrees(-102.0, 50.0, 0.0));
var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(cartesianPosition);
Cesium.Matrix4.multiply(modelMatrix, inverseModelMatrix,circlePrimitive.modelMatrix);
}
Sandcastle.addToolbarButton('moveCircle', function() {
moveDome(circlePrimitive);
});
But when I morph scene to 2D or 2.5D, CircleGeometry come back to former place. In 2D and 2.5D moveDome() visually no effect, but when I morph scene to 3D the circle go to right place.