Render features and graphics in 3D

To take full advantage of the 3D environment, features and graphics provide additional API for controlling geoelement display in a scene or scene view. A set of symbols has been designed exclusively for three-dimensional display.

  • Layer scene properties: Properties of a layer or graphics overlay that are only evaluated for display in 3D. This includes surface placement, which controls how z-values (elevation or altitude, for example) are evaluated relative to the data in the scene view.
  • Renderer scene properties: Renderer properties that are only evaluated for display in 3D. Use these properties to extract two-dimensional geometries vertically (on the z-axis) or to define heading, pitch, and roll for geoelements.
  • 3D-specific symbols: Create symbols used exclusively for 3D display, such as 3D shapes (sphere, cylinder, cube, and so on) and 3D model symbols that provide a realistic display of 3D objects.

Layer scene properties

You can set additional properties that apply to feature layers and graphics overlays when they are displayed in a scene. These properties are defined on the LayerSceneProperties class and control how features and graphics are placed in 3D space. These properties are only evaluated for 3D display. When displayed in a map, they are ignored.

Surface placement

You can specify a surface placement mode for feature layers and graphics overlays that defines how the geometry z-value (elevation or altitude) is interpreted when each geoelement is rendered.

The SurfacePlacement enum provides the following values:

  • Draped billboarded—Ignore z-values and drape geoelements onto the surface. Symbols render to face the camera.
  • Draped flat—Ignore z-values and drape geoelements onto on the surface. Symbols render flat on the surface.
  • Absolute—Place geoelements by adding their z-value to the height of the globe skin (sea level).
  • Relative—Place geoelements by adding their z-value to the height of the scene's elevation surface.
  • Relative to scene—Place geoelements relative to objects in the scene, such as an elevation surface, buildings in a scene layer, integrated mesh layers, and extruded polygons. Some objects do not affect this type of placement, such as extruded points or lines, KML layers, or model symbols. Some combinations may not work for relative to scene placement, such as polygons placed relative to an integrated mesh layer.
  • Draped—(obsolete) Use either draped billboarded or draped flat instead.

The image below shows graphics with the same z-value rendered with different surface placement modes. The draped graphic is drawn on the elevation surface despite its z-value of 1000 meters. The graphic with absolute placement is drawn 1000 meters above the globe (sea level) and the graphic with relative placement is drawn 1000 meters above the elevation surface. If a graphic were added in the same location with relative to scene placement, it would be drawn 1000 meters above the graphic with the greatest z-value.

Examples of graphics drawn with different surface placement options.
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
// Create and add a new graphics overlay with Draped surface placement.
 val drapedOverlay = GraphicsOverlay()
 drapedOverlay.sceneProperties.surfacePlacement = SurfacePlacement.DrapedBillboarded
 graphicsOverlays.add(drapedOverlay)

 // Create and add a new graphics overlay with Relative surface placement.
 val relativeOverlay = GraphicsOverlay()
 relativeOverlay.sceneProperties.surfacePlacement = SurfacePlacement.Relative
 graphicsOverlays.add(relativeOverlay)

 // Create and add a new graphics overlay with Absolute surface placement.
 val absoluteOverlay = GraphicsOverlay()
 absoluteOverlay.sceneProperties.surfacePlacement = SurfacePlacement.Absolute
 graphicsOverlays.add(absoluteOverlay)

Renderer scene properties

You can set additional properties that apply to renderers when they display a feature layer or graphics overlay in a scene. These properties are defined on the RendererSceneProperties class and control additional rendering behavior for features and graphics. These properties are only evaluated for 3D rendering. When displayed in a map, they are ignored.

Extrusion

Extrusion is the process of extending a flat 2D shape vertically (along the z-axis) to create a 3D representation. This lets you create three-dimensional symbology from two-dimensional features. For example, you can extrude building polygons by their heights to create realistic building shapes. You can also use extrusion to illustrate relative values in your data. For example, you could extrude district polygons by median home value to visualize the most expensive areas of the city. The three basic geometry types (points, lines, and polygons) all support extrusion.

When using renderers in 3D, you can set properties to define extrusion expressions for both features and graphics. An extrusion expression can consist of a combination of attribute names, mathematical operators, and numeric values. An expression to extrude building polygons by the number of floors multiplied by ten might look like this: [floors] * 10, where "floors" is the name of the attribute that stores the number of floors for each building. If you want to extrude by an attribute value alone, the expression is just the attribute (field) name ([height], for example). Likewise, if you want to extrude by a specific value for each geoelement, your expression is the value to extrude by (125, for example).

