require(['Cesium'], function(Cesium) {
"use strict";
var widget = new Cesium.CesiumWidget('cesiumContainer', {
imageryProvider : new Cesium.ArcGisMapServerImageryProvider({
url : 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer'
})
});
var layers = widget.centralBody.imageryLayers;
var ellipsoid = widget.centralBody.ellipsoid;
var scene = widget.scene;
var primitives = scene.primitives;
var image = new Image();
image.onload = function() {
var billboards = new Cesium.BillboardCollection();
var textureAtlas = scene.context.createTextureAtlas({
image : image
});
billboards.textureAtlas = textureAtlas;
billboards.add({
position : ellipsoid.cartographicToCartesian(Cesium.Cartographic.fromDegrees(-75.59777, 40.03883)),
imageIndex : 0
});
scene.primitives.add(billboards);
};
image.src = '../images/Cesium_Logo_overlay.png';
function changeMap(layers){
var provider = new Cesium.TileMapServiceImageryProvider({
url :'../../../Source/Assets/Textures/' + 'NaturalEarthII'
});
try{
layers.removeAll();
}catch( e){
}
layers.addImageryProvider(provider);
widget.centralBody.depthTestAgainstTerrain = true;
}
Sandcastle.addToolbarButton('changeMap', function() {
changeMap(layers);
});
Sandcastle.finishedLoading();
});
--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/fHVc4gVI6vI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
>
> Hi Kevin, nope, obscuration persists. When move the graphic around, the billboards and labels surface and semi-obscure randomly .... even 10 minutes later.
Any ideas?
Thanks
Regards
Rencia
>
Hi, have just upgraded to b28, sorted some other issues but this one is a bit worse. I see that in b29 coming is "Improved terrain and imagery rendering performance when very close to the surface" - might that solve my problem?
See sandcastle code below. Obscuration now happening right from the start, not only after change base imagery layer. My real billboards are much smaller than this image so I lose them entirely.... Commenting out the depthTestAgainstTerrain on line 31 solves it for the billboards but then the ellipsoid and ellipsoidOutlineGeometry doesn't work properly when under the surface. See my other post
https://groups.google.com/forum/embed/?place=forum%2Fcesium-dev&showsearch=true&hideforumtitle=true&parenturl=http%3A%2F%2Fcesiumjs.org%2Fforum.html&theme=default#!topic/cesium-dev/ZCzBQsDALD0
Many thanks.
Rencia
Oops, here is my code:
require(['Cesium'], function(Cesium) {
"use strict";
var handler;
var label;
var billboard;
function addBillboard(scene, ellipsoid) { //, image) {
var image = new Image();
image.src = '../images/Cesium_Logo_overlay.png';
var billboards = new Cesium.BillboardCollection();
var textureAtlas = scene.createTextureAtlas({
image : image
});
billboards.textureAtlas = textureAtlas;
billboard = billboards.add({
position : ellipsoid.cartographicToCartesian(Cesium.Cartographic.fromDegrees(-75.59777, 40.03883)),
imageIndex : 0
});
billboard.isBillBoard = true;
scene.primitives.add(billboards);
}
var widget = new Cesium.CesiumWidget('cesiumContainer');
var scene = widget.scene;
var ellipsoid = scene.globe.ellipsoid;
scene.globe.depthTestAgainstTerrain = true; //so that shapes UNDER the surface are not visible
addBillboard(scene, ellipsoid);
Sandcastle.finishedLoading();
});
--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/fHVc4gVI6vI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/fHVc4gVI6vI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.