z-order i3dm and VectorData-Polygons

100 views
Skip to first unread message

maximus...@gmail.com

unread,
Jun 28, 2018, 11:34:53 AM6/28/18
to cesium-dev
1. A concise explanation of the problem you're experiencing.

I have added vector data polygons (*.vctr) and i3dm data to the scene. The pixels of i3dm data are overlayed by vector data. But I expect to see the trees as they are, without the red color from vector data.

I tried to change the order of primitives.add, but it does not change the draw order.

Can I configure something to change the z-order?

I found a todo "Future work Polygon z-order": https://github.com/AnalyticalGraphicsInc/cesium/pull/4665 may be it is a known issue?

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.


var viewer = new Cesium.Viewer('cesiumContainer', {
terrainProvider: Cesium.createWorldTerrain()
});

var flstTileset = new Cesium.Cesium3DTileset({
url: 'https://raw.githubusercontent.com/vitjok/testfile/master/vectordata/'
});
flstTileset.style = new Cesium.Cesium3DTileStyle({
color: 'rgba(255, 0, 0, 0.3)'
});
var vctr = viewer.scene.primitives.add(flstTileset);

var treeTileset = new Cesium.Cesium3DTileset({
url: 'https://raw.githubusercontent.com/vitjok/testfile/master/i3dm/'
});
var tree = viewer.scene.primitives.add(treeTileset);


viewer.zoomTo(flstTileset);

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I want to see the Polygons on the terrain and the trees over the terrain and over the Polygons.


4. The Cesium version you're using, your operating system and browser.


Cesium 1.46
Windows 10
Chrome 67.0.3396.87

maximus...@gmail.com

unread,
Jun 28, 2018, 11:38:11 AM6/28/18
to cesium-dev

Gabby Getz

unread,
Jun 29, 2018, 10:14:33 AM6/29/18
to cesium-dev
Hi Maximus,

We have added geometry z-ordering in Cesium 1.46, however as you pointed out, it has no made it's way into vector tiles yet (as they are still experimental). 3D Tiles Issue #69 covers adding it to the specification, I'll bump that issue with this request.

Thanks,
Gabby

maximus...@gmail.com

unread,
Aug 8, 2018, 12:19:37 PM8/8/18
to cesium-dev
Hi Gabby,

I just noticed, that the sample does not work anymore (in current Version I have to append tileset.json to the url option).

And then (more important) I noticed a post about ClassificationType.TERRAIN https://cesiumjs.org/forum/#!msg/cesium-dev/1ptAh6n82KM/1kEFweikAQAJ (by Dan Bagnell).

This option seams to fix the issue.

Sample code:

```


var viewer = new Cesium.Viewer('cesiumContainer', {
terrainProvider: Cesium.createWorldTerrain()
});

var flstTileset = new Cesium.Cesium3DTileset({

classificationType: Cesium.ClassificationType.TERRAIN,
url: 'https://raw.githubusercontent.com/vitjok/testfile/master/vectordata/tileset.json'


});
flstTileset.style = new Cesium.Cesium3DTileStyle({
color: 'rgba(255, 0, 0, 0.3)'
});
var vctr = viewer.scene.primitives.add(flstTileset);

var treeTileset = new Cesium.Cesium3DTileset({

url: 'https://raw.githubusercontent.com/vitjok/testfile/master/i3dm/tileset.json'


});
var tree = viewer.scene.primitives.add(treeTileset);


viewer.zoomTo(flstTileset);
```

Thanks,
Maximus

Gabby Getz

unread,
Aug 9, 2018, 2:12:09 PM8/9/18
to cesium-dev
Perfect, thanks for the update! Setting the classification type to terrain will indeed work in this case, good thinking.
Reply all
Reply to author
Forward
0 new messages