There are several ways that an extrusion expression can be applied to extrude features. The ExtrusionMode enum provides the following values to define how geoelements are extruded.

  • None—Geoelements are not extruded.
  • Minimum—Geoelements are extruded to a flat top at a z-value determined by adding the extrusion height to the minimum z-value of the geoelement (the lowest z-value for all vertices contained by the geometry, in other words).
  • Maximum—Geoelements are extruded to a flat top at a z-value determined by adding the extrusion height to the maximum z-value of the geoelement (the highest z-value for all vertices contained by the geometry, in other words).
  • Absolute height—Geoelements are extruded to the specified z-value as a flat top, regardless of their z-values.
  • Base height—A z-value is calculated for each vertex of the geoelement's base, and it is extruded to the various z-values. This is the only extrusion mode that doesn't have a flat top.

The following image shows a graphics overlay of US states extruded based on a population attribute.

US state polygons extruded in height based on population.

To apply extrusion to a feature layer or graphics overlay:

  1. Create a new renderer.
  2. Set the relevant scene properties for the renderer.
    • Extrusion mode
    • Extrusion expression
  3. Assign the renderer to the feature layer or graphics overlay.
    • Ensure that the rendering mode is set to dynamic.
  4. Add the feature layer to the scene's operational layers or the graphics overlay to the scene view's graphics overlay collection.
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
// define line and fill symbols for a simple renderer
val lineSymbol = SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.black, 1.0f)
val fillSymbol = SimpleFillSymbol(SimpleFillSymbolStyle.Solid, Color.fromRgba(0,0,255), lineSymbol)
val renderer = SimpleRenderer(fillSymbol)
// set renderer extrusion mode to base height, which includes base height of each vertex in calculating z values
renderer.sceneProperties.extrusionMode = ExtrusionMode.BaseHeight
renderer.sceneProperties.extrusionExpression = "[POP2007] / 10"

// Set the simple renderer to the feature layer.
statesFeatureLayer.renderer = renderer

Rotation expressions

RendererSceneProperties has properties for defining expressions for heading, pitch, and roll for features or graphics displayed in 3D. Like extrusion expressions, these can include attribute (field) names, numbers, and mathematical operators.

  • Heading: An angle of rotation around the Z-axis, measured clockwise from north in an east-north-up (ENU) coordinate system. Values range from 0 to 360 degrees.
  • Pitch: An angle of rotation around the Y-axis in an east-north-up (ENU) coordinate system. Values range from 0 to 180 degrees, where 0 is looking straight down (to the center of the earth) and 180 is looking straight up (towards outer space).
  • Roll: An angle of rotation around the X-axis in an east-north-up (ENU) coordinate system. Values range from 0 to 360 degrees, where 0 is horizontal.

See the Prepare your graphics section of the Follow a graphic in a scene view topic for an example of setting heading, pitch, and roll expressions for a renderer.

Scene symbols

Graphics in a scene view graphics overlay can use the same (2D) symbols used for a map view. The following 3D-specific symbols are provided for graphics in a scene view:

  • Simple marker scene symbols—Cone, Cube, Cylinder, Diamond, Sphere, and Tetrahedron
  • Stroke symbol layer 3D line styles—Strip, Tube
  • Model 3D symbols—Displays a 3D model file
Simple 3D marker symbols.

Simple marker scene symbols provide a variety of styles (shapes) that can be applied. You can also set the size, color, and anchor position used for the symbol. To further control 3D display, you can also set heading, pitch, and roll.

Lines can be rendered in a scene view using a stroke symbol layer with either a Strip or Tube 3D line style. A strip displays a line that conforms to the surface of the scene, and a tube draws as a cylinder.

A model symbol provides a realistic three-dimensional visualization to symbolize scene features. These models define the geometry and surface textures of real-world items such as aircraft. Create a ModelSceneSymbol using a 3D model file, passing the path to the file and a scale factor to the model symbol constructor. Depending on the model file's default orientation, you may have to rotate the symbol to get your model in the desired orientation.

The supported model file types for 3D model symbols are:

  • 3D Max (.3ds)
  • Collada (.dae)
  • Filmbox (.fbx)
  • GL Transmission Format (.gltf, .glb)
  • Wavefront (.obj)

Distance composite symbols

A distance composite symbol is a collection of several symbols. It determines which symbol to display based on the current camera distance to the graphic. While model symbols can accurately represent real-world objects when viewed close up, they may not be visible when viewed at a distance (unless the size of the object is exaggerated). A distance composite symbol allows you to display a different symbol based on the camera distance to the graphic. They are commonly used to show more simple symbols at a great distance and more complex symbols when the camera approaches the graphic.

A composite marker symbol that shows a model symbol when the camera is near.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.