How to show only 3d cutout of terrain

3d cutout of terrain

Hi, welcome to the community forum.

If you can provide some additional information it will help us provide a better answer to your question

  • What viewer are you using (eg. CesiumJS, Unreal, Unity, etc)?
  • Can you provide some more context about your use case and what you are trying to achieve?

thank you for replying me I have attached image I want to remove red marked part and only show map for asset that I have got from asset id

current code —> viewer.camera.flyTo({
destination: Cartesian3.fromDegrees(longitude, latitude, altitude),
})

    viewer.scene.terrainProvider =
      await CesiumTerrainProvider.fromIonAssetId(assetId)

    const globe = viewer.scene.globe

    const position = Cartographic.toCartesian(
      new Cartographic.fromDegrees(longitude, latitude, altitude)
    )

    const distance = 700.0
    const boundingSphere = new BoundingSphere(position, distance)

    globe.clippingPlanes = new ClippingPlaneCollection({
      modelMatrix: Transforms.eastNorthUpToFixedFrame(position),
      planes: [
        new ClippingPlane(new Cartesian3(1.0, 0.0, 0.0), distance),
        new ClippingPlane(new Cartesian3(-1.0, 0.0, 0.0), distance),
        new ClippingPlane(new Cartesian3(0.0, 1.0, 0.0), distance),
        new ClippingPlane(new Cartesian3(0.0, -1.0, 0.0), distance),
      ],
      unionClippingRegions: true,
      enabled: true,
    })
    globe.backFaceCulling = false
    globe.showSkirts = false

    viewer.camera.viewBoundingSphere(
      boundingSphere,
      new HeadingPitchRange(0.5, -0.5, boundingSphere.radius * 5.0)
    )
    viewer.camera.lookAtTransform(Matrix4.IDENTITY)

Thank you for providing that additional context. It looks like you are using CesiumJS. I’m going to transfer this thread to the CesiumJS forum where it will be seen by more users with experience in CesiumJS who could help.

I see you have also provided a code sample. The best way to share code examples that others can run is using https://sandcastle.cesium.com/. That way everyone can run the same code and see the same result. The asset detail panel in Cesium ion has a link that will get you started with an asset in sandcastle. You can also create a custom access token that is limited to a particular asset that is only valid on sandcastle.cesium.com if you want to share your data with others to help debug.