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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
    // Graphics overlay with draped billboarded surface placement
    GraphicsOverlay* drapedBillboardedOverlay = new GraphicsOverlay(this);
    drapedBillboardedOverlay->setSceneProperties(LayerSceneProperties(SurfacePlacement::DrapedBillboarded));
    m_sceneView->graphicsOverlays()->append(drapedBillboardedOverlay);

    // Graphics overlay with relative surface placement
    GraphicsOverlay* relativeOverlay = new GraphicsOverlay(this);
    relativeOverlay->setSceneProperties(LayerSceneProperties(SurfacePlacement::Relative));
    m_sceneView->graphicsOverlays()->append(relativeOverlay);

    // Graphics overlay with relative to scene surface placement
    GraphicsOverlay* relativeToSceneOverlay = new GraphicsOverlay(this);
    relativeToSceneOverlay->setSceneProperties(LayerSceneProperties(SurfacePlacement::RelativeToScene));
    m_sceneView->graphicsOverlays()->append(relativeToSceneOverlay);

    // Graphics overlay with absolute surface placement
    GraphicsOverlay* absoluteOverlay = new GraphicsOverlay(this);
    absoluteOverlay->setSceneProperties(LayerSceneProperties(SurfacePlacement::Absolute));
    m_sceneView->graphicsOverlays()->append(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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
    // set renderer with extrusion property
    SimpleRenderer* renderer = new SimpleRenderer(this);
    RendererSceneProperties props = renderer->sceneProperties();
    props.setExtrusionMode(ExtrusionMode::BaseHeight);
    props.setExtrusionExpression("[pop2010] / 50");
    renderer->setSceneProperties(props);
    SimpleFillSymbol* sfs = new SimpleFillSymbol(SimpleFillSymbolStyle::Solid, QColor("red"), this);
    renderer->setSymbol(sfs);
    graphicsOverlay->setRenderer(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.