3dTileset Vertical Exaggeration differences between tileset and terrain

Hello,

I’m trying to vertical exaggerate the terrain and 3dtileset at the same time. The tileset is added to the scene with a modelMatrix to place the tileset in the correct position. If scene.verticalExaggeration is set to something non zero, it loses its place in the terrain. It seems like its moving the tileset in an exaggerated way.

Here is the issue shown below. The red circle, red dot and the placed billboard is not related.

The picture below shows the tileset (the lighter terrain) placed normally without vertical exaggeration or scene.verticalExaggeration set at 0

This is when verticalExaggeration is set at 1.0001

This is when its set to 2.

I assume that the tileset is somewhere way above the ground when its set to 2. When it is set to below 1, it goes into the ground.

My guess is that it might be due to how the model matrix affects the placement after exaggeration. but I’m not sure about this.

I would provide a sandcastle but I am not able to share the tileset. Is there an example 3dtileset I can use?

Hi @jinpark, I don’t have an example where we position the tileset using the modelMatrix.

For setting the initial position of the tileset on the globe, we more commonly use the root tile transform. The modelMatrix is then used for making dynamic changes to the tileset positioning/scaling, usually in small amounts relative to the starting position defined by tileset.root.transform.

Can you try putting the value you are currently using for modelMatrix into tileset.root.transform instead? I think this will make the exaggeration work as expected–if not, please let us know.

Thanks for the help @jjhembd but,

I’ve tried removing the model matrix on the tileset and also setting it to a fixed Transforms.eastNorthUpToFixedFrame(Cartesian3.fromDegrees(0, 0)) and all have the same issue as before. I tried with globe.show off and with terrain turned on and off.

I’ve also tried setting the verticalExaggerationRelativeHeight to the size of the ellipsoid but had the same problem.

Tried with a bunch of other options turned on and off with no changes.

What else can I try here or what should I provide to help debug this?

@jinpark thanks for the update. Just to confirm: can you get the tileset to appear in the correct location without setting the modelMatrix at all? (Or by setting modelMatrix to Matrix4.IDENTITY).
The tileset positioning should be taken care of purely by the tileset.root.transform. See the 3D Tiles Vertical Exaggeration Sandcastle.
verticalExaggerationRelativeHeight would normally be set to the altitude (in meters) of the surrounding terrain.

I spent some time trying more things to debug this.

I was unable to get the tileset to the correct position using tileset.root.transform so I was just testing with the root.transform set at Matrix4.Identity. I tried setting the modelMatrix value to the tileset.root.transform value and that does not seem to be correct.

I also checked the 3D Tiles Vertical Exaggeration Sandcastle and it looks like its also just having the root.transform set at Matrix4.Identity.

{
  "asset": {
    "version": "1.0"
  },
  "geometricError": 1e+100,
  "root": {
    "boundingVolume": {
      "box": [0, 0, 0, 7972671.25, 0, 0, 0, 7972671.25, 0, 0, 0, 7945940.39280646]
    },
    "geometricError": 1e+100,
    "refine": "REPLACE",
    "transform": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
...

If it is not easily possible to do this with the terrain, is it possible to just do the vertical exaggeration with the globe and terrain off? It would be good enough to just show our 3dtilesets with exaggeration turned on or off in a blank space.

Hi @jinpark, the 3D Tiles Vertical Exaggeration Sandcastle has an identity matrix for the root transform, because the root tile is a global tile which is centered at the center of the Earth.

Here is a Sandcastle example of a local tileset. Notice how it is positioned using the root transform, and modelMatrix is the identity. Exaggeration works as expected.

Thanks for the example @jjhembd !

So it looks like placing the tileset with the root transform is required for vertical exaggeration to work correctly.

What I’ve tested is, after the viewer and tileset were loaded into the scene,

tileset is saved previously

const mm = tileset.modelMatrix;
const tf = tileset.root.transform;
tileset.modelMatrix = Cesium.Matrix4.IDENTITY;
tileset.root.transform = Cesium.Matrix4.multiply(mm, tf, new Cesium.Matrix4)

This sets the tileset model matrix to be the identity matrix, and root.transform to be the correct location of the tileset. Everything works as expected so far (tileset is where it should be) but when I apply changes to the verticalExaggeration, (viewer.scene.verticalExaggeration = 1.2) the same issue occurs as before

Hello @jjhembd

I was able to get permission to share one of our tilesets publicly and can show the issue in a public sandcastle below. It uses the example sandcastle that you provided before as the base. You might have to rotate the camera around to see the tileset correctly.

This example has the root transform set correctly, model matrix as identity and still you can see the tileset dissapearing when verticalExaggeration is changed.

Please let me know if you see if I’m doing something wrong or if there’s something I can do to fix this issue.

Thanks again!