Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLAMP_TO_GROUND for Billboards incorrect positions #4776

Open
Joebh opened this issue Dec 21, 2016 · 9 comments
Open

CLAMP_TO_GROUND for Billboards incorrect positions #4776

Joebh opened this issue Dec 21, 2016 · 9 comments

Comments

@Joebh
Copy link

Joebh commented Dec 21, 2016

When using a terrain provider that uses a heightmap terrain format, the CLAMP_TO_GROUND property produces incorrect positions for billboards. It is easier to see when there are more billboards placed. I can get it to happen every time when there are 10 billboards on the globe.

I've tested with the terrain provider at https://cesiumjs.org/smallTerrain. This is not an issue when the terrain provider provides a quantized mesh format.

I'm using the current 3d-tiles branch at revision 31cf664.

@hpinkos
Copy link
Contributor

hpinkos commented Dec 21, 2016

Thanks @Joebh, I was able to reproduce this.
It doesn't happen every time, but occasionally some of the points doesn't get clamped to the terrain.
Here is a code example:

var viewer = new Cesium.Viewer('cesiumContainer');

viewer.terrainProvider = new Cesium.VRTheWorldTerrainProvider({
    url : 'http://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/',
    credit : 'Terrain data courtesy VT MÄK'
});

var lon = -122.1957;
var lat = 46.1914;

for (var i = 0; i < 5; i++) {
    for (var j = 0; j < 5; j++) {
        viewer.entities.add({
            position : Cesium.Cartesian3.fromDegrees(lon + i*0.0001, lat + j*0.0001),
            point : {
                color : Cesium.Color.RED,
                pixelSize : 10,
                heightReference : Cesium.HeightReference.CLAMP_TO_GROUND
            }
        });
    }
}

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 21, 2016

Is this the same issue as #4598?

@hpinkos
Copy link
Contributor

hpinkos commented Dec 21, 2016

I could still reproduce it with the fix in #4622, so I don't think it's the same issue

@duvifn
Copy link
Contributor

duvifn commented Dec 22, 2016

Is this the same issue as #4598?

Issue #4598 is a position offset of clamped billboards and here the problem is, actually, that the billboards don't get clamped to the current level of terrain (as @hpinkos wrote).

It's caused by the fact that billboards don't get updated in some conditions (points 2,3,4 in #4686, and maybe additional problems).

It occasionally happens also with STK Terrain. I was able to reproduce this by removing the cache and putting the camera close, before the loading start (to increase the chance of using upsampled tiles).

@ggetz
Copy link
Contributor

ggetz commented Nov 3, 2017

@ggetz
Copy link
Contributor

ggetz commented Jan 12, 2018

Cam up again on the forum: https://groups.google.com/forum/#!topic/cesium-dev/kQiuFbnTpSQ

@smills2929
Copy link

I can confirm I am having the same issue.

@ihpled
Copy link

ihpled commented Nov 23, 2021

I, don't know if it is related to the same bug but billboards doesn't clamp to ground at all when terrain provider is ArcGISTiledElevationTerrainProvider. They behave correctly when provider is of type returned by Cesium.createWorldTerrain().
Is it a known issue?

@angrycat9000
Copy link
Contributor

angrycat9000 commented Nov 5, 2024

Having this problem with Google 3D Tiles. Example sandcastle where the polygon is correctly placed on the 3d tiles but the billlboard with HeightReference.CLAMP_TO_GROUND is not placed on top of the building.

Update: Thanks to @jjspace for pointing out that {enable: collisions} was needed for the tileset. See working sandcastle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants