Why 3d Tile under terrain show?

224 views
Skip to first unread message

jin ming

unread,
Aug 10, 2019, 2:19:48 PM8/10/19
to cesium-dev
1. A concise explanation of the problem you're experiencing.
  I have a 3d tileset. It has no location info. 
  I made that 3d tileset to place underneath the terrain.
  But I can still see that 3d tile. Obviously, it is underneath terrain.
  I can not see it in Cesium Ion Location Editor with same location info.
  Who can explain why?
  How to fix? 

  This is screen capture in Cesium Ion Lcation Edior

Screenshot_1.png



This is screen capture in Cesium SandCastle.


Screenshot_1.png





2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

// Grant CesiumJS access to your ion assets
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2MzJlNDI2ZC1hMmE5LTQ4MjEtYmQwYS1iMDRlNTNjM2JiZTkiLCJpZCI6MjkyMSwiaWF0IjoxNTM1MjE4Mjk1fQ.jMg72t7Gnkk4-E9G7zhd_CoTJBUJ39hHALmxGBRL1ok';

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

var tileset = viewer.scene.primitives.add(
    new Cesium.Cesium3DTileset({
        url: Cesium.IonResource.fromAssetId(20238),
        //This tileset doesn't have a location, so we're using a modelMatrix to place it at 0, 0 instead of drawing at the center of the earth
        modelMatrix: Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(124.4187910489, 39.7961007694, -50))
    })
);

viewer.zoomTo(tileset)
    .otherwise(function (error) {
        console.log(error);
    });


3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I want to place 3dtile under terrain. 


4. The Cesium version you're using, your operating system and browser.
1.60, Windows10, Chrome


Omar Shehata

unread,
Aug 13, 2019, 10:32:35 AM8/13/19
to cesium-dev
Try setting depthTestAgainstTerrain (https://cesiumjs.org/Cesium/Build/Documentation/Globe.html?classFilter=Globe#depthTestAgainstTerrain) to true to make sure it's not visible when under ground. Let me know if that helps.

3DGISKing

unread,
Aug 13, 2019, 10:40:59 AM8/13/19
to cesiu...@googlegroups.com

Thank you very much. Problem fixed.

 

Sent from Mail for Windows 10

 

From: Omar Shehata
Sent: Tuesday, August 13, 2019 10:32 PM
To: cesium-dev
Subject: [cesium-dev] Re: Why 3d Tile under terrain show?

 

Try setting depthTestAgainstTerrain (https://cesiumjs.org/Cesium/Build/Documentation/Globe.html?classFilter=Globe#depthTestAgainstTerrain) to true to make sure it's not visible when under ground. Let me know if that helps.

On Saturday, August 10, 2019 at 2:19:48 PM UTC-4, jin ming wrote:

1. A concise explanation of the problem you're experiencing.

  I have a 3d tileset. It has no location info. 

  I made that 3d tileset to place underneath the terrain.

  But I can still see that 3d tile. Obviously, it is underneath terrain.

  I can not see it in Cesium Ion Location Editor with same location info.

  Who can explain why?

  How to fix? 

 

  This is screen capture in Cesium Ion Lcation Edior

 

 

This is screen capture in Cesium SandCastle.

 

 

 

 

 

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

 

// Grant CesiumJS access to your ion assets

Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2MzJlNDI2ZC1hMmE5LTQ4MjEtYmQwYS1iMDRlNTNjM2JiZTkiLCJpZCI6MjkyMSwiaWF0IjoxNTM1MjE4Mjk1fQ.jMg72t7Gnkk4-E9G7zhd_CoTJBUJ39hHALmxGBRL1ok';

 

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

 

var tileset = viewer.scene.primitives.add(

    new Cesium.Cesium3DTileset({

        url: Cesium.IonResource.fromAssetId(20238),

        //This tileset doesn't have a location, so we're using a modelMatrix to place it at 0, 0 instead of drawing at the center of the earth

        modelMatrix: Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(124.4187910489, 39.7961007694, -50))

    })

);

 

viewer.zoomTo(tileset)

    .otherwise(function (error) {

        console.log(error);

    });

 

 

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I want to place 3dtile under terrain. 

 

 

4. The Cesium version you're using, your operating system and browser.

1.60, Windows10, Chrome

 

 

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cesium-dev/c42f1e51-4a2f-4c67-a2af-443159f72794%40googlegroups.com.

 

Reply all
Reply to author
Forward
0 new messages