Issue with Material alignment when terrain is enabled
Opened this issue · 5 comments
What happened?
I am assigning an image as material to a geojson polygon, it fits in perfectly when terrain is turned off. When I enable the terrain, some part of the image is cropped out.
Reproduction steps
- turn on terrain,
2.assign height to polygon entity
Sandcastle example
Environment
Browser: Chrome
CesiumJS Version: latest
Operating System: Win 11
image URL = https://i.ibb.co/wKd0b5V/test-img.png
Hi @saadatali48, thanks for the report!
The GeoJSON is not clamped to the terrain, so I'm not surprised that we see some clipping issues. I tried setting clampToGround: true
but then I get this error:
Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.
This may be related to #6694
Hi @jjhembd Thanks for your response,
I see it is fitting on ground properly with setting clamp to ground : true
,
but the problem is I want to add a base height to represent a slab, and then assign this material to it. In that case I will have to use a value of height, here in this case, lets say the highest point has a height of 603, now I will add 1m, to represent a slab entity.
and then apply material to that slab entity. Outline is not required in this case.
Even when we set clamp to ground true, and then assign a value of height, it is clipping out the material, as shown in below images.
The problem I am having is, if we set a height value to polygon, when terrain is enabled, it's material is clipped out, which shouldn't be the case.. Because with a height value the scale of polygon will be exactly the same as it is without height (I think).
Then how come the same image is not fitting in the polygon with height.
and if I disable terrain, then the material is aligned properly without clipping. So it has something to do with terrain I think.