Textures "sliding" when using terrain, image provider and 3d models. A bug?

Hello Cesium Dev-Community!

I'm facing a weird issue when using the Terrain Provider (CesiumTerrainProvider), the Image Provider (from Bing) and glTF models.

It looks like buildings are "sliding a little bit" when the camera is zoomed in and rotated. For example, take a look at the following picture: http://postimg.org/image/wo2sfugsl/

On the left, the model is aligned to the parking lot (see the red marks). After a little camera rotation, the model appears away from the original location (again, check the red marks).

Is this a bug? Otherwise, how can I prevent this behaviour?

This could be a bug. Can you send me the model and your Cesium code to load it?

Thanks,

Patrick

Hi Patrick,

thank you for your help and sorry for the late reply. The problem also happens with the Duck model shipped with the GLTF branch. I've uploaded the code here: http://pastebin.com/u7KwygKt

Please let me know if it does happen on your machine as well!

Alessio

Just a little update: the same problem seems to happen in the CZML demo in Sandcastle ( http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=CZML.html&label=undefined ). If you zoom in on the vehicle and rotate, some sliding happens. If you can't see it simply wait to pass near a mountain and then rotate the view from one side of the line to the other: the yellow line will move to the side of the mountain!

Does this sliding occur after adding a terrain provider to the CZML
Sandcastle demo? If so, I think what you're seeing is a parallax effect.
The polyline in the example follows the ellipsoid, but with terrain
loaded, the imagery is displayed at the actual terrain height. The result
is that the line is actually drawn below the visual surface.

One of the items on the Terrain
roadmap<https://github.com/AnalyticalGraphicsInc/cesium/issues/526> is
to draw polylines visually on the actual terrain surface.

I'm using the stock CZML demo, which does not seem to use a Terrain Provider, but just an Imagery provider.

In the test case I've submitted some days ago, it is more immediate to see this behaviour ( http://postimg.org/image/wo2sfugsl/). I was using a GLTF model, a terrain provider and an imagery provider (code here: http://pastebin.com/u7KwygKt ).

Could this be the parallax effect as well?

If that's a CesiumJS issue, I'm definitely going to fix it in the near term. Can anybody help me figure out if that's a bug or not? :slight_smile:

I took a look at your code sample, and yes, I think it’s the same parallax issue. You create the modelMatrix using a Cartographic that has 0 height, which means 0 meters above the WGS84 ellipsoid. The actual surface of the terrain is above the ellipsoid, so the result is that the model is drawn below the surface.

If you increase the height, you should see the sliding effect go away. You can use the sampleTerrain function to calculate the height of the terrain at a given position, and use that height for the model.

Scott,

thank you very much for your help. It was definitely the parallax effect, once I've started using sampleTerrain it went away.

Thanks again,
Alessio