cesium icon indicating copy to clipboard operation
cesium copied to clipboard

Turn off vertical exaggeration for some Models in the Scene

Open jjhembd opened this issue 1 year ago • 13 comments

Feature

As reported by @Jean-Dum in https://github.com/CesiumGS/cesium/issues/11936: Scene.verticalExaggeration exaggerates every Model on the screen: image

Some users may want to show exaggerated terrain, but leave some models unscaled. This was the behavior of the old Globe.terrainExaggeration which has been removed since v1.116.

@Jean-Dum can you add some context about your use case for exaggerating only part of the scene? This will help us prioritize the issue.

jjhembd avatar Apr 17 '24 15:04 jjhembd

Thank you for openning this issue @jjhembd I don't really know which solution would be the best to let the user choose on which object to apply verticalExaggeration, but it could be one of those options:

  • Split behaviours between two different values (for example terrainExaggeration and modelsExaggeration)
  • Allow the user to deactivate verticalExagerration for a given datasource (add an option disableVerticalExaggeration to CustomDataSource)
  • Allow the user to deactivate verticalExaggeration for a given model (add an option disableVerticalExaggeration to ModelGraphics)

Maybe there is another solution which could be better for everyone!

Jean-Dum avatar Apr 18 '24 08:04 Jean-Dum

Hi @jjhembd , setting exaggerated parameters for different models is an important feature. Is there a plan for the next step in addressing this issue?

syzdev avatar May 07 '24 03:05 syzdev

Hi @syzdev, we don't have a planned date for this yet

If you'd like to add more information about your use case, that may help us prioritize. If you are interesting in contributing, please let us know and we'd be happy to discuss implementation or review a PR. Thanks!

ggetz avatar May 09 '24 13:05 ggetz

@ggetz I strongly agree with the several optimization solutions listed by @Jean-Dum . Overall, there are not many use cases for this feature. In limited use cases, most users should hope that the behavior of the model and terrain should be separated. However, further, users hope to independently control the exaggeration of each model. For example, in geological analysis use cases, users want to only exaggerate the geological model while keeping other building models above the geological model unchanged.

Of course, these suggestions will cause significant changes to the feature itself, and I am also very curious about what other users use cases are. I believe that more users need to participate in the discussion regarding this issue.

syzdev avatar May 10 '24 03:05 syzdev

Hi @ggetz, I have a use case which only exaggerate terrain and not exaggerate model. In the ocean, underwater mountain can be showed by exaggerating terrain, but a ship should not be exaggerated .

liubangbo avatar Jul 17 '24 02:07 liubangbo

Thank you @liubangbo for your comment. I have exactly the same use case as you have. The fact that models and terrain exaggeration are now linked together completely prevent me from updating Cesium to its latest version.

Jean-Dum avatar Jul 26 '24 16:07 Jean-Dum

Thank you @liubangbo for your comment. I have exactly the same use case as you have. The fact that models and terrain exaggeration are now linked together completely prevent me from updating Cesium to its latest version.

@Jean-Dum Hello, could you please tell me which version of Cesium you are currently using? I have tried downgrading to version 1.116 or earlier and adjusted the value of Globe.terrainExaggeration, but the models are still distorted. Is there something maybe wrong with my codes?

realcjames avatar Aug 06 '24 05:08 realcjames

Hello! I am using version 1.110.0, I think the processing of terrainExaggeration has been modified at the same time verticalExaggeration has been introduced, at version 1.113.0.

Jean-Dum avatar Aug 06 '24 07:08 Jean-Dum

@Jean-Dum Thank you for your reply. I ended up using the 1.112 build package instead of the version installed via npm. This is because I found that the version of @cesium/engine was incorrect after installing with npm. Directly installing the 6.1.1 version of @cesium/engine also resulted in models being distorted. Anyway, it's good that this solution works for now.

realcjames avatar Aug 07 '24 05:08 realcjames

Hello, +1 for me as well.

I have a need to omit exaggeration on Models. It would be perfect if there was a flag on the model to participate in verticalExaggeration or not. The behavior would be that models could opt-out to exaggerate with the terrain where required. Thasnk much, -TImothy

timeichfeld-msa avatar Aug 07 '24 18:08 timeichfeld-msa

Hello,

I have a fork that fixes this issue (I think) How should I proceed to get it reviewed? Please see: https://github.com/timeichfeld-msa/cesium

timeichfeld-msa avatar Aug 09 '24 14:08 timeichfeld-msa

Hi @timeichfeld-msa, please see our Contribution Guide for opening a Pull Request for review. Thanks!

ggetz avatar Aug 09 '24 14:08 ggetz

@timeichfeld-msa If your fix is working, could you open a pull request? Thank you!

Jean-Dum avatar Aug 20 '24 12:08 Jean-Dum