View on GitHub Sample viewer app

Vertically exaggerate terrain in a scene.

Image of terrain exaggeration

Use case

Vertical exaggeration can be used to emphasize subtle changes in a surface. This can be useful in creating visualizations of terrain where the horizontal extent of the surface is significantly greater than the amount of vertical change in the surface. A fractional vertical exaggeration can be used to flatten surfaces or features that have extreme vertical variation.

How to use the sample

Use the slider to update terrain exaggeration.

How it works

  1. Create an elevation surface from a URL with Surface.getElevationSources().add("elevationURL"). An elevation source defines the terrain based on a digital elevation model (DEM) or digital terrain model (DTM).
  2. Add the surface to the scene with scene.setBaseSurface(Surface). The surface visualizes the elevation source.
  3. Configure the surface’s elevation exaggeration using surface.setElevationExaggeration(exaggeration).

Relevant API

  • ArcGISScene
  • Surface

Tags

3D, DEM, DTM, elevation, scene, surface, terrain

Sample Code

module-info.java module-info.java TerrainExaggerationController.java TerrainExaggerationSample.java
/*
* Copyright 2022 Esri.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module com.esri.samples.terrain_exaggeration {
// require ArcGIS Maps SDK for Java module
requires com.esri.arcgisruntime;
// handle SLF4J http://www.slf4j.org/codes.html#StaticLoggerBinder
requires org.slf4j.nop;
// require JavaFX modules that the application uses
requires javafx.graphics;
requires javafx.controls;
requires javafx.fxml;
// make all @FXML annotated objects reflectively accessible to the javafx.fxml module
opens com.esri.samples.terrain_exaggeration to javafx.fxml;
exports com.esri.samples.terrain_exaggeration;
